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.