diff --git a/playbooks/roles/bifrost-deploy-nodes-dynamic/defaults/main.yml b/playbooks/roles/bifrost-deploy-nodes-dynamic/defaults/main.yml index 8238323ff..ec5d63c69 100644 --- a/playbooks/roles/bifrost-deploy-nodes-dynamic/defaults/main.yml +++ b/playbooks/roles/bifrost-deploy-nodes-dynamic/defaults/main.yml @@ -3,6 +3,7 @@ ironic_url: "http://localhost:6385/" nginx_port: 8080 network_interface: "virbr0" +ans_network_interface: "{{ network_interface | replace('-', '_') }}" http_boot_folder: "/httpboot" deploy_image_filename: "deployment_image.qcow2" deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}" diff --git a/playbooks/roles/bifrost-deploy-nodes-dynamic/tasks/main.yml b/playbooks/roles/bifrost-deploy-nodes-dynamic/tasks/main.yml index 849b20033..f88b579a3 100644 --- a/playbooks/roles/bifrost-deploy-nodes-dynamic/tasks/main.yml +++ b/playbooks/roles/bifrost-deploy-nodes-dynamic/tasks/main.yml @@ -24,7 +24,7 @@ ironic_url: "{{ ironic_url }}" uuid: "{{ uuid }}" state: present - config_drive: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{ nginx_port }}/configdrive-{{ uuid }}.iso.gz" + config_drive: "http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ nginx_port }}/configdrive-{{ uuid }}.iso.gz" instance_info: "{{ instance_info }}" delegate_to: localhost when: instance_info is defined @@ -42,9 +42,9 @@ ironic_url: "{{ ironic_url }}" uuid: "{{ uuid }}" state: present - config_drive: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{ nginx_port }}/configdrive-{{ uuid }}.iso.gz" + config_drive: "http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ nginx_port }}/configdrive-{{ uuid }}.iso.gz" instance_info: - image_source: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{ nginx_port }}/{{deploy_image_filename}}" + image_source: "http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ nginx_port }}/{{deploy_image_filename}}" image_checksum: "{{ test_deploy_image.stat.md5 }}" image_disk_format: "raw" root_gb: 10 diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index 4bcff12d0..7d3255171 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -14,11 +14,17 @@ transform_boot_image: false # virtual machines for the hardware instead of real hardware. testing: false ci_testing: false + +# Default network interface that bifrost will be attached to. +# This is used in ipa_* so it must be before +network_interface: "virbr0" +ans_network_interface: "{{ network_interface | replace('-', '_') }}" + ipa_kernel: "{{http_boot_folder}}/ipa.vmlinuz" ipa_ramdisk: "{{http_boot_folder}}/ipa.initramfs" -ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.vmlinuz" +ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.vmlinuz" ipa_kernel_upstream_url: http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe.vmlinuz -ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.initramfs" +ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.initramfs" ipa_ramdisk_upstream_url: http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem.cpio.gz deploy_image_filename: "deployment_image.qcow2" deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}" @@ -48,8 +54,6 @@ enabled_drivers: "agent_ipmitool,pxe_amt,agent_ilo,agent_ucs" # DHCP pool for requests. dhcp_pool_start: 192.168.1.200 dhcp_pool_end: 192.168.1.250 -# Default network interface that bifrost will be attached to. -network_interface: "virbr0" # Dnsmasq default route for clients. If not defined, dnsmasq will push to clients # as default route the same IP of the dnsmasq server. # Default: undefined diff --git a/playbooks/roles/bifrost-ironic-install/tasks/ironic_config.yml b/playbooks/roles/bifrost-ironic-install/tasks/ironic_config.yml index 7a6caa282..b77ff2746 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/ironic_config.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/ironic_config.yml @@ -83,7 +83,7 @@ dest=/etc/ironic/ironic.conf insertafter="[conductor]" regexp='^(.*)api_url=(.*)$' - line="api_url=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:6385/" + line="api_url=http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:6385/" - name: "Configure conductor cleaning" lineinfile: dest=/etc/ironic/ironic.conf @@ -112,7 +112,7 @@ dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)tftp_server=(.*)$' - line="tftp_server={{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}" + line="tftp_server={{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}" - name: "Set PXE tftp_root" lineinfile: dest=/etc/ironic/ironic.conf @@ -130,7 +130,7 @@ dest=/etc/ironic/ironic.conf insertafter="[pxe]" regexp='^(.*)http_url=(.*)$' - line="http_url=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/" + line="http_url=http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/" - name: "Set iPXE http_root" lineinfile: dest=/etc/ironic/ironic.conf diff --git a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 index b5b8049ef..e4f955239 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/dnsmasq.conf.j2 @@ -443,7 +443,7 @@ dhcp-boot=tag:!ipxe,/undionly.kpxe {% if testing %} dhcp-boot=http://192.168.122.1:{{nginx_port}}/boot.ipxe {% else %} -dhcp-boot=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/boot.ipxe +dhcp-boot=http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/boot.ipxe {% endif %} # Encapsulated options for Etherboot gPXE. All the options are diff --git a/playbooks/roles/ironic-enroll-dynamic/defaults/main.yml b/playbooks/roles/ironic-enroll-dynamic/defaults/main.yml index b3799be85..fdaa3a983 100644 --- a/playbooks/roles/ironic-enroll-dynamic/defaults/main.yml +++ b/playbooks/roles/ironic-enroll-dynamic/defaults/main.yml @@ -1,6 +1,10 @@ --- ironic_url: "http://localhost:6385/" nginx_port: 8080 + +# Default network interface that bifrost will be attached to. network_interface: "virbr0" -ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.vmlinuz" -ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.initramfs" +ans_network_interface: "{{ network_interface | replace('-', '_') }}" + +ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.vmlinuz" +ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.initramfs"