openstack-ansible-os_octavia/tests/test-configure-octavia.yml
German Eichberger 1c1f769adc Fixes Lint errors and improve tests
* adds skip_ansible_lint where necessary
* moves tests to openstack client

Change-Id: Ib0d0250be713c547f87007cc84ea373978220505
2018-02-26 11:46:02 +00:00

93 lines
3.0 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 }}"
tags:
- skip_ansible_lint
- name: Clone Diskimage-Builder
git:
repo: "https://git.openstack.org/openstack/diskimage-builder"
dest: "{{ octavia_system_home_folder }}/diskimage-builder"
version: "2.9.0"
- 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
tags:
- skip_ansible_lint
- 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"
tags:
- skip_ansible_lint
- 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
vars_files:
- common/test-vars.yml