Skip to content

pageflt/ansible-jailventory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages