Skip to content

Commit aefe56d

Browse files
committed
WIP Move Ceph playbook into hooks
The Ceph playbook should be in hooks instead of main playbook dir. Signed-off-by: Daniel Pawlik <[email protected]>
1 parent 93254dd commit aefe56d

File tree

10 files changed

+36
-24
lines changed

10 files changed

+36
-24
lines changed

deploy-edpm.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,18 @@
127127
when: cifmw_edpm_deploy_hci | default('false') | bool
128128
ansible.builtin.meta: clear_facts
129129

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
130+
- name: Run pre_deploy hooks - deploy Ceph on target nodes
131+
vars:
132+
step: post_infra
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_role:
141+
name: run_hook
141142

142143
- name: Continue HCI deploy
143144
hosts: "{{ cifmw_target_host | default('localhost') }}"

hooks/playbooks/ceph-bm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@
3535
{% endfor -%}
3636
{{ hosts }}
3737
38+
# FIXME: Use hooks in better way
3839
- name: Deploy Ceph on target nodes
39-
ansible.builtin.import_playbook: ../../playbooks/ceph.yml
40+
ansible.builtin.import_playbook: ../../hooks/playbooks/ceph.yml
File renamed without changes.

playbooks/06-deploy-edpm.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@
131131
when: cifmw_edpm_deploy_hci | default('false') | bool
132132
ansible.builtin.meta: clear_facts
133133

134+
# FIXME: This playbook would be removed soon.
135+
# Here is more like workaround to pass CI.
134136
- name: Deploy Ceph on target nodes
135137
vars:
136138
_deploy_ceph: >-
@@ -140,7 +142,7 @@
140142
}}
141143
storage_network_range: 172.18.0.0/24
142144
storage_mgmt_network_range: 172.20.0.0/24
143-
ansible.builtin.import_playbook: ceph.yml
145+
ansible.builtin.import_playbook: ../hooks/playbooks/ceph.yml
144146

145147
- name: Continue HCI deploy
146148
hosts: "{{ cifmw_target_host | default('localhost') }}"

roles/ci_dcn_site/tasks/ceph.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
insertafter: EOF
8787
when: ceph_file_stat.stat.exists
8888

89+
# FIXME: Call hooks here
8990
- name: Deploy Ceph
9091
cifmw.general.ci_script:
9192
output_dir: "/home/zuul/ci-framework-data/artifacts"
@@ -95,7 +96,7 @@
9596
-i ~/ci-framework-data/artifacts/zuul_inventory.yml
9697
-e @~/ci-framework-data/parameters/reproducer-variables.yml
9798
-e @~/ci-framework-data/parameters/ceph-{{ _az }}.yml
98-
playbooks/ceph.yml
99+
hooks/playbooks/ceph.yml
99100
100101
- name: Load the Ceph cluster variables
101102
ansible.builtin.include_vars:

roles/cifmw_cephadm/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The
77
[openstack-k8s-operators HCI documentation](https://github.com/openstack-k8s-operators/docs/blob/main/hci.md)
88
describes how to run Ceph on EDPM nodes but leaves it to the reader
99
to install Ceph with `cephadm`. The `cifmw_cephadm` role and
10-
`ceph.yml` playbook may be used to automate the Ceph installation.
10+
`hooks/playbooks/ceph.yml` playbook may be used to automate the Ceph installation.
1111

1212
Before this role is run the following roles should be run.
1313

@@ -19,7 +19,7 @@ After this role is run, the `cifmw_ceph_client` role can generate
1919
a k8s CR which OpenStack can use to connect to the deployed Ceph
2020
cluster.
2121

22-
The `ceph.yml` playbook in the playbooks directory provides a complete
22+
The `hooks/playbooks/ceph.yml` playbook in the playbooks directory provides a complete
2323
working example which does all of the above and has been tested on
2424
a three EDPM node deployment from
2525
[install_yamls](https://github.com/openstack-k8s-operators/install_yamls).
@@ -29,7 +29,7 @@ Requires an Ansible user who can become root to install Ceph server.
2929

3030
## Parameters
3131

32-
The `ceph.yml` playbook defaults these parameters so that they do not
32+
The `hooks/playbooks/ceph.yml` playbook defaults these parameters so that they do not
3333
need to be changed for a typical EDPM deployment.
3434

3535
* `cifmw_cephadm_default_container`: If this is value is `true`, then
@@ -136,13 +136,13 @@ cifmw_cephadm_keys:
136136

137137
## Examples
138138

139-
See `ceph.yml` in the playbooks directory.
139+
See `hooks/playbooks/ceph.yml` in the playbooks directory.
140140

141141
## Tips for using standalone
142142

143143
### Pick the appropriate storage network
144144

145-
In the `ceph.yml` playbook, set the `storage_network_range` variable.
145+
In the `hooks/playbooks/ceph.yml` playbook, set the `storage_network_range` variable.
146146

147147
* If network isolation is not being used, then set the
148148
`storage_network_range` variable to `192.168.122.0/24` (the default
@@ -198,17 +198,17 @@ export ANSIBLE_HOST_KEY_CHECKING=False
198198

199199
```
200200
cd ~/ci-framework/
201-
ansible-playbook playbooks/ceph.yml
201+
ansible-playbook hooks/playbooks/ceph.yml
202202
```
203203

204204
## Regarding the disks used as OSDs
205205

206-
By default the `ceph.yml` playbook assumes there are no block devices
206+
By default the `hooks/playbooks/ceph.yml` playbook assumes there are no block devices
207207
for Ceph to use and calls the `cifmw_block_device` role to create
208208
block devices and has the `cifmw_ceph_spec` role configure a spec
209209
to use the created block devices.
210210

211-
If `cifmw_ceph_spec_data_devices` is passed to the `ceph.yml`
211+
If `cifmw_ceph_spec_data_devices` is passed to the `hooks/playbooks/ceph.yml`
212212
playbook, then the `cifmw_block_device` role is not called and
213213
the spec created by the `cifmw_ceph_spec` role will use whatever
214214
block devices were passed by `cifmw_ceph_spec_data_devices`. Use

roles/hci_prepare/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ None.
3131
name: edpm_deploy
3232

3333
- name: Deploy Ceph on edpm nodes
34-
ansible.builtin.import_playbook: ceph.yml
34+
ansible.builtin.import_playbook: hooks/playbooks/ceph.yml
3535

3636
- name: Prepare for HCI deploy phase 2
3737
ansible.builtin.import_role:

scenarios/centos-9/edpm_ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ pre_infra:
3131
type: playbook
3232
source: "{{ cifmw_installyamls_repos }}/devsetup/download_tools.yaml"
3333

34+
post_infra:
35+
- name: Run ceph hook playbook
36+
type: playbook
37+
source: ceph.yml
38+
3439
post_ctlplane_deploy:
3540
- name: Tune rabbitmq resources
3641
type: playbook

zuul.d/edpm.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
vars:
88
cifmw_extras:
99
- '@scenarios/centos-9/nested_virt.yml'
10+
files:
11+
- '^hooks/playbooks/ceph.yml'
1012

1113
# Virtual Baremetal job with CRC and single compute node.
1214
- job:

zuul.d/edpm_multinode.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
- ^hooks/playbooks/control_plane_hci_pre_deploy.yml
361361
- ^hooks/playbooks/templates/config_ceph_backends.yaml.j2
362362
- ^playbooks/06-deploy-edpm.yml
363-
- ^playbooks/ceph.yml
363+
- ^hooks/playbooks/ceph.yml
364364
- ^roles/edpm_deploy/(defaults|files|handlers|library|lookup_plugins|module_utils|tasks|templates|vars).*
365365
- ^roles/hci_prepare/(defaults|files|handlers|library|lookup_plugins|module_utils|tasks|templates|vars).*
366366
- ^roles/cifmw_ceph.*/(defaults|files|handlers|library|lookup_plugins|module_utils|tasks|templates|vars).*

0 commit comments

Comments
 (0)