From 78645a4d776a60ca616fe124605fd3174f2bd403 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 25 Oct 2021 22:49:47 +0200 Subject: [PATCH] adjust the inventory variable --- tasks/main.yml | 6 +++--- templates/ansible.cfg.j2 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index d4a6566..27b785f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,7 +11,7 @@ - name: "Get the Proxmox Ansible inventory" ansible.builtin.get_url: url: "https://github.com/xezpeleta/Ansible-Proxmox-inventory/raw/master/proxmox.py" - dest: "/etc/ansible/proxmox.py" + dest: "/etc/ansible/{{ ansible_inventory }}.py" mode: "0777" - name: "Copy the ansible config" @@ -22,6 +22,6 @@ - name: "Copy the inventory config" ansible.builtin.template: - src: "proxmox.json.j2" - dest: "/etc/ansible/proxmox.json" + src: "{{ ansible_inventory }}.json.j2" + dest: "/etc/ansible/{{ ansible_inventory }}.json" mode: "0644" diff --git a/templates/ansible.cfg.j2 b/templates/ansible.cfg.j2 index 7933858..52e2109 100644 --- a/templates/ansible.cfg.j2 +++ b/templates/ansible.cfg.j2 @@ -11,7 +11,7 @@ # some basic default values... -inventory = /etc/ansible/{{ ansible_inventory }} +inventory = /etc/ansible/{{ ansible_inventory }}.py #library = /usr/share/my_modules/ #module_utils = /usr/share/my_module_utils/ #remote_tmp = ~/.ansible/tmp