pageflt / ansible-jailventory

Ansible dynamic inventory provider for FreeBSD jails.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jailventory

Ansible dynamic inventory provider for FreeBSD jails.

Usage

  • Make sure jailventory.py is executable:
$ chmod +x jailventory.py
  • Add the following directive to your ansible.cfg:
inventory = /path/to/jailventory.py
  • Ansible should now automatically detect any active jails and add them to the jails group:
$ jls
   JID  IP Address      Hostname                      Path
    16  192.168.1.1     www                           /home/jails/www
    17  192.168.1.2     dns                           /home/jails/dns
$ ansible jails -m ping -o
dns | SUCCESS => {"changed": false, "ping": "pong"}
www | SUCCESS => {"changed": false, "ping": "pong"}
$ sudo service jail start mail
Starting jails: mail.
$ jls
   JID  IP Address      Hostname                      Path
    16  192.168.1.1     www                           /home/jails/www
    17  192.168.1.2     dns                           /home/jails/dns
    18  192.168.1.3     mail                          /home/jails/mail
$ ansible jails -m ping -o
dns | SUCCESS => {"changed": false, "ping": "pong"}
www | SUCCESS => {"changed": false, "ping": "pong"}
mail | SUCCESS => {"changed": false, "ping": "pong"}

About

Ansible dynamic inventory provider for FreeBSD jails.

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 100.0%