Skip to content

Commit

Permalink
Move the config of ceph backends to a template file, gating++
Browse files Browse the repository at this point in the history
Use 'template' instead of 'copy' to generate the Kustomization
which will be used to configure the services with ceph as backend.
This is needed because, according the ansible documentation,
"If you need variable interpolation in copied files, use the
ansible.builtin.template module. Using a variable with
the content parameter produces unpredictable results."
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html#synopsis

Remove an old template, previously used for the same purpose, then
removed and readded by mistake in a rebase.

Finally, make sure that a job which deploys ceph with HCI
and use all these files actually is triggered when these
files are changed, and actually readd the HCI job to the
pipeline used to test ci-framework itself.
  • Loading branch information
tosky committed May 10, 2024
1 parent 8960d90 commit 4f78bc9
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 140 deletions.
108 changes: 2 additions & 106 deletions hooks/playbooks/control_plane_ceph_backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,110 +21,6 @@
state: directory

- name: Create kustomization to add Ceph as backend
ansible.builtin.copy:
ansible.builtin.template:
dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/90-ceph-backends-kustomization.yaml"
content: |-
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
namespace: {{ cifmw_install_yamls_defaults['NAMESPACE'] }}
patches:
- target:
kind: OpenStackControlPlane
patch: |-
- op: add
path: /spec/extraMounts
value:
- name: v1
region: r1
extraVol:
- propagation:
- CinderVolume
- CinderBackup
- GlanceAPI
- ManilaShare
extraVolType: Ceph
volumes:
- name: ceph
projected:
sources:
- secret:
name: ceph-conf-files
mounts:
- name: ceph
mountPath: "/etc/ceph"
readOnly: true
- op: replace
path: /spec/cinder/template/cinderBackup/replicas
value: {{ cifmw_services_cinder_bkp_replicas | default(1) }}
- op: add
path: /spec/cinder/template/cinderBackup/customServiceConfig
value: |
[DEFAULT]
backup_driver = cinder.backup.drivers.ceph.CephBackupDriver
backup_ceph_pool = backups
backup_ceph_user = openstack
- op: replace
path: /spec/cinder/template/cinderVolumes/volume1/replicas
value: {{ cifmw_services_cinder_vol_replicas | default(1) }}
- op: add
path: /spec/cinder/template/cinderVolumes/volume1/customServiceConfig
value: |
[DEFAULT]
enabled_backends=ceph
[ceph]
volume_backend_name=ceph
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=openstack
rbd_pool=volumes
rbd_flatten_volume_from_snapshot=False
report_discard_supported=True
backend_host=hostgroup
rbd_secret_uuid={{ cifmw_ceph_fsid }}
- op: replace
path: /spec/glance/template/glanceAPIs/default/replicas
value: {{ cifmw_services_glance_apis_replicas | default(1) }}
- op: add
path: /spec/glance/template/customServiceConfig
value: |
[DEFAULT]
enabled_backends = default_backend:rbd
[glance_store]
default_backend = default_backend
[default_backend]
rbd_store_ceph_conf = /etc/ceph/ceph.conf
store_description = "RBD backend"
rbd_store_pool = images
rbd_store_user = openstack
- op: replace
path: /spec/glance/template/glanceAPIs/default/type
value: split
- op: add
path: /spec/manila/enabled
value: {{ cifmw_services_manila_enabled | default('false') }}
- op: add
path: /spec/manila/template/customServiceConfig
value: |
[DEFAULT]
enabled_share_backends=cephfs
enabled_share_protocols=cephfs
debug=True
[cephfs]
driver_handles_share_servers=False
share_backend_name=cephfs
share_driver=manila.share.drivers.cephfs.driver.CephFSDriver
cephfs_conf_path=/etc/ceph/ceph.conf
cephfs_auth_id=openstack
cephfs_cluster_name=ceph
cephfs_volume_mode=0755
cephfs_protocol_helper_type=CEPHFS
src: "config_ceph_backends.yaml.j2"
104 changes: 104 additions & 0 deletions hooks/playbooks/templates/config_ceph_backends.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
namespace: {{ cifmw_install_yamls_defaults['NAMESPACE'] }}
patches:
- target:
kind: OpenStackControlPlane
patch: |-
- op: add
path: /spec/extraMounts
value:
- name: v1
region: r1
extraVol:
- propagation:
- CinderVolume
- CinderBackup
- GlanceAPI
- ManilaShare
extraVolType: Ceph
volumes:
- name: ceph
projected:
sources:
- secret:
name: ceph-conf-files
mounts:
- name: ceph
mountPath: "/etc/ceph"
readOnly: true

- op: replace
path: /spec/cinder/template/cinderBackup/replicas
value: {{ cifmw_services_cinder_bkp_replicas | default(1) }}

- op: add
path: /spec/cinder/template/cinderBackup/customServiceConfig
value: |
[DEFAULT]
backup_driver = cinder.backup.drivers.ceph.CephBackupDriver
backup_ceph_pool = backups
backup_ceph_user = openstack

- op: replace
path: /spec/cinder/template/cinderVolumes/volume1/replicas
value: {{ cifmw_services_cinder_vol_replicas | default(1) }}

- op: add
path: /spec/cinder/template/cinderVolumes/volume1/customServiceConfig
value: |
[DEFAULT]
enabled_backends=ceph
[ceph]
volume_backend_name=ceph
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=openstack
rbd_pool=volumes
rbd_flatten_volume_from_snapshot=False
report_discard_supported=True
backend_host=hostgroup
rbd_secret_uuid={{ cifmw_ceph_fsid }}

- op: replace
path: /spec/glance/template/glanceAPIs/default/replicas
value: {{ cifmw_services_glance_apis_replicas | default(1) }}

- op: add
path: /spec/glance/template/customServiceConfig
value: |
[DEFAULT]
enabled_backends = default_backend:rbd
[glance_store]
default_backend = default_backend
[default_backend]
rbd_store_ceph_conf = /etc/ceph/ceph.conf
store_description = "RBD backend"
rbd_store_pool = images
rbd_store_user = openstack

- op: replace
path: /spec/glance/template/glanceAPIs/default/type
value: split

- op: add
path: /spec/manila/enabled
value: {{ cifmw_services_manila_enabled | default('false') }}

- op: add
path: /spec/manila/template/customServiceConfig
value: |
[DEFAULT]
enabled_share_backends=cephfs
enabled_share_protocols=cephfs
debug=True
[cephfs]
driver_handles_share_servers=False
share_backend_name=cephfs
share_driver=manila.share.drivers.cephfs.driver.CephFSDriver
cephfs_conf_path=/etc/ceph/ceph.conf
cephfs_auth_id=openstack
cephfs_cluster_name=ceph
cephfs_volume_mode=0755
cephfs_protocol_helper_type=CEPHFS
34 changes: 0 additions & 34 deletions hooks/templates/service_config_ceph.yaml.j2

This file was deleted.

3 changes: 3 additions & 0 deletions zuul.d/edpm_multinode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@
cephfs_enabled: true
ceph_nfs_enabled: true
files:
- ^hooks/playbooks/control_plane_ceph_backends.yml
- ^hooks/playbooks/control_plane_hci_pre_deploy.yml
- ^hooks/templates/config_ceph_backends.yaml.j2
- ^playbooks/06-deploy-edpm.yml
- ^playbooks/ceph.yml
- ^roles/edpm_deploy/(?!meta|README).*
Expand Down
53 changes: 53 additions & 0 deletions zuul.d/project-templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,59 @@
- cifmw-molecule
- podified-multinode-edpm-deployment-crc: *content_provider
- cifmw-crc-podified-edpm-baremetal: *content_provider
- podified-multinode-hci-deployment-crc: *content_provider

- project-template:
name: data-plane-adoption-pipeline
description: |
Project template to run content provider with data-plane adoption job.
github-check:
jobs:
- openstack-k8s-operators-content-provider
- cifmw-data-plane-adoption-osp-17-to-extracted-crc:
dependencies:
- openstack-k8s-operators-content-provider

- project-template:
name: podified-ironic-operator-pipeline
description: |
Project template to run content provider with ironic podified job.
github-check:
jobs:
- noop
- openstack-k8s-operators-content-provider
- podified-multinode-ironic-deployment:
dependencies:
- openstack-k8s-operators-content-provider

- project-template:
name: podified-multinode-edpm-ci-framework-pipeline
description: |
Project template to run content provider for EDPM jobs,
with dependency on smaller jobs.
github-check:
jobs:
- openstack-k8s-operators-content-provider:
requires:
- cifmw-pod-pre-commit
- cifmw-molecule
- podified-multinode-edpm-deployment-crc: *content_provider
- cifmw-crc-podified-edpm-baremetal: *content_provider

- project-template:
name: data-plane-adoption-ci-framework-pipeline
description: |
Project template to run content provider with data-plane adoption job,
with dependency on smaller jobs.
github-check:
jobs:
- openstack-k8s-operators-content-provider:
requires:
- cifmw-pod-pre-commit
- cifmw-molecule
- cifmw-data-plane-adoption-osp-17-to-extracted-crc:
dependencies:
- openstack-k8s-operators-content-provider

- project-template:
name: data-plane-adoption-ci-framework-pipeline
Expand Down

0 comments on commit 4f78bc9

Please sign in to comment.