# Issue with Wordpress Update playbook

**URL:** <https://forum.ansible.com/t/issue-with-wordpress-update-playbook/21577>\
**Category:** Ansible Project\
**Created:** [May 26, 2016, 12:15pm UTC](https://forum.ansible.com/t/issue-with-wordpress-update-playbook/21577 "2016-05-26T12:15:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arush\_Salil](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@Arush\_Salil](https://forum.ansible.com/u/Arush_Salil)\
**Post date:** [May 26, 2016, 12:15pm UTC](https://forum.ansible.com/t/issue-with-wordpress-update-playbook/21577/1 "2016-05-26T12:15:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 26, 2016, 8:12pm UTC](https://forum.ansible.com/t/issue-with-wordpress-update-playbook/21577/2 "2016-05-26T20:12:25Z")

</div>

> The issues that I am facing are as below:
> 
> &nbsp;&nbsp;&nbsp;- 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)

> &nbsp;&nbsp;&nbsp;- How can I get the output of wp-cli for each host in a more human  
> &nbsp;&nbsp;&nbsp;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
