We have just begun to use Ansible to manage some ALv2 instances in AWS. We manage RHEL 6/7, CentOS 6/7, OEL 6/7 in our home networks without problems. We have a playbook that gathers facts from servers and updates a local MySQL database. When this playbook runs against an ALv2 instance in AWS, it gets two facts that cannot nice be used as data for a MySQL insert. The ansible_distribution and ansible_os_family both come back as “NAME="Amazon”. The values for RHEL7, CentOS7 and OEL7 are properly formated single words.
(xxxx@yyyyy)$ ansible adminaws,gtlxgmsd02,gtlxgmsd04,gtlxgmsd03 -b -m setup | grep ‘ansible_distribution"’
“ansible_distribution”: “NAME="Amazon”,
“ansible_distribution”: “CentOS”,
“ansible_distribution”: “OracleLinux”,
“ansible_distribution”: “RedHat”,
I will be looking to clean the output of ‘setup’ for ALv2, but I would prefer that ALv2 look more like a normal derivative of RHEL 7. Does anyone know if this can be cleaned up via a configuration change on the ALv2 instance or ansible?