A collection of Ansible modules, roles, playbooks for managing largescale infrastructure.
A dynamic inventory module for providing Ansible inventory from the contents of a MongoDB database.
Sample configuration:
---
plugin: mattgeddes.infrascale.mongodb
db_url: "mongodb://192.168.122.154:27017/"
db_name: "infrascale"
db_collection: "nodes"
db_groups_attr: "groups"
db_attrs:
- name
db_shard:
Sample MongoDB document representing a node:
{
"name": "node1.example.com",
"ansible_vars": {
"ansible_user": "ansible",
"ansible_become_method": "sudo"
},
"groups": [
"production"
]
}
Sample MongoDB document representing a group:
{
"name": "production",
"ansible_vars": {
"ansible_user": "root",
"ansible_python_interpreter": "/usr/bin/python3"
}
}