Change the way we access the env variable

Switch to os_network from neutron

Change-Id: I6f0fd9daa4a37751a7449973760079363e64db2d
This commit is contained in:
German Eichberger 2017-06-21 11:52:24 -04:00
parent 2c38da4085
commit 19e1610dbb
2 changed files with 56 additions and 32 deletions

View File

@ -75,28 +75,40 @@
mode: 0755 mode: 0755
- name: Install pip requirements - name: Install pip requirements
pip: pip:
name: "python-neutronclient" name: "shade"
state: "{{ octavia_pip_package_state }}" state: "{{ octavia_pip_package_state }}"
register: install_packages register: install_packages
until: install_packages|success until: install_packages|success
retries: 5 retries: 5
delay: 2 delay: 2
- name: Create mgmt network - name: Create mgmt network
neutron: os_network:
command: create_network auth:
openrc_path: /root/openrc auth_url: "http://{{ test_keystone_host }}:5000/v3"
net_name: "{{ octavia_neutron_management_network_name }}" username: "{{ keystone_admin_user_name }}"
provider_network_type: flat password: "{{ keystone_auth_admin_password }}"
provider_physical_network: lbaas project_name: "admin"
insecure: "{{ keystone_service_internaluri_insecure }}" user_domain_name: "Default"
project_domain_name: "Default"
endpoint_type: "internal"
state: present
name: "{{ octavia_neutron_management_network_name }}"
provider_network_type: "flat"
provider_physical_network: "lbaas"
- name: Ensure mgmt subnet exists - name: Ensure mgmt subnet exists
neutron: os_subnet:
command: create_subnet auth:
openrc_path: /root/openrc auth_url: "http://{{ test_keystone_host }}:5000/v3"
net_name: "{{ octavia_neutron_management_network_name }}" username: "{{ keystone_admin_user_name }}"
subnet_name: "lbaas-mgmt-subnet" password: "{{ keystone_auth_admin_password }}"
project_name: "admin"
user_domain_name: "Default"
project_domain_name: "Default"
endpoint_type: "internal"
state: present
network_name: "{{ octavia_neutron_management_network_name }}"
name: "lbaas-mgmt-subnet"
cidr: "10.1.7.0/24" cidr: "10.1.7.0/24"
insecure: "{{ keystone_service_internaluri_insecure }}"
vars_files: vars_files:
- common/test-vars.yml - common/test-vars.yml

View File

@ -45,22 +45,34 @@
- "shade" - "shade"
- name: Ensure public network exists - name: Ensure public network exists
neutron: os_network:
command: create_network auth:
openrc_path: /root/openrc auth_url: "{{ keystone_service_adminurl }}"
net_name: "public" username: "{{ octavia_service_user_name }}"
password: "{{ octavia_service_password }}"
project_name: "{{ octavia_service_project_name }}"
user_domain_name: "{{ octavia_service_user_domain_id }}"
project_domain_name: "{{ octavia_service_project_domain_id }}"
endpoint_type: "{{ octavia_ansible_endpoint_type }}"
state: present
name: "public"
provider_network_type: "flat" provider_network_type: "flat"
provider_physical_network: "flat" provider_physical_network: "flat"
router_external: True external: True
insecure: "{{ keystone_service_internaluri_insecure }}" - name: Ensure public subnet exists
- name: Ensure public subnet exists os_subnet:
neutron: auth:
command: create_subnet auth_url: "{{ keystone_service_adminurl }}"
openrc_path: /root/openrc username: "{{ octavia_service_user_name }}"
net_name: "public" password: "{{ octavia_service_password }}"
subnet_name: "public-subnet" project_name: "{{ octavia_service_project_name }}"
user_domain_name: "{{ octavia_service_user_domain_id }}"
project_domain_name: "{{ octavia_service_project_domain_id }}"
endpoint_type: "{{ octavia_ansible_endpoint_type }}"
state: present
network_name: "public"
name: "public-subnet"
cidr: "10.1.3.0/24" cidr: "10.1.3.0/24"
insecure: "{{ keystone_service_internaluri_insecure }}"
- name: Upload image to glance - name: Upload image to glance
shell: >- shell: >-
glance image-create --name amphora-x64-haproxy --visibility private --disk-format qcow2 \ glance image-create --name amphora-x64-haproxy --visibility private --disk-format qcow2 \
@ -68,7 +80,7 @@
&& touch {{ octavia_system_home_folder }}/image && touch {{ octavia_system_home_folder }}/image
args: args:
creates: "{{ octavia_system_home_folder }}/image" creates: "{{ octavia_system_home_folder }}/image"
environment: env environment: "{{ env }}"
when: test_octavia_amphora | bool when: test_octavia_amphora | bool
- name: Create ssh-key - name: Create ssh-key
shell: > shell: >
@ -93,11 +105,11 @@
- name: Create a loadbalancer - name: Create a loadbalancer
shell: > shell: >
neutron lbaas-loadbalancer-create --name test-lb public-subnet neutron lbaas-loadbalancer-create --name test-lb public-subnet
environment: env environment: "{{ env }}"
- name: Wait until LB is up - name: Wait until LB is up
shell: > shell: >
neutron lbaas-loadbalancer-show test-lb | grep ONLINE neutron lbaas-loadbalancer-show test-lb | grep ONLINE
environment: env environment: "{{ env }}"
register: lb_up register: lb_up
until: lb_up|success until: lb_up|success
retries: 100 retries: 100
@ -105,11 +117,11 @@
- name: Create a listener - name: Create a listener
shell: > shell: >
neutron lbaas-listener-create --loadbalancer test-lb --protocol HTTP --protocol-port 80 --name listener neutron lbaas-listener-create --loadbalancer test-lb --protocol HTTP --protocol-port 80 --name listener
environment: env environment: "{{ env }}"
- name: Curl the Listener - name: Curl the Listener
shell: > shell: >
curl -s -o /dev/null -w "%{http_code}" http://`neutron lbaas-loadbalancer-show test-lb | awk '/ vip_address / {print $4}'` curl -s -o /dev/null -w "%{http_code}" http://`neutron lbaas-loadbalancer-show test-lb | awk '/ vip_address / {print $4}'`
environment: env environment: "{{ env }}"
register: http_status_code register: http_status_code
when: test_octavia_amphora | bool when: test_octavia_amphora | bool
- name: Check that we got 503 - name: Check that we got 503