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
- name: Install pip requirements
pip:
name: "python-neutronclient"
name: "shade"
state: "{{ octavia_pip_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
- name: Create mgmt network
neutron:
command: create_network
openrc_path: /root/openrc
net_name: "{{ octavia_neutron_management_network_name }}"
provider_network_type: flat
provider_physical_network: lbaas
insecure: "{{ keystone_service_internaluri_insecure }}"
os_network:
auth:
auth_url: "http://{{ test_keystone_host }}:5000/v3"
username: "{{ keystone_admin_user_name }}"
password: "{{ keystone_auth_admin_password }}"
project_name: "admin"
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
neutron:
command: create_subnet
openrc_path: /root/openrc
net_name: "{{ octavia_neutron_management_network_name }}"
subnet_name: "lbaas-mgmt-subnet"
os_subnet:
auth:
auth_url: "http://{{ test_keystone_host }}:5000/v3"
username: "{{ keystone_admin_user_name }}"
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"
insecure: "{{ keystone_service_internaluri_insecure }}"
vars_files:
- common/test-vars.yml

View File

@ -45,22 +45,34 @@
- "shade"
- name: Ensure public network exists
neutron:
command: create_network
openrc_path: /root/openrc
net_name: "public"
os_network:
auth:
auth_url: "{{ keystone_service_adminurl }}"
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_physical_network: "flat"
router_external: True
insecure: "{{ keystone_service_internaluri_insecure }}"
- name: Ensure public subnet exists
neutron:
command: create_subnet
openrc_path: /root/openrc
net_name: "public"
subnet_name: "public-subnet"
external: True
- name: Ensure public subnet exists
os_subnet:
auth:
auth_url: "{{ keystone_service_adminurl }}"
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
network_name: "public"
name: "public-subnet"
cidr: "10.1.3.0/24"
insecure: "{{ keystone_service_internaluri_insecure }}"
- name: Upload image to glance
shell: >-
glance image-create --name amphora-x64-haproxy --visibility private --disk-format qcow2 \
@ -68,7 +80,7 @@
&& touch {{ octavia_system_home_folder }}/image
args:
creates: "{{ octavia_system_home_folder }}/image"
environment: env
environment: "{{ env }}"
when: test_octavia_amphora | bool
- name: Create ssh-key
shell: >
@ -93,11 +105,11 @@
- name: Create a loadbalancer
shell: >
neutron lbaas-loadbalancer-create --name test-lb public-subnet
environment: env
environment: "{{ env }}"
- name: Wait until LB is up
shell: >
neutron lbaas-loadbalancer-show test-lb | grep ONLINE
environment: env
environment: "{{ env }}"
register: lb_up
until: lb_up|success
retries: 100
@ -105,11 +117,11 @@
- name: Create a listener
shell: >
neutron lbaas-listener-create --loadbalancer test-lb --protocol HTTP --protocol-port 80 --name listener
environment: env
environment: "{{ env }}"
- name: Curl the Listener
shell: >
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
when: test_octavia_amphora | bool
- name: Check that we got 503