forked from openstack-k8s-operators/ci-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-edpm.yml
More file actions
173 lines (154 loc) · 5.34 KB
/
deploy-edpm.yml
File metadata and controls
173 lines (154 loc) · 5.34 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
---
# Entry point for the CI Framework tool.
# Running by this playbook, and providing the needed information, you will
# be able to deploy various scenarios based on EDPM.
# Note that this playbook *must* be called from within
# openstack-k8s-operators/install_yaml repository in order to leverage its
# own methods.
- name: Remove status flag
hosts: "{{ cifmw_target_host | default('localhost') }}"
tasks:
- name: Delete success flag if exists
ansible.builtin.file:
path: "{{ ansible_user_dir }}/cifmw-success"
state: absent
- name: Inherit from parent scenarios if needed
ansible.builtin.include_tasks:
file: "ci/playbooks/tasks/inherit_parent_scenario.yml"
- name: Run bootstrap
ansible.builtin.import_role:
name: cifmw_setup
tasks_from: bootstrap.yml
- name: Run pre_infra hooks
vars:
step: pre_infra
ansible.builtin.import_role:
name: run_hook
tags:
- infra
- name: Prepare host virtualization
hosts: "{{ ('virthosts' in groups) | ternary('virthosts', cifmw_target_host | default('localhost') ) }}"
tasks:
- name: Run prepare host virtualization
vars:
step: pre_infra
ansible.builtin.import_role:
name: cifmw_setup
tasks_from: host_virtualization.yml
tags:
- infra
- name: Run cifmw_setup infra, build package, container and operators, deploy EDPM
hosts: "{{ cifmw_target_host | default('localhost') }}"
tasks:
- name: Prepare the platform
vars:
step: pre_infra
ansible.builtin.import_role:
name: cifmw_setup
tasks_from: infra.yml
tags:
- infra
- name: Build package playbook
ansible.builtin.import_role:
name: cifmw_setup
tasks_from: build_packages.yml
tags:
- build-packages
- name: Build container playbook
ansible.builtin.import_role:
name: cifmw_setup
tasks_from: build_containers.yml
tags:
- build-containers
- name: Build operators playbook
ansible.builtin.import_role:
name: cifmw_setup
tasks_from: build_operators.yml
tags:
- build-operators
environment:
PATH: "{{ cifmw_path }}"
- name: Deploy EDPM
ansible.builtin.import_role:
name: cifmw_setup
tasks_from: deploy_edpm.yml
tags:
- edpm
- name: Deploy NFS server on target nodes
become: true
hosts: "{{ groups[cifmw_nfs_target | default('computes')][0] | default([]) }}"
tasks:
- name: Run cifmw_nfs role
vars:
nftables_path: /etc/nftables
nftables_conf: /etc/sysconfig/nftables.conf
when:
- cifmw_edpm_deploy_nfs | default(false) | bool
ansible.builtin.import_role:
name: cifmw_nfs
- name: Clear ceph target hosts facts to force refreshing in HCI deployments
hosts: "{{ cifmw_ceph_target | default('computes') }}"
tasks:
# end_play will end only current play, not the main edpm-deploy.yml
- name: Early end if architecture deploy
when:
- cifmw_architecture_scenario is defined
ansible.builtin.meta: end_play
- name: Clear ceph target hosts facts
when: cifmw_edpm_deploy_hci | default(false) | bool
ansible.builtin.meta: clear_facts
- name: Deploy ceph using hooks
hosts: "{{ cifmw_target_host | default('localhost') }}"
tasks:
- name: Run post_ceph hooks - deploy Ceph on target nodes
vars:
step: post_ceph
_deploy_ceph: >-
{{
(cifmw_edpm_deploy_hci | default(false) | bool) and
cifmw_architecture_scenario is undefined
}}
storage_network_range: 172.18.0.0/24
storage_mgmt_network_range: 172.20.0.0/24
ansible.builtin.import_role:
name: run_hook
- name: Continue HCI deploy, deploy architecture and validate workflow
hosts: "{{ cifmw_target_host | default('localhost') }}"
gather_facts: false
tasks:
- name: Continue HCI deploy
ansible.builtin.import_role:
name: cifmw_setup
tasks_from: hci_deploy.yml
tags:
- edpm
- name: Run pre_deploy hooks
when: cifmw_architecture_scenario is defined
vars:
step: pre_deploy
ansible.builtin.import_role:
name: run_hook
# FIXME:Earlier, where we were using import_playbook, the cifmw_architecture_scenario
# variable was not available in playbooks/06-deploy-architecture.yml,
# but by using import_playbook, the variables are parsed in different way,
# so instead of cifmw_architecture_scenario not being defined, it is defined
# and it is executing additional tasks, which should not.
# Temporary move the end_play here and let's improve the tasks execution
# where tasks execution would be merged into one if the tasks should
# be done on same host.
- name: Early end if not architecture deploy
tags:
- always
when: cifmw_architecture_scenario is not defined
ansible.builtin.meta: end_play
- name: Run cifmw_setup deploy_architecture
when: cifmw_architecture_scenario is defined
ansible.builtin.import_role:
name: cifmw_setup
tasks_from: deploy_architecture.yml
tags:
- edpm
- name: Run validations
ansible.builtin.include_role:
name: validations
when: cifmw_execute_validations | default(false) | bool