Make nginx port configurable

This patch adds nginx_port var and uses it when setting up the nginx
service and for any reference to port 8080 when constructing links.
To change the port nginx uses pass --extra-vars "nginx_port=<port #>"

Change-Id: Ia06ef58544c3ef1308fcf42f1b9f0c168199f5f8
This commit is contained in:
Chris Krelle 2015-06-04 16:43:40 -07:00
parent b485d4d788
commit 4cf1c66c1a
8 changed files with 17 additions and 15 deletions

View File

@ -14,13 +14,14 @@ mysql_password:
# connectivity during atest sequence # connectivity during atest sequence
testing_user: ubuntu testing_user: ubuntu
http_boot_folder: /httpboot http_boot_folder: /httpboot
nginx_port: 8080
ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
latest_os_ironic_url: https://raw.githubusercontent.com/juliakreger/ansible-modules-extras/features/new-openstack/cloud/os_ironic.py latest_os_ironic_url: https://raw.githubusercontent.com/juliakreger/ansible-modules-extras/features/new-openstack/cloud/os_ironic.py
latest_os_ironic_node_url: https://raw.githubusercontent.com/juliakreger/ansible-modules-extras/features/new-openstack/cloud/os_ironic_node.py latest_os_ironic_node_url: https://raw.githubusercontent.com/juliakreger/ansible-modules-extras/features/new-openstack/cloud/os_ironic_node.py
deploy_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" deploy_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
deploy_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" deploy_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz"
deploy_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/coreos_production_pxe.vmlinuz" deploy_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz"
deploy_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/coreos_production_pxe_image-oem.cpio.gz" deploy_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
# When using disk image builder based image generation, which is the # When using disk image builder based image generation, which is the
# default at this time, the deploy_image_filename must end with .qcow2 # default at this time, the deploy_image_filename must end with .qcow2
# due to the image creation process. # due to the image creation process.

View File

@ -22,9 +22,9 @@
ironic_url: "{{ ironic_url }}" ironic_url: "{{ ironic_url }}"
uuid: "{{item.split(',')[9]}}" uuid: "{{item.split(',')[9]}}"
state: present state: present
config_drive: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/configdrive-{{item.split(',')[9]}}.iso.gz" config_drive: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/configdrive-{{item.split(',')[9]}}.iso.gz"
instance_info: instance_info:
image_source: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/{{deploy_image_filename}}" image_source: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/{{deploy_image_filename}}"
image_checksum: "{{ test_deploy_image.stat.md5 }}" image_checksum: "{{ test_deploy_image.stat.md5 }}"
image_disk_format: "raw" image_disk_format: "raw"
root_gb: 10 root_gb: 10

View File

@ -30,6 +30,7 @@ required_packages_ubuntu:
- kpartx - kpartx
- qemu-utils - qemu-utils
http_boot_folder: /httpboot http_boot_folder: /httpboot
nginx_port: 8080
ironicclient_source_install: false ironicclient_source_install: false
shade_source_install: true shade_source_install: true
# Configuration information for diskimage-builder # Configuration information for diskimage-builder
@ -50,8 +51,8 @@ latest_os_ironic_url: https://raw.githubusercontent.com/juliakreger/ansible-modu
latest_os_ironic_node_url: https://raw.githubusercontent.com/juliakreger/ansible-modules-extras/features/new-openstack/cloud/os_ironic_node.py latest_os_ironic_node_url: https://raw.githubusercontent.com/juliakreger/ansible-modules-extras/features/new-openstack/cloud/os_ironic_node.py
deploy_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" deploy_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz"
deploy_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" deploy_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz"
deploy_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/coreos_production_pxe.vmlinuz" deploy_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe.vmlinuz"
deploy_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/coreos_production_pxe_image-oem.cpio.gz" deploy_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/coreos_production_pxe_image-oem.cpio.gz"
deploy_image_filename: "trusty-server-cloudimg-amd64.img" deploy_image_filename: "trusty-server-cloudimg-amd64.img"
deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}" deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}"
# Use cirros instead of building an image via diskimage-builder # Use cirros instead of building an image via diskimage-builder

View File

@ -263,7 +263,7 @@
- name: "Creating image via disk image builder" - name: "Creating image via disk image builder"
include: create_dib_image.yml include: create_dib_image.yml
when: test_os_image_present.stat.exists == false and transform_boot_image == false and create_image_via_dib == true when: test_os_image_present.stat.exists == false and transform_boot_image == false and create_image_via_dib == true
- name: "Explicitly permit TCP/8080 for file downloads from nodes to be provisioned" - name: "Explicitly permit nginx port (TCP) for file downloads from nodes to be provisioned"
command: iptables -I INPUT -p tcp --dport 8080 -i {{network_interface}} -j ACCEPT command: iptables -I INPUT -p tcp --dport {{nginx_port}} -i {{network_interface}} -j ACCEPT
- name: "Explicitly permit TCP/6385 for IPA callback" - name: "Explicitly permit TCP/6385 for IPA callback"
command: iptables -I INPUT -p tcp --dport 6385 -i {{network_interface}} -j ACCEPT command: iptables -I INPUT -p tcp --dport 6385 -i {{network_interface}} -j ACCEPT

View File

@ -5,8 +5,8 @@ dhcp
goto deploy goto deploy
:deploy :deploy
kernel http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080{{ '{{' }} pxe_options.deployment_aki_path {{ '}}' }} ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} text {{ '{{' }} pxe_options.pxe_append_params {{ '}}' }} ipa-api-url={{ '{{' }} pxe_options['ipa-api-url'] {{ '}}' }} ipa-driver-name={{ '{{' }} pxe_options['ipa-driver-name'] {{ '}}' }} kernel http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}{{ '{{' }} pxe_options.deployment_aki_path {{ '}}' }} ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} text {{ '{{' }} pxe_options.pxe_append_params {{ '}}' }} ipa-api-url={{ '{{' }} pxe_options['ipa-api-url'] {{ '}}' }} ipa-driver-name={{ '{{' }} pxe_options['ipa-driver-name'] {{ '}}' }}
initrd http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080{{ '{{' }} pxe_options.deployment_ari_path {{ '}}' }} initrd http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}{{ '{{' }} pxe_options.deployment_ari_path {{ '}}' }}
boot boot

View File

@ -436,9 +436,9 @@ dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},12h
dhcp-match=set:ipxe,175 # iPXE sends a 175 option. dhcp-match=set:ipxe,175 # iPXE sends a 175 option.
dhcp-boot=tag:!ipxe,undionly.kpxe dhcp-boot=tag:!ipxe,undionly.kpxe
{% if testing %} {% if testing %}
dhcp-boot=http://192.168.122.1:8080/boot.ipxe dhcp-boot=http://192.168.122.1:{{nginx_port}}/boot.ipxe
{% else %} {% else %}
dhcp-boot=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/boot.ipxe dhcp-boot=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/boot.ipxe
{% endif %} {% endif %}
# Encapsulated options for Etherboot gPXE. All the options are # Encapsulated options for Etherboot gPXE. All the options are

View File

@ -1310,8 +1310,8 @@ pxe_bootfile_name=undionly.kpxe
#uefi_pxe_bootfile_name=elilo.efi #uefi_pxe_bootfile_name=elilo.efi
# Ironic compute node's HTTP server URL. Example: # Ironic compute node's HTTP server URL. Example:
# http://192.1.2.3:8080 (string value) # http://192.1.2.3:{{nginx_port}} (string value)
http_url=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/ http_url=http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:{{nginx_port}}/
# Ironic compute node's HTTP root path. (string value) # Ironic compute node's HTTP root path. (string value)
http_root={{ http_boot_folder }} http_root={{ http_boot_folder }}

View File

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