I am writing a playbook to check for wordpress updates using wp-cli.
The issues that I am facing are as below:
- I am unable to figure out how to iterate in “/var/www/*/htdocs”
- How can I get the output of wp-cli for each host in a more human readable/formatted form? Currently I am getting the output by using debug.
Any help would be greatly appreciated. Thank you
The issues that I am facing are as below:
- I am unable to figure out how to iterate in "/var/www/*/htdocs"
At first thought I would use a shell task that does a ls -1 (thats a
one, not the letter L) on the /var/www/ directory. Register the output
of that in a variable foobar, and you could iterate over
foobar.stdout_lines somehow (not sure about the exact syntax)
- How can I get the output of wp-cli for each host in a more human
readable/formatted form? Currently I am getting the output by using debug.
I would not got for human readable, but rather let ansible look for
some string in the output. And do the update or do not do it,
depending on the existence of the string in the output.
Johannes