-
Notifications
You must be signed in to change notification settings - Fork 0
/
overcloud_deployment.yaml
46 lines (37 loc) · 1.18 KB
/
overcloud_deployment.yaml
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
---
- name: Play book to configure and deploy overcloud services
hosts: all
tasks:
- name: Ansible check template directory exists.
stat:
path: /home/stack/templates/
register: my_folder
- name: "echo if directory already existed"
debug:
msg: "Template directory is already existed"
when: my_folder.stat.exists
- name: "Ansible Create directory if not exists"
copy:
src: templates
dest: /home/stack/
when: my_folder.stat.exists == false
- name: Ansible check if deployment script exists.
stat:
path: /home/stack/overcloud_deploy.sh
register: my_file
- name: Copy deployment script
shell: 'cp /home/stack/templates/overcloud_deploy.sh /home/stack/. ; chmod 777 /home/stack/overcloud_deploy.sh'
when: my_file.stat.exists == false
- name: Configure overcloud Nodes
shell: 'sh /home/stack/templates/overcloud_configure.sh'
args:
chdir: /home/stack/
- block:
- name: Execute Overcloud Deployment
shell: ./overcloud_deploy.sh
args:
chdir: /home/stack/
register: execution_status
rescue:
- debug:
msg: "{{ execution_status }}"