Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pageflt/ansible-jailventory

Ansible dynamic inventory provider for FreeBSD jails.
https://github.com/pageflt/ansible-jailventory

ansible configuration-management freebsd jail

Last synced: 10 days ago
JSON representation

Ansible dynamic inventory provider for FreeBSD jails.

Awesome Lists containing this project

README

        

# 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"}
```