On 19. aug. 2016 13:06, Rubén Ortiz wrote:
I have a silly playbook which just runs a command to get the list of vhost
in every host on webserver group. As all vhost are located in /var/www is
easy to get the list of webs.

The problem is the way of Ansible returns the info. For example:

ok: [host1] => {
    "var": {
        "out.stdout_lines": [
            "",
            "host1.com"
        ]
    }
}
ok: [host2] => {
    "var": {
        "out.stdout_lines": [
            "",
            "host2.com"
        ]
    }
}

Do you know an easy way to just get the name of the vhosts? Using grep awk
or something like that?

Maybe Ansible ad-hoc is something too use
ansible webservers -a "ls /var/www" | egrep -v ">>|^$"

--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0033f0d2-e58e-ba8c-12b4-f54e2d818f8b%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to