From 1e5db8127e71cb38da06674b8d6991c2805f62c2 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Fri, 3 Feb 2017 18:56:23 +0000 Subject: [PATCH] Remove my_ip_address from use With recent gate failures, the possibility exists that the fact, via being a default, for my_ip_address, is being fullfilled as part of template expansion as opposed to runtime. Since it is possible that things are still in flight with a test run, we should utilize the entire variable so it is expanded when it is needed, after a refresh has occured. Also moved the collection of facts to later after the completion of package installation, into the bootstrap step since it is only required in the bootstrap step, and not until users and database access configuration has already been asserted. Change-Id: I74f936ee0440d4afaedafc8eff5936196186d743 --- playbooks/roles/bifrost-ironic-install/defaults/main.yml | 1 - playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml | 5 +++++ playbooks/roles/bifrost-ironic-install/tasks/main.yml | 4 ---- .../roles/bifrost-ironic-install/templates/ironic.conf.j2 | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index 0697144e8..8646851b6 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -230,4 +230,3 @@ ironic_inspector: # TODO(TheJulia): Thinking outloud, I we ought to head in the # direction of identifying the address of the conductor host # in a more uniform fashion. What that is exactly, is TBD. -my_ip_address: "{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}" diff --git a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml index a873f2484..e5299fccc 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml @@ -138,8 +138,13 @@ include: keystone_setup.yml when: enable_keystone is defined and enable_keystone | bool == true +# NOTE(pas-ha) needed to e.g. pick up new interfaces after libvirt install +- name: "Refresh facts" + setup: + - name: "Generate ironic Configuration" include: ironic_config.yml + - name: "Copy policy.json to /etc/ironic" copy: src: "{{ ironic_git_folder }}/etc/ironic/policy.json" diff --git a/playbooks/roles/bifrost-ironic-install/tasks/main.yml b/playbooks/roles/bifrost-ironic-install/tasks/main.yml index cd5aa845a..f728310c8 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/main.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/main.yml @@ -55,10 +55,6 @@ include: install.yml when: skip_package_install | bool != True -# NOTE(pas-ha) needed to e.g. pick up new interfaces after libvirt install -- name: "Refresh facts" - setup: - - name: "Bootstrap Ironic" include: bootstrap.yml when: skip_bootstrap | bool != True diff --git a/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 index d537dda22..ac5f6d339 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 @@ -29,18 +29,18 @@ auth_strategy = noauth [pxe] pxe_append_params = systemd.journald.forward_to_console=yes {{ extra_kernel_options | default('') }} pxe_config_template = $pybasedir/drivers/modules/ipxe_config.template -tftp_server = {{ my_ip_address }} +tftp_server = {{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }} tftp_root = /tftpboot pxe_bootfile_name = undionly.kpxe ipxe_enabled = true ipxe_boot_script = /etc/ironic/boot.ipxe [deploy] -http_url = http://{{ my_ip_address }}:{{ file_url_port }}/ +http_url = http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ file_url_port }}/ http_root = {{ http_boot_folder }} [conductor] -api_url = http://{{ my_ip_address }}:6385/ +api_url = http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:6385/ clean_nodes = {{ cleaning | lower }} automated_clean = {{ cleaning | lower }}