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 }}" }
20 # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros
21 - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/opnfv.interface.j2", dest: "/etc/network/interfaces" }
23 - name: generate SSH keys
24 shell: ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N ""
26 creates: /root/.ssh/id_rsa
27 - name: fetch public key
28 fetch: src="/root/.ssh/id_rsa.pub" dest="/"
29 - name: copy flavor inventory
30 shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/inventory {{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks"
31 - name: copy flavor vars
32 shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/flavor-vars.yml {{OPNFV_RELENG_PATH}}/prototypes/xci/var"
33 - name: copy openstack_deploy
34 shell: "/bin/cp -rf {{OPENSTACK_OSA_PATH}}/etc/openstack_deploy {{OPENSTACK_OSA_ETC_PATH}}"
35 - name: copy openstack_user_config.yml
36 shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/openstack_user_config.yml {{OPENSTACK_OSA_ETC_PATH}}"
37 - name: copy user_variables.yml
38 shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/user_variables.yml {{OPENSTACK_OSA_ETC_PATH}}"
39 - name: copy cinder.yml
40 shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/cinder.yml {{OPENSTACK_OSA_ETC_PATH}}/env.d"
41 # TODO: We need to get rid of this as soon as the issue is fixed upstream
42 - name: change the haproxy state from disable to enable
44 dest: "{{OPENSTACK_OSA_PATH}}/playbooks/os-keystone-install.yml"
45 regexp: '(\s+)haproxy_state: disabled'
46 replace: '\1haproxy_state: enabled'
47 - name: copy OPNFV OpenStack playbook
48 shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/setup-openstack.yml {{OPENSTACK_OSA_PATH}}/playbooks"
49 - name: copy OPNFV role requirements
50 shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/ansible-role-requirements.yml {{OPENSTACK_OSA_PATH}}"
51 - name: bootstrap ansible on opnfv host
52 command: "/bin/bash ./scripts/bootstrap-ansible.sh"
54 chdir: "{{OPENSTACK_OSA_PATH}}"
55 - name: generate password token
56 command: "python pw-token-gen.py --file {{OPENSTACK_OSA_ETC_PATH}}/user_secrets.yml"
58 chdir: "{{OPENSTACK_OSA_PATH}}/scripts"
62 - name: Generate authorized_keys
63 shell: "/bin/cat /opnfv/root/.ssh/id_rsa.pub >> ../file/authorized_keys"
64 - name: Append public keys to authorized_keys
65 shell: "/bin/cat /root/.ssh/id_rsa.pub >> ../file/authorized_keys"