openstack-ansible/tests/roles/bootstrap-host/tasks/prepare_octavia.yml

79 lines
2.3 KiB
YAML

---
# Copyright 2015, 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: Install apt packages
apt:
pkg: "{{ item }}"
state: "present"
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: "present"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items:
- argparse
- "Babel>=1.3"
- dib-utils
- PyYAML
- diskimage-builder
- name: Create Temp Dir
tempfile:
state: directory
register: tmp_dir
- name: Set Temp Dir Path
set_fact:
bootstrap_host_octavia_tmp: "{{ tmp_dir.path }}"
- name: Clone Octavia
git:
repo: "https://git.openstack.org/openstack/octavia"
dest: "{{ bootstrap_host_octavia_tmp }}/octavia"
version: "master"
# Build Octavia amphora image
- name: Create amphora image
shell: "./diskimage-create.sh -o {{ bootstrap_host_octavia_tmp }}/amphora-x64-haproxy.qcow2"
args:
chdir: "{{ bootstrap_host_octavia_tmp }}/octavia/diskimage-create"
creates: "{{ bootstrap_host_octavia_tmp }}/amphora-x64-haproxy.qcow2"
tags:
- skip_ansible_lint
- name: Change permission
file:
path: "{{ bootstrap_host_octavia_tmp }}/octavia/bin/create_certificates.sh"
mode: 0755
- name: Generate certs
shell: "{{ bootstrap_host_octavia_tmp }}/octavia/bin/create_certificates.sh {{ bootstrap_host_octavia_tmp }}/certs {{ bootstrap_host_octavia_tmp }}/octavia/etc/certificates/openssl.cnf"
args:
creates: "{{ bootstrap_host_octavia_tmp }}/certs/ca_01.pem"
tags:
- skip_ansible_lint
- name: Fix certs/private directory access
file:
path: "{{ bootstrap_host_octavia_tmp }}/certs/private"
mode: 0755