2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2017 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 - ../var/{{ ansible_os_family }}.yml
14 - ../var/flavor-vars.yml
17 - role: remove-folders
18 - { role: clone-repository, project: "opnfv/releng", repo: "{{ OPNFV_RELENG_GIT_URL }}", dest: "{{ OPNFV_RELENG_PATH }}", version: "{{ OPNFV_RELENG_VERSION }}" }
19 - { role: clone-repository, project: "openstack/openstack-ansible", repo: "{{ OPENSTACK_OSA_GIT_URL }}", dest: "{{ OPENSTACK_OSA_PATH }}", version: "{{ OPENSTACK_OSA_VERSION }}" }
24 - ../var/{{ ansible_os_family }}.yml
27 - name: Synchronize local development releng repository to XCI paths
29 src: "{{ OPNFV_RELENG_DEV_PATH }}"
30 dest: "{{ OPNFV_RELENG_PATH }}"
34 - OPNFV_RELENG_DEV_PATH != ""
35 - name: Synchronize local development openstack-ansible repository to XCI paths
37 src: "{{ OPENSTACK_OSA_DEV_PATH }}"
38 dest: "{{ OPENSTACK_OSA_PATH }}"
42 - OPENSTACK_OSA_DEV_PATH != ""
47 - ../var/{{ ansible_os_family }}.yml
48 - ../var/flavor-vars.yml
51 # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros
52 - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/opnfv.interface.j2", dest: "/etc/network/interfaces" }
54 - name: generate SSH keys
55 shell: ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N ""
57 creates: /root/.ssh/id_rsa
58 - name: ensure ssh key storage directory exists
60 path: "{{ OPNFV_SSH_HOST_KEYS_PATH }}"
62 - name: fetch public key
63 fetch: src="/root/.ssh/id_rsa.pub" dest="{{ OPNFV_SSH_HOST_KEYS_PATH }}"
64 - name: copy flavor inventory
65 shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/inventory {{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks"
66 - name: copy flavor vars
67 shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/flavor-vars.yml {{OPNFV_RELENG_PATH}}/prototypes/xci/var"
68 - name: copy openstack_deploy
69 shell: "/bin/cp -rf {{OPENSTACK_OSA_PATH}}/etc/openstack_deploy {{OPENSTACK_OSA_ETC_PATH}}"
70 - name: copy openstack_user_config.yml
71 shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/openstack_user_config.yml {{OPENSTACK_OSA_ETC_PATH}}"
72 - name: copy user_variables.yml
73 shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/user_variables.yml {{OPENSTACK_OSA_ETC_PATH}}"
74 - name: copy cinder.yml
75 shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/cinder.yml {{OPENSTACK_OSA_ETC_PATH}}/env.d"
76 # TODO: We need to get rid of this as soon as the issue is fixed upstream
77 - name: change the haproxy state from disable to enable
79 dest: "{{OPENSTACK_OSA_PATH}}/playbooks/os-keystone-install.yml"
80 regexp: '(\s+)haproxy_state: disabled'
81 replace: '\1haproxy_state: enabled'
82 - name: copy OPNFV OpenStack playbook
83 shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/setup-openstack.yml {{OPENSTACK_OSA_PATH}}/playbooks"
84 - name: copy OPNFV role requirements
85 shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/ansible-role-requirements.yml {{OPENSTACK_OSA_PATH}}"
86 - name: bootstrap ansible on opnfv host
87 command: "/bin/bash ./scripts/bootstrap-ansible.sh"
89 chdir: "{{OPENSTACK_OSA_PATH}}"
90 - name: generate password token
91 command: "python pw-token-gen.py --file {{OPENSTACK_OSA_ETC_PATH}}/user_secrets.yml"
93 chdir: "{{OPENSTACK_OSA_PATH}}/scripts"
99 - name: Generate authorized_keys
100 shell: "/bin/cat {{ OPNFV_SSH_HOST_KEYS_PATH }}/opnfv/root/.ssh/id_rsa.pub >> ../file/authorized_keys"
101 - name: Append public keys to authorized_keys
102 shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> ../file/authorized_keys"