Hi,
I am writing an inventory playbook to fetch the system information such as CPU details, Network Related info, Disk space related info and system specific information.
Ansible already provides some of these info that i need in the setup module.
I want to customize it or rather fetch specific category of information from this setup module and write it to a template in json format.
I have done this using the custom module for fetching the third party information and fetched the information in the below format
{
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’logstash_version’: u’Not Installed’}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’mongod_version’: u’NOT_INSTALLED’}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’redis_version’: u’Not Installed’}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’nginx_version’: u’ nginx/1.8.0’}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’nodejs_version’: u’Not Installed’}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’django_version’: u’1.6’}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’php_version’: u’PHP 5.1.6 (cli)‘}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’httpd_version’: u’NOT_INSTALLED’}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’python_version’: u’Python 2.7.3’}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’psql_version’: u’psql (PostgreSQL) 8.1.18’}}},
{u’changed’: False, u’ansible_facts’: {u’Third_party_software’: {u’mysql_v’: u’mysql Ver 14.12’}}},
}
How could I do the same with my available facts?
Thanks in advance,
Mona G