need to build the hosts file, too

This commit is contained in:
Neil Hanlon 2022-02-12 16:55:51 -05:00
parent 3917bfd364
commit 2e86c1ed28

View File

@ -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