summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-09-13 22:19:37 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-09-13 22:19:37 +0200
commitc9e2888390e16ca644a667da0b8d442938f16a0e (patch)
tree82498b73b37e8494ad4245ec5909099829c08f70
parentadd aptly repo (diff)
add constructed inventory
-rw-r--r--ansible.cfg7
-rw-r--r--inventory/constructed.yml4
-rw-r--r--inventory/hosts.ini1
3 files changed, 10 insertions, 2 deletions
diff --git a/ansible.cfg b/ansible.cfg
index 6dff2c62..ef74d99c 100644
--- a/ansible.cfg
+++ b/ansible.cfg
@@ -1,5 +1,5 @@
[defaults]
-inventory = ./inventory/hosts.ini
+inventory = ./inventory/hosts.ini, ./inventory/constructed.yml
roles_path = ./.galaxy:./roles
nocows = 1
@@ -29,6 +29,11 @@ force_valid_group_names = ignore
#strategy_plugins = ./contrib/mitogen/ansible_mitogen/plugins/strategy
#strategy = mitogen_linear
+
+[inventory]
+enable_plugins = constructed, ini
+
+
[ssh_connection]
pipelining = True
ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s
diff --git a/inventory/constructed.yml b/inventory/constructed.yml
new file mode 100644
index 00000000..2a7a0fe1
--- /dev/null
+++ b/inventory/constructed.yml
@@ -0,0 +1,4 @@
+plugin: constructed
+strict: True
+compose:
+ host_name: "host_name | default(inventory_hostname)"
diff --git a/inventory/hosts.ini b/inventory/hosts.ini
index c26678b9..41a9b0b2 100644
--- a/inventory/hosts.ini
+++ b/inventory/hosts.ini
@@ -1,5 +1,4 @@
[all:vars]
-host_name={{ inventory_hostname }}
ansible_user=root
ansible_port=222
ansible_python_interpreter=/usr/bin/python3