# ansible-cmdb **Repository Path**: argaimar/ansible-cmdb ## Basic Information - **Project Name**: ansible-cmdb - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-02-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Ansible-CMDB This is just a play for Ansible. Use Ansible 'Setup' module to obtain facts, and create 'get_facts' module with python to obtain self-defined facts. Finally, all the facts would import into Mysql Database. # Usage 1. Please put get_facts.py to your ansible library in default with '/usr/share/my_modules'; 2. Execute the command 'ansible localhost -m get_facts'to check the results; 3. Change mysql connection arguments accordding to actual situation in ansible-cmdb.py main function; 4. Execute the command 'python ansible-cmdb.py' for the results; 5. It can be enquired from database named 'test' in table 'hosts_test'. # Condition 1. Your server must to be a MysqlServer, and already has a database named 'test'. 2. It must to be MySQLDB module in your Python. 3. The location you execute the command must to be able to read your ansible inventories.