-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstage.yml
More file actions
154 lines (134 loc) · 4.37 KB
/
Copy pathstage.yml
File metadata and controls
154 lines (134 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
---
- name: "Stage deployer for OpenStack install"
hosts: deployer
remote_user: root
serial: 1
tasks:
- name: Remove ansible symlink if it does exist
shell: "if [ -L /opt/ansible-runtime/bin/ansible ]; then unlink /opt/ansible-runtime/bin/ansible; fi;"
when:
openstack_release == "stable/newton"
- name: Remove ansible-playbook symlink if it does exist
shell: "if [ -L /opt/ansible-runtime/bin/ansible-playbook ]; then unlink /opt/ansible-runtime/bin/ansible-playbook; fi;"
when:
openstack_release == "stable/newton"
- name: Remove existing openstack-ansible
command: rm -rf openstack-ansible
args:
chdir: /opt
- name: Remove existing openstack_deploy
command: rm -rf openstack_deploy
args:
chdir: /etc
tags:
- remove-openstack-deploy
- copy-openstack-deploy
- name: Remove ansible in opt
command: rm -rf ansible*
args:
chdir: /opt
tags:
- remove-ansible-in-opt
- name: Remove ansible roles in etc
command: rm -rf roles
args:
chdir: /etc/ansible
tags:
- remove-ansible-roles-in-etc
- name: Clone openstack-ansible
git:
repo: http://github.com/openstack/openstack-ansible
dest: /opt/openstack-ansible
clone: yes
accept_hostkey: yes
recursive: yes
version: "{{ openstack_release | default('master') }}"
tags:
- clone-openstack-ansible
- name: Copy openstack_deploy to etc
command: cp -R etc/openstack_deploy /etc/
args:
chdir: /opt/openstack-ansible
tags:
- copy-openstack-deploy
- name: Bootstrap Ansible
command: scripts/bootstrap-ansible.sh
args:
chdir: /opt/openstack-ansible
tags:
- bootstrap-ansible
- name: Generate service credentials
command: python pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
args:
chdir: /opt/openstack-ansible/scripts
tags:
- generate-credentials
- name: Persist admin password
lineinfile:
dest: /etc/openstack_deploy/user_secrets.yml
regexp: "^keystone_auth_admin_password.*"
state: present
line: "keystone_auth_admin_password: openstack"
tags:
- persist-admin-password
- name: Copy user_variables.yml
copy:
src: templates/user_variables.yml
dest: /etc/openstack_deploy/user_variables.yml
owner: root
group: root
mode: 0600
tags:
- copy-user-variables
- name: Copy openstack_user_config.yml
copy:
src: templates/openstack_user_config.yml
dest: /etc/openstack_deploy/openstack_user_config.yml
owner: root
group: root
mode: 0600
tags:
- copy-user-config
- name: Copy yml conf.d files
copy:
src: "templates/{{ item }}.yml"
dest: "/etc/openstack_deploy/conf.d/{{ item }}.yml"
owner: root
group: root
mode: 0600
with_items:
#- aodh
#- ceph
- cinder
#- gnocchi
- haproxy
- heat
- horizon
#- ironic
- keystone
- logging
#- magnum
- neutron
- nova
- swift
tags:
- copy-conf-files
- name: Build openstack-ansible inventory
command: python /opt/openstack-ansible/playbooks/inventory/dynamic_inventory.py
tags:
- generate-inventory
- name: Wait for inventory to build
pause: seconds=5
# Broken need to fix (error is failed broken pipe)
#- name: Add utility containers to deployer
# shell: "python /opt/openstack-ansible/scripts/inventory-manage.py -l|awk 'match($0, /(infra0._utility)/, m) { print $12 \" \" $2 \" \" m[1] }' >> /etc/hosts"
# tags:
# - add-utility-to-deployer
- name: Create ansible symlink if it does not exist
shell: "if ! [ -L /opt/ansible-runtime/bin/ansible ]; then ln -s /usr/local/bin/ansible /opt/ansible-runtime/bin/ansible; fi;"
when:
openstack_release == "stable/newton"
- name: Create ansible-playbook symlink if it does not exist
shell: "if ! [ -L /opt/ansible-runtime/bin/ansible-playbook ]; then ln -s /usr/local/bin/ansible-playbook /opt/ansible-runtime/bin/ansible-playbook; fi;"
when:
openstack_release == "stable/newton"