Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 1.38 KB

README.md

File metadata and controls

39 lines (31 loc) · 1.38 KB

Consul inventory source for AWX/Tower

Build Status

Aims to provide an inventory script for AWX/Tower as first target but also usable by vanilla Ansible with Consul catalog as data source.

Standalone Ansible inventory scripts can rely on INI configuration file where AWX/Tower rely only on environment variables. All data are pulled from the catalog API.

Usage

AWX

Simply add this script as inventory within AWX/Tower following the official documentation.

Standalone Ansible

Following Working with dynamic inventory documentation, the simplest method to use this script as inventory is the implicit method:

wget https://raw.githubusercontent.com/wilfriedroset/consul-awx/master/consul_awx.py -o /etc/ansible/hosts
chmod +x /etc/ansible/hosts
# Configure it
cat << EOF > /etc/ansible/consul_awx.ini
[consul]
host: 127.0.0.1
port: 8500
scheme: http
verify: true
EOF
# Test it
/etc/ansible/hosts --list

Credits

This script was mostly inspired by consul_io.py