From 2e86c1ed28b51c0ef7edd8dc88a57d2eab1e10e6 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Sat, 12 Feb 2022 16:55:51 -0500 Subject: [PATCH] need to build the hosts file, too --- ansible/playbooks/tasks/init-nodes.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ansible/playbooks/tasks/init-nodes.yml b/ansible/playbooks/tasks/init-nodes.yml index 7816260..51d0f1b 100644 --- a/ansible/playbooks/tasks/init-nodes.yml +++ b/ansible/playbooks/tasks/init-nodes.yml @@ -121,11 +121,9 @@ flat: yes when: sshkey_register.ssh_public_key != "" register: sshkey_fetch - when: tag.find("infra") != -1 or aio_install | default(false) tags: infra - - name: Install packages on non-infra hosts when: tag.find("infra") != -1 or aio_install | default(false) ansible.builtin.dnf: @@ -146,6 +144,16 @@ when: tag.find("infra") == -1 and sshkey_fetch tags: sshkey + #- name: Setup a hosts file for the static deployment + # ansible.builtin.lineinfile: + # dest: /etc/hosts + # line: "{{ hostvars[ansible_fqdn]['ansible_br_mgmt']['ipv4']['address'] }} {{ ansible_hostname }}" + # when: + # - hostvars[ansible_fqdn]['ansible_br_mgmt'] is defined + # - hostvars[ansible_fqdn]['ansible_br_mgmt']['ipv4']['address'] is defined + # tags: debug123 + + - name: Disable cloud init from future runs file: path: /etc/cloud/cloud-init.disabled