From 0b00ac560c22c1bc377d94acac6e75790a890f02 Mon Sep 17 00:00:00 2001 From: "Andreas B. Mundt" Date: Thu, 12 Mar 2020 16:47:22 +0100 Subject: [PATCH] Add clients to server's inventory file. --- kerberox.yml | 1 + roles/prepare4clients/tasks/main.yml | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/kerberox.yml b/kerberox.yml index 2335fcf..ce8bbed 100644 --- a/kerberox.yml +++ b/kerberox.yml @@ -17,6 +17,7 @@ ## LAN IP address range: ipaddr_lan: 192.168.0.10/24 dhcp_range: 192.168.0.50,192.168.0.99,2h + in_inventory: 192.168.0.[50:99] di_dist: "{{ ansible_distribution_release }}" di_version: "{{ ansible_distribution_major_version }}" diff --git a/roles/prepare4clients/tasks/main.yml b/roles/prepare4clients/tasks/main.yml index 706882f..2dccbfa 100644 --- a/roles/prepare4clients/tasks/main.yml +++ b/roles/prepare4clients/tasks/main.yml @@ -146,3 +146,12 @@ dest: "/etc/systemd/system/git-repo.service" notify: start git-repo when: not run_in_installer|default(false)|bool + +###################### + +- name: add clients to inventory + blockinfile: + dest: /etc/ansible/hosts + block: | + [kerberox-client] + {{ in_inventory }}