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
This commit is contained in:
Julia Kreger 2017-02-03 18:56:23 +00:00
parent 7f9fda7281
commit 1e5db8127e
4 changed files with 8 additions and 8 deletions

View File

@ -230,4 +230,3 @@ ironic_inspector:
# TODO(TheJulia): Thinking outloud, I we ought to head in the # TODO(TheJulia): Thinking outloud, I we ought to head in the
# direction of identifying the address of the conductor host # direction of identifying the address of the conductor host
# in a more uniform fashion. What that is exactly, is TBD. # in a more uniform fashion. What that is exactly, is TBD.
my_ip_address: "{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}"

View File

@ -138,8 +138,13 @@
include: keystone_setup.yml include: keystone_setup.yml
when: enable_keystone is defined and enable_keystone | bool == true 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" - name: "Generate ironic Configuration"
include: ironic_config.yml include: ironic_config.yml
- name: "Copy policy.json to /etc/ironic" - name: "Copy policy.json to /etc/ironic"
copy: copy:
src: "{{ ironic_git_folder }}/etc/ironic/policy.json" src: "{{ ironic_git_folder }}/etc/ironic/policy.json"

View File

@ -55,10 +55,6 @@
include: install.yml include: install.yml
when: skip_package_install | bool != True 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" - name: "Bootstrap Ironic"
include: bootstrap.yml include: bootstrap.yml
when: skip_bootstrap | bool != True when: skip_bootstrap | bool != True

View File

@ -29,18 +29,18 @@ auth_strategy = noauth
[pxe] [pxe]
pxe_append_params = systemd.journald.forward_to_console=yes {{ extra_kernel_options | default('') }} pxe_append_params = systemd.journald.forward_to_console=yes {{ extra_kernel_options | default('') }}
pxe_config_template = $pybasedir/drivers/modules/ipxe_config.template 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 tftp_root = /tftpboot
pxe_bootfile_name = undionly.kpxe pxe_bootfile_name = undionly.kpxe
ipxe_enabled = true ipxe_enabled = true
ipxe_boot_script = /etc/ironic/boot.ipxe ipxe_boot_script = /etc/ironic/boot.ipxe
[deploy] [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 }} http_root = {{ http_boot_folder }}
[conductor] [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 }} clean_nodes = {{ cleaning | lower }}
automated_clean = {{ cleaning | lower }} automated_clean = {{ cleaning | lower }}