Rename of the nginx_port variable

The nginx_port variable is insufficiently generic enough in the event
a user really wanted to run Apache, or some other web server.

As such, this commit renames the setting to file_url_port to
prevent any confusion meanwhile supporting the ability to continue to
use an override setting should the variable nginx_port be defined in
an externally generated variable setting file.

Change-Id: Ida88cdec6ba162920df09dbdd335a9ad7868c842
This commit is contained in:
Julia Kreger 2016-01-22 16:41:50 -05:00 committed by Chris Krelle
parent c26d57d5ef
commit 9f5608fbad
11 changed files with 35 additions and 24 deletions

View File

@ -19,15 +19,15 @@ testing_user: root
# The default port to download files via. Required for IPA URL generation.
# Presently the defaults are located in the roles, however if changed both
# the localhost and baremetal group files must be updated.
# nginx_port: 8080
# file_url_port: 8080
# IPA Image parameters. If these are changed, they must be changed in
# Both localhost and baremetal groups. Presently the defaults
# in each role should be sufficent for proper operation.
# ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
# ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz"
# ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz"
# ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
# ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{file_url_port}}/coreos_production_pxe.vmlinuz"
# ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{file_url_port}}/coreos_production_pxe_image-oem.cpio.gz"
# The http_boot_folder defines the root folder for the webserver.
# If this setting is changed, it must be applied to both the baremetal

View File

@ -26,15 +26,15 @@ mysql_password:
# The default port to download files via. Required for IPA URL generation.
# Presently the defaults are located in the roles, however if changed both
# the localhost and baremetal group files must be updated.
# nginx_port: 8080
# file_url_port: 8080
# IPA Image parameters. If these are changed, they must be changed in
# Both localhost and baremetal groups. Presently the defaults
# in each role should be sufficent for proper operation.
# ipa_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
# ipa_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz"
# ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz"
# ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
# ipa_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{file_url_port}}/coreos_production_pxe.vmlinuz"
# ipa_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{file_url_port}}/coreos_production_pxe_image-oem.cpio.gz"
# The http_boot_folder defines the root folder for the webserver.
# If this setting is changed, it must be applied to both the baremetal

View File

@ -1,7 +1,9 @@
---
# defaults file for bifrost-deploy-nodes-dynamic
ironic_url: "http://localhost:6385/"
nginx_port: 8080
# Deprecated: nginx_port is no longer used and file_url_port should
# be used instead.
file_url_port: "{{ nginx_port | default('8080') }}"
network_interface: "virbr0"
ans_network_interface: "{{ network_interface | replace('-', '_') }}"
http_boot_folder: "/httpboot"

View File

@ -45,7 +45,7 @@
ironic_url: "{{ ironic_url }}"
uuid: "{{ uuid }}"
state: present
config_drive: "{{ deploy_url_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ nginx_port }}/configdrive-{{ uuid }}.iso.gz"
config_drive: "{{ deploy_url_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ file_url_port }}/configdrive-{{ uuid }}.iso.gz"
instance_info: "{{ instance_info }}"
delegate_to: localhost
when: instance_info is defined and instance_info | to_json != '{}'
@ -63,9 +63,9 @@
ironic_url: "{{ ironic_url }}"
uuid: "{{ uuid }}"
state: present
config_drive: "{{ deploy_url_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ nginx_port }}/configdrive-{{ uuid }}.iso.gz"
config_drive: "{{ deploy_url_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ file_url_port }}/configdrive-{{ uuid }}.iso.gz"
instance_info:
image_source: "{{ deploy_url_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ nginx_port }}/{{deploy_image_filename}}"
image_source: "{{ deploy_url_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ file_url_port }}/{{deploy_image_filename}}"
image_checksum: "{{ test_deploy_image.stat.md5 }}"
image_disk_format: "qcow2"
root_gb: 10

View File

@ -3,7 +3,9 @@
# which causes the nodes to be wiped after deletion.
cleaning: false
http_boot_folder: /httpboot
nginx_port: 8080
# Deprecated: nginx_port is no longer used and file_url_port should
# be used instead.
file_url_port: "{{ nginx_port | default('8080') }}"
ironicclient_source_install: false
shade_source_install: true
# Setting to utilize diskimage-builder to create a bootable image.
@ -29,9 +31,9 @@ ipa_file_protocol: "http"
ipa_kernel: "{{http_boot_folder}}/ipa.vmlinuz"
ipa_ramdisk: "{{http_boot_folder}}/ipa.initramfs"
ipa_kernel_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.vmlinuz"
ipa_kernel_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{file_url_port}}/ipa.vmlinuz"
ipa_kernel_upstream_url: http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe.vmlinuz
ipa_ramdisk_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.initramfs"
ipa_ramdisk_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{file_url_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}}"

View File

@ -128,7 +128,7 @@
dest=/etc/ironic/ironic.conf
insertafter="[pxe]"
regexp='^(.*)http_url=(.*)$'
line="http_url=http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/"
line="http_url=http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ file_url_port }}/"
- name: "Set iPXE http_root"
lineinfile:
dest=/etc/ironic/ironic.conf

View File

@ -32,6 +32,12 @@
- "../defaults/required_defaults_{{ ansible_distribution }}_{{ansible_distribution_release }}.yml"
- "../defaults/required_defaults_{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml"
- "../defaults/dummy-defaults.yml"
- name: "Warn if deprecated variable nginx_port is set"
debug:
msg: >
WARNING - nginx_port is a deprecated variable and support will be
removed during the Newton cycle.
when: nginx_port is defined
- name: "Update Package Cache"
apt: update_cache=yes
when: ansible_os_family == 'Debian'
@ -370,7 +376,7 @@
"Explicitly permit nginx port (TCP) for
file downloads from nodes to be provisioned"
command: >
iptables -I INPUT -p tcp --dport {{nginx_port}}
iptables -I INPUT -p tcp --dport {{file_url_port}}
-i {{network_interface}} -j ACCEPT
- name: "Explicitly permit TCP/6385 for IPA callback"
command: >

View File

@ -87,9 +87,9 @@ dhcp-boot=tag:gpxe,/ipxe.pxe
dhcp-match=set:ipxe,175 # iPXE sends a 175 option.
dhcp-boot=tag:!ipxe,/undionly.kpxe
{% if testing %}
dhcp-boot=http://192.168.122.1:{{nginx_port}}/boot.ipxe
dhcp-boot=http://192.168.122.1:{{ file_url_port }}/boot.ipxe
{% else %}
dhcp-boot=http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/boot.ipxe
dhcp-boot=http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ file_url_port }}/boot.ipxe
{% endif %}
{% if testing %}

View File

@ -5,6 +5,6 @@ dhcp
goto introspect
:introspect
kernel http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{ nginx_port }}/ipa.vmlinuz ipa-inspection-callback-url=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:5050/v1/continue systemd.journald.forward_to_console=yes ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} nofb nomodeset vga=normal console=ttyS0
initrd http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{ nginx_port }}/ipa.initramfs
kernel http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{ file_url_port }}/ipa.vmlinuz ipa-inspection-callback-url=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:5050/v1/continue systemd.journald.forward_to_console=yes ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} nofb nomodeset vga=normal console=ttyS0
initrd http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{ file_url_port }}/ipa.initramfs
boot

View File

@ -40,7 +40,7 @@ http {
gzip on;
server {
listen {{nginx_port}};
listen {{ file_url_port }};
server_name {{ ansible_hostname }};
root {{ http_boot_folder }};
location {{ http_boot_folder }}/ {

View File

@ -1,7 +1,8 @@
---
ironic_url: "http://localhost:6385/"
nginx_port: 8080
# Deprecated: nginx_port is no longer used and file_url_port should
# be used instead.
file_url_port: "{{ nginx_port | default('8080') }}"
# Default network interface that bifrost will be attached to.
network_interface: "virbr0"
ans_network_interface: "{{ network_interface | replace('-', '_') }}"
@ -13,7 +14,7 @@ ans_network_interface: "{{ network_interface | replace('-', '_') }}"
# documentation at http://ipxe.org/crypto
ipa_file_protocol: "http"
ipa_kernel_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.vmlinuz"
ipa_ramdisk_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{nginx_port}}/ipa.initramfs"
ipa_kernel_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{file_url_port}}/ipa.vmlinuz"
ipa_ramdisk_url: "{{ ipa_file_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{file_url_port}}/ipa.initramfs"
noauth_mode: true