Skip to content

Commit 0652b7b

Browse files
committed
Use role instead of playbooks - 06-deploy-edpm.yml
It is continuation of simplification job execution [1]. [1] #2929
1 parent 42e2dc4 commit 0652b7b

5 files changed

Lines changed: 169 additions & 5 deletions

File tree

deploy-edpm.yml

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,65 @@
9090
tags:
9191
- build-operators
9292

93-
- name: Import deploy edpm playbook
94-
ansible.builtin.import_playbook: playbooks/06-deploy-edpm.yml
95-
tags:
96-
- edpm
93+
- name: Deploy EDPM
94+
hosts: "{{ cifmw_target_host | default('localhost') }}"
95+
gather_facts: false
96+
tasks:
97+
- name: Deploy EDPM
98+
ansible.builtin.import_role:
99+
name: cifmw_setup
100+
tasks_from: deploy_edpm.yml
101+
tags:
102+
- edpm
103+
104+
- name: Deploy NFS server on target nodes
105+
become: true
106+
hosts: "{{ groups[cifmw_nfs_target | default('computes')][0] | default([]) }}"
107+
tasks:
108+
- name: Run cifmw_nfs role
109+
vars:
110+
nftables_path: /etc/nftables
111+
nftables_conf: /etc/sysconfig/nftables.conf
112+
when:
113+
- cifmw_edpm_deploy_nfs | default('false') | bool
114+
ansible.builtin.import_role:
115+
name: cifmw_nfs
116+
117+
- name: Clear ceph target hosts facts to force refreshing in HCI deployments
118+
hosts: "{{ cifmw_ceph_target | default('computes') }}"
119+
tasks:
120+
# end_play will end only current play, not the main edpm-deploy.yml
121+
- name: Early end if architecture deploy
122+
when:
123+
- cifmw_architecture_scenario is defined
124+
ansible.builtin.meta: end_play
125+
126+
- name: Clear ceph target hosts facts
127+
when: cifmw_edpm_deploy_hci | default('false') | bool
128+
ansible.builtin.meta: clear_facts
129+
130+
# TODO: replace this import_playbook with cifmw_ceph role
131+
- name: Deploy Ceph on target nodes
132+
vars:
133+
_deploy_ceph: >-
134+
{{
135+
(cifmw_edpm_deploy_hci | default('false') | bool) and
136+
cifmw_architecture_scenario is undefined
137+
}}
138+
storage_network_range: 172.18.0.0/24
139+
storage_mgmt_network_range: 172.20.0.0/24
140+
ansible.builtin.import_playbook: playbooks/ceph.yml
141+
142+
- name: Continue HCI deploy
143+
hosts: "{{ cifmw_target_host | default('localhost') }}"
144+
gather_facts: false
145+
tasks:
146+
- name: Continue HCI deploy
147+
ansible.builtin.import_role:
148+
name: cifmw_setup
149+
tasks_from: hci_deploy.yml
150+
tags:
151+
- edpm
97152

98153
- name: Import VA deployment playbook
99154
ansible.builtin.import_playbook: playbooks/06-deploy-architecture.yml

playbooks/06-deploy-edpm.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
---
2+
#
3+
# NOTE: Playbook migrated to: cifmw_setup/tasks/deploy-edpm.yml.
4+
# DO NOT EDIT THAT PLAYBOOK. IT WOULD BE REMOVED IN NEAR FUTURE.
5+
#
26
- name: Deploy podified control plane
37
hosts: "{{ cifmw_target_host | default('localhost') }}"
48
gather_facts: false

playbooks/validations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# NOTE: Playbook migrated to: 06-deploy-edpm.yml & 06-deploy-architecture.yml.
2+
# NOTE: Playbook migrated to: roles/cifmw_setup/tasks/hci_deploy.yml:L29-35 & 06-deploy-architecture.yml.
33
# This migration is temporary, and will be further migrated to role.
44
# DO NOT EDIT THAT PLAYBOOK. IT WOULD BE REMOVED IN NEAR FUTURE.
55
#
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
- name: Deploy EDPM
3+
when: cifmw_architecture_scenario is not defined
4+
block:
5+
- name: Run pre_deploy hooks
6+
vars:
7+
step: pre_deploy
8+
ansible.builtin.import_role:
9+
name: run_hook
10+
11+
- name: Load parameters files
12+
ansible.builtin.include_vars:
13+
dir: "{{ cifmw_basedir }}/artifacts/parameters"
14+
15+
- name: Configure Storage Class
16+
ansible.builtin.include_role:
17+
name: ci_local_storage
18+
when: not cifmw_use_lvms | default(false)
19+
20+
- name: Configure LVMS Storage Class
21+
ansible.builtin.include_role:
22+
name: ci_lvms_storage
23+
when: cifmw_use_lvms | default(false)
24+
25+
- name: Run edpm_prepare
26+
ansible.builtin.include_role:
27+
name: edpm_prepare
28+
29+
- name: Run post_ctlplane_deploy hooks
30+
when:
31+
- cifmw_architecture_scenario is undefined
32+
vars:
33+
step: post_ctlplane_deploy
34+
ansible.builtin.import_role:
35+
name: run_hook
36+
37+
- name: Load parameters files
38+
ansible.builtin.include_vars:
39+
dir: "{{ cifmw_basedir }}/artifacts/parameters"
40+
41+
- name: Create virtual baremetal and deploy EDPM
42+
when:
43+
- cifmw_edpm_deploy_baremetal | default('false') | bool
44+
- cifmw_deploy_edpm | default('false') | bool
45+
ansible.builtin.import_role:
46+
name: edpm_deploy_baremetal
47+
48+
- name: Load parameters files
49+
ansible.builtin.include_vars:
50+
dir: "{{ cifmw_basedir }}/artifacts/parameters"
51+
52+
- name: Create VMs and Deploy EDPM
53+
when:
54+
- not cifmw_edpm_deploy_baremetal | default('false') | bool
55+
- cifmw_deploy_edpm | default('false') | bool
56+
block:
57+
- name: Create and provision external computes
58+
when:
59+
- cifmw_use_libvirt is defined
60+
- cifmw_use_libvirt | bool
61+
ansible.builtin.import_role:
62+
name: libvirt_manager
63+
tasks_from: deploy_edpm_compute.yml
64+
65+
- name: Prepare for HCI deploy phase 1
66+
when: cifmw_edpm_deploy_hci | default('false') | bool
67+
ansible.builtin.include_role:
68+
name: hci_prepare
69+
tasks_from: phase1.yml
70+
71+
- name: Deploy EDPM
72+
ansible.builtin.import_role:
73+
name: edpm_deploy
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
- name: Continue HCI deploy
3+
when: cifmw_architecture_scenario is not defined
4+
block:
5+
- name: Create Ceph secrets and retrieve FSID info
6+
when: cifmw_edpm_deploy_hci | default('false') | bool
7+
block:
8+
- name: Prepare for HCI deploy phase 2
9+
ansible.builtin.include_role:
10+
name: hci_prepare
11+
tasks_from: phase2.yml
12+
13+
- name: Continue HCI deployment
14+
ansible.builtin.include_role:
15+
name: edpm_deploy
16+
vars:
17+
cifmw_edpm_deploy_prepare_run: false
18+
19+
- name: Run post_deploy hooks
20+
vars:
21+
step: post_deploy
22+
ansible.builtin.import_role:
23+
name: run_hook
24+
25+
# If we're doing an architecture deployment, we need to skip validations here.
26+
# Instead, they will be executed in the 06-deploy-architecture.yml playbook.
27+
- name: Run validations
28+
ansible.builtin.include_role:
29+
name: validations
30+
when:
31+
- cifmw_architecture_scenario is not defined
32+
- cifmw_execute_validations | default(false) | bool

0 commit comments

Comments
 (0)