Hi All :)

I am using ansible 2.0.1 on both aws and openstack kilo. I would like to 
run the same playbook with appropriate conditions so that part of it would 
be run when iaas is aws and another part when iaas is openstack. I checked 
with the setup module that:
 - for aws vm:

$ ansible -m setup 127.0.0.1 | egrep -i 
'aws|amazon|openstack|virtualization'
        "ansible_bios_version": "4.2.amazon",
        "ansible_product_version": "4.2.amazon",
        "ansible_virtualization_role": "guest",
        "ansible_virtualization_type": "xen",

- for openstack vm:

 ansible -m setup 127.0.0.1 | egrep -i 'aws|amazon|openstack|virtualization'
        "ansible_product_name": "OpenStack Nova",
        "ansible_system_vendor": "OpenStack Foundation",
        "ansible_virtualization_role": "host",
        "ansible_virtualization_type": "kvm",

so I can differentiate/divide tasks based on for example regex on 
"ansible_product_name". Is there a better way to build playbooks for aws 
and openstack?

BR,
Rafal.

-- 
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/332c1349-fa2a-45c8-8a06-83cb5e8f61c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to