Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document ability to add users #55

Open
jrogers512 opened this issue Dec 11, 2017 · 6 comments
Open

Document ability to add users #55

jrogers512 opened this issue Dec 11, 2017 · 6 comments

Comments

@jrogers512
Copy link

The sample playbook would benefit from demonstrating how to use users, options, and queries.

@tersmitten
Copy link
Member

Did you find test.yml and vagrant.yml?

@tersmitten
Copy link
Member

tersmitten commented Dec 11, 2017

Can you make a PR to improve the README?

@jrogers512
Copy link
Author

jrogers512 commented Dec 17, 2017

I have seen test.yml and vagrant.yml, however the users is empty in both, and it isn't clear to me what options is doing:

options: 
          - command: update
            name: testtest
            value: 'not existing'

What is this updating? This looks like keypairs that can be added, but what is this doing? If I were to run the command via wp-cli, what would the syntax be?

queries appears to be a way to arbitrarily execute an sql query. This seems like something that shouldn't be in this role?

@tersmitten
Copy link
Member

You might want to have a look at the wp-cli commands. I'll see if I can add an example for adding users.

@jrogers512
Copy link
Author

So, for users.src, I presume the argument is the csv like this:

users.src: files/wp-users.csv

with the contents of the file being the same format that wp-cli uses.

It's the users: [] format that I'm unsure about. wp-cli users command calls for a verb (create, delete, update) and some command line switches for username, role, pass, etc. Is 'users:' supposed to be a python list of wp-cli user commands? Ie, would this:

$ wp user create bob [email protected] --role=author
$ wp user update 123 --display_name=Mary --user_pass=marypass
$ wp user delete 123 --reassign=567

be written in the playbook as:

    users: [ 'create bob [email protected] --role=author', 'update 123 --display_name=Mary --user_pass=marypass', 'delete 123 --reassign=567' ]

Or something else?

@jrogers512
Copy link
Author

Actually, I see in your example: user: {} which is an empty dict. This suggests key value pairs. I'm imagining some more complex nested dict structure?

user: { "bob": { "email": "[email protected]", "role": "author" }, 123: { "display_name": "Mary", "user_pass": "marypass" }, 123: {"delete":true, "reassign":567}}

Wild guess though, I doubt that is correct.... Is my question more clear here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants