modify the parameter of PPA_REPO
[releng.git] / prototypes / openstack-ansible / playbooks / configure-xcimaster.yml
1 ---
2 - hosts: xcimaster
3   remote_user: root
4   vars_files:
5     - ../var/ubuntu.yml
6   tasks:
7     - name: generate SSH keys
8       shell: ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N ""
9       args:
10         creates: /root/.ssh/id_rsa
11     - name: fetch public key
12       fetch: src="/root/.ssh/id_rsa.pub" dest="/"
13     - name: remove the directory
14       shell: "rm -rf {{OSA_PATH}} {{OSA_ETC_PATH}}"
15     - name: git openstack ansible
16       shell: "git clone {{OSA_URL}} {{OSA_PATH}} -b {{OPENSTACK_BRANCH}}"
17     - name: copy opnfv-setup-openstack.yml to /opt/openstack-ansible/playbooks
18       copy:
19         src: ../file/opnfv-setup-openstack.yml
20         dest: "{{OSA_PATH}}/playbooks/opnfv-setup-openstack.yml"
21     - name: copy /opt/openstack-ansible/etc/openstack_deploy to /etc/openstack_deploy
22       shell: "/bin/cp -rf {{OSA_PATH}}/etc/openstack_deploy {{OSA_ETC_PATH}}"
23     - name: bootstrap
24       command: "/bin/bash ./scripts/bootstrap-ansible.sh"
25       args:
26         chdir: "{{OSA_PATH}}"
27     - name: generate password token
28       command: "python pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml"
29       args:
30         chdir: /opt/openstack-ansible/scripts/
31     - name: copy openstack_user_config.yml to /etc/openstack_deploy
32       copy:
33         src: ../file/openstack_user_config.yml
34         dest: "{{OSA_ETC_PATH}}/openstack_user_config.yml"
35     - name: copy cinder.yml to /etc/openstack_deploy/env.d
36       copy:
37         src: ../file/cinder.yml
38         dest: "{{OSA_ETC_PATH}}/env.d/cinder.yml"
39     - name: copy user_variables.yml to /etc/openstack_deploy/
40       copy:
41         src: ../file/user_variables.yml
42         dest: "{{OSA_ETC_PATH}}/user_variables.yml"
43     - name: configure network
44       template:
45         src: ../template/bifrost/controller.interface.j2
46         dest: /etc/network/interfaces
47       notify:
48         - restart network service
49   handlers:
50     - name: restart network service
51       shell: "/sbin/ifconfig ens3 0 &&/sbin/ifdown -a && /sbin/ifup -a"
52
53 - hosts: localhost
54   remote_user: root
55   tasks:
56     - name: Generate authorized_keys
57       shell: "/bin/cat /xcimaster/root/.ssh/id_rsa.pub >> ../file/authorized_keys"