openstack-ansible-os_octavia/tests/test-configure-octavia.yml
German Eichberger 19e1610dbb Change the way we access the env variable
Switch to os_network from neutron

Change-Id: I6f0fd9daa4a37751a7449973760079363e64db2d
2017-06-21 14:58:13 -04:00

115 lines
3.9 KiB
YAML

---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Setup localhost requirements
hosts: localhost
become: True
gather_facts: True
tasks:
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: "{{ octavia_package_state }}"
update_cache: yes
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items:
- qemu
- uuid-runtime
- curl
- kpartx
- git
- name: Install pip requirements
pip:
name: "{{ item }}"
state: "{{ octavia_pip_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items:
- argparse
- "Babel>=1.3"
- dib-utils
- PyYAML
- name: Clone Octavia
git:
repo: "https://git.openstack.org/openstack/octavia"
dest: "{{ octavia_system_home_folder }}/octavia"
version: "{{ octavia_git_install_branch }}"
- name: Clone Diskimage-Builder
git:
repo: "https://git.openstack.org/openstack/diskimage-builder"
dest: "{{ octavia_system_home_folder }}/diskimage-builder"
- name: Create amphora image
shell: "./diskimage-create.sh -o {{ octavia_system_home_folder }}/amphora-x64-haproxy.qcow2"
args:
chdir: "{{ octavia_system_home_folder }}/octavia/diskimage-create"
creates: "{{ octavia_system_home_folder }}/amphora-x64-haproxy.qcow2"
when: test_octavia_amphora | bool
- name: Change permission
file:
path: "{{ octavia_system_home_folder }}/octavia/bin/create_certificates.sh"
mode: 0755
- name: Generate certs
shell: "{{ octavia_system_home_folder }}/octavia/bin/create_certificates.sh {{ octavia_system_home_folder }}/certs {{ octavia_system_home_folder }}/octavia/etc/certificates/openssl.cnf"
args:
creates: "{{ octavia_system_home_folder }}/certs/ca_01.pem"
- name: Fix certs/private directory access
file:
path: "{{ octavia_system_home_folder }}/certs/private"
mode: 0755
- name: Install pip requirements
pip:
name: "shade"
state: "{{ octavia_pip_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
- name: Create mgmt network
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
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"
vars_files:
- common/test-vars.yml