From 50f16d1e134a1e3116193b4db8423a60cfd1f399 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 4 Sep 2024 11:47:43 +0100 Subject: [PATCH] Remove ceph-server common tasks These tasks would not make a well formed role in the plugins repo so we duplicate the small number of tasks into the playbooks that include them. Change-Id: Idba34e3e81c372dc37b65f032485158aa6a0088a --- playbooks/ceph-install.yml | 60 ++++++++++++++++++++++++-- playbooks/ceph-rgw-install.yml | 23 +++++++++- playbooks/common-tasks/ceph-server.yml | 49 --------------------- 3 files changed, 77 insertions(+), 55 deletions(-) delete mode 100644 playbooks/common-tasks/ceph-server.yml diff --git a/playbooks/ceph-install.yml b/playbooks/ceph-install.yml index 141ced8596..f8645757e7 100644 --- a/playbooks/ceph-install.yml +++ b/playbooks/ceph-install.yml @@ -80,8 +80,34 @@ tags: - always - - name: Importing ceph-server tasks - import_tasks: common-tasks/ceph-server.yml + - name: Including container setup role + include_role: + name: "openstack.osa.{{ container_tech | default('lxc') }}_container_setup" + when: not is_metal + vars: + list_of_bind_mounts: "{{ ceph_container_bind_mounts }}" + + - name: Including unbound-clients role + include_role: + name: openstack.osa.unbound_clients + when: + - hostvars['localhost']['resolvconf_enabled'] | bool + + # Set the priority of the ceph community apt repo either above or below that of UCA or distro sources + - name: Set apt package pins + include_role: + name: apt_package_pinning + vars: + apt_package_pinning_file_name: "ceph_community_pin.pref" + apt_package_pinning_priority: "{{ (ceph_repository == 'community') | ternary(1000, 100) }}" + apt_pinned_packages: [{ package: '*', release: 'ceph.com' }] + when: + - ansible_facts['pkg_mgr'] == 'apt' + + - name: Install python3-yaml + package: + name: "{{ (ansible_facts['os_family'] | lower == 'debian') | ternary('python3-yaml', 'python3-pyyaml') }}" + state: present - name: Create systemd service directory file: @@ -171,8 +197,34 @@ tags: - always - - name: Importing ceph-server tasks - import_tasks: common-tasks/ceph-server.yml + - name: Including container setup role + include_role: + name: "openstack.osa.{{ container_tech | default('lxc') }}_container_setup" + when: not is_metal + vars: + list_of_bind_mounts: "{{ ceph_container_bind_mounts }}" + + - name: Including unbound-clients tasks + include_role: + name: openstack.osa.unbound_clients + when: + - hostvars['localhost']['resolvconf_enabled'] | bool + + # Set the priority of the ceph community apt repo either above or below that of UCA or distro sources + - name: Set apt package pins + include_role: + name: apt_package_pinning + vars: + apt_package_pinning_file_name: "ceph_community_pin.pref" + apt_package_pinning_priority: "{{ (ceph_repository == 'community') | ternary(1000, 100) }}" + apt_pinned_packages: [{ package: '*', release: 'ceph.com' }] + when: + - ansible_facts['pkg_mgr'] == 'apt' + + - name: Install python3-yaml + package: + name: "{{ (ansible_facts['os_family'] | lower == 'debian') | ternary('python3-yaml', 'python3-pyyaml') }}" + state: present roles: - role: ceph-defaults diff --git a/playbooks/ceph-rgw-install.yml b/playbooks/ceph-rgw-install.yml index 7b04d21866..c4eaae869b 100644 --- a/playbooks/ceph-rgw-install.yml +++ b/playbooks/ceph-rgw-install.yml @@ -39,8 +39,27 @@ tags: - always - - name: Importing ceph-server tasks - import_tasks: common-tasks/ceph-server.yml + - name: Including unbound-clients role + include_role: + name: openstack.osa.unbound_clients + when: + - hostvars['localhost']['resolvconf_enabled'] | bool + + # Set the priority of the ceph community apt repo either above or below that of UCA or distro sources + - name: Set apt package pins + include_role: + name: apt_package_pinning + vars: + apt_package_pinning_file_name: "ceph_community_pin.pref" + apt_package_pinning_priority: "{{ (ceph_repository == 'community') | ternary(1000, 100) }}" + apt_pinned_packages: [{ package: '*', release: 'ceph.com' }] + when: + - ansible_facts['pkg_mgr'] == 'apt' + + - name: Install python3-yaml + package: + name: "{{ (ansible_facts['os_family'] | lower == 'debian') | ternary('python3-yaml', 'python3-pyyaml') }}" + state: present - name: Gather ceph-mon facts action: setup diff --git a/playbooks/common-tasks/ceph-server.yml b/playbooks/common-tasks/ceph-server.yml deleted file mode 100644 index b5cc382726..0000000000 --- a/playbooks/common-tasks/ceph-server.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -# Copyright 2017, Logan Vig -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- name: Including container setup role - include_role: - name: "openstack.osa.{{ container_tech | default('lxc') }}_container_setup" - when: not is_metal - vars: - list_of_bind_mounts: "{{ ceph_container_bind_mounts }}" - -- include_tasks: common-tasks/unbound-clients.yml - when: - - hostvars['localhost']['resolvconf_enabled'] | bool - -# TODO: mgariepy, revisit to use include_role when https://github.com/ansible/ansible/issues/20077 is fixed -- name: Ensure Ansible can work with SELinux - package: - name: libselinux-python3 - state: present - when: - - ansible_facts['pkg_mgr'] == 'dnf' - -# Set the priority of the ceph community apt repo either above or below that of UCA or distro sources -- name: Set apt package pins - include_role: - name: apt_package_pinning - vars: - apt_package_pinning_file_name: "ceph_community_pin.pref" - apt_package_pinning_priority: "{{ (ceph_repository == 'community') | ternary(1000, 100) }}" - apt_pinned_packages: [{ package: '*', release: 'ceph.com' }] - when: - - ansible_facts['pkg_mgr'] == 'apt' - -- name: Install python3-yaml - package: - name: "{{ (ansible_facts['os_family'] | lower == 'debian') | ternary('python3-yaml', 'python3-pyyaml') }}" - state: present