Skip to content

Components for a MySQL-based Ansible dynamic inventory system

License

Notifications You must be signed in to change notification settings

a-abella/dynamic-inventory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ansible dynamic inventory boilerplate

Components for a MySQL-based Ansible dynamic inventory system

  • Construct Ansible dynamic inventory json from MySQL server inventory table
  • Query hostvar data for subsets of hosts
  • List groups and retrieve group members
  • Add hosts to MySQL inventory table

Usage with Ansible

ansible-playbook -i inventory.py playbook.yml

Command-line interface

usage: inventory.py [-h] [-l] {get,add} ...

Retrieve and insert dynamic inventory hosts

positional arguments:
  {get,add}
    get       retrieve hosts or groups
    add       write new hosts to inventory

optional arguments:
  -h, --help  show this help message and exit
  -l, --list  output entire inventory

About

Components for a MySQL-based Ansible dynamic inventory system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages