--- # SPDX-license-identifier: Apache-2.0 ############################################################################## # Copyright (c) 2017 Ericsson AB and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## - hosts: localhost connection: local pre_tasks: - name: Load distribution variables include_vars: file: "{{ item }}" failed_when: false with_items: - "{{ xci_path }}/xci/var/opnfv.yml" - "{{ xci_path }}/xci/var/{{ ansible_os_family }}.yml" - name: cleanup leftovers of previous deployment file: path: "{{ item }}" state: absent recurse: no with_items: - "{{ xci_cache }}/repos" - "{{ log_path }} " - "{{ opnfv_ssh_host_keys_path }}" roles: - role: clone-repository project: "openstack/openstack-ansible-openstack_openrc" repo: "{{ openstack_osa_openrc_git_url }}" dest: roles/openstack-ansible-openstack_openrc version: "master" when: installer_type == "osa" - role: clone-repository project: "openstack/openstack-ansible" repo: "{{ openstack_osa_git_url }}" dest: "{{ xci_cache }}/repos/openstack-ansible" version: "{{ openstack_osa_version }}" when: installer_type == "osa" - role: clone-repository project: "kubernetes-incubator/kubespray" repo: "{{ kubespray_git_url }}" dest: "{{ xci_cache }}/repos/kubespray" version: "{{ kubespray_version }}" when: installer_type == "kubespray" - role: clone-repository project: "openstack/openstack-ansible-haproxy_server" repo: "{{ openstack_osa_haproxy_git_url }}" dest: roles/haproxy_server version: "{{ haproxy_version }}" when: - installer_type == "kubespray" - role: clone-repository project: "ansible-keepalived" repo: "{{ keepalived_git_url }}" dest: roles/keepalived version: "{{ keepalived_version }}" when: - installer_type == "kubespray" tasks: - name: create log directory {{log_path}} file: path: "{{log_path}}" state: directory recurse: no - block: - name: check if certificate directory /etc/ssl/certs exists already stat: path=/etc/ssl/certs register: check_etc_ssl_certs - name: create certificate directory /etc/ssl/certs become: true file: path: "/etc/ssl/certs" state: directory when: check_etc_ssl_certs.stat.exists == false - name: create key directory /etc/ssl/private become: true file: path: "/etc/ssl/private" state: directory - name: generate self signed certificate command: openssl req -new -nodes -x509 -subj "{{ xci_ssl_subject }}" -days 3650 -keyout "/etc/ssl/private/xci.key" -out "/etc/ssl/certs/xci.crt" -extensions v3_ca become: true - name: Synchronize local development OSA repository to XCI paths # command module is much faster than the copy module synchronize: src: "{{ openstack_osa_dev_path }}" dest: "{{ xci_cache }}/repos/openstack-ansible" recursive: yes delete: yes when: - openstack_osa_dev_path != "" when: - installer_type == "osa" - name: Dump XCI execution environment to a file shell: env > "{{ xci_path }}/.cache/xci.env" args: executable: /bin/bash