Merge "Install required packages for NFS/CephFS mounts"

This commit is contained in:
Zuul 2020-10-06 12:46:11 +00:00 committed by Gerrit Code Review
commit bcbd5344cf
4 changed files with 38 additions and 0 deletions

View File

@ -13,5 +13,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
- "{{ ansible_os_family | lower }}.yml"
tags:
- always
- name: Install required distro packages for mounts
package:
name: "{{ systemd_mount_packages }}"
state: present
- include_tasks: systemd_mounts.yml
with_items: "{{ systemd_mounts }}"

5
vars/debian.yml Normal file
View File

@ -0,0 +1,5 @@
systemd_nfs_packages:
- nfs-common
systemd_ceph_packages:
- ceph-fuse

View File

@ -19,3 +19,14 @@ systemd_mount_states:
started: reload-or-restart
stopped: stopped
absent: stopped
systemd_mount_packages: |-
{% set packages = [] %}
{% set mount_types = systemd_mounts | map(attribute='type') | list %}
{% if 'nfs' in mount_types %}
{% set _ = packages.extend(systemd_nfs_packages) %}
{% endif %}
{% if 'ceph' in mount_types %}
{% set _ = packages.extend(systemd_ceph_packages) %}
{% endif %}
{{ packages }}

5
vars/redhat.yml Normal file
View File

@ -0,0 +1,5 @@
systemd_nfs_packages:
- nfs-utils
systemd_ceph_packages:
- ceph-fuse