Issues with Wordpress update playbook.

I am trying to write a playbook that will iterate on a number of site’s webroot and will check for wordpress updates using wp-cli.
Now following are the issues I am facing:

  • I am unable to figure out a way to iterate over the folders(/var/www/*/htdocs).
  • How can I get the output of wp-cli in a human readable/formatted for ?
    Please if anyone can help !