Dmitriy Rabotyagov 1d919bb350 Auto-fix usage of modules via FQCN
Since ansible-core 2.10 it is recommended to use modules via FQCN
In order to align with recommendation, we perform migration
by applying suggestions made by `ansible-lint --fix=fqcn`

Change-Id: I490bcfa824a5516271b188e1383d02b5bd578171
2025-02-13 09:06:04 +01:00

93 lines
3.2 KiB
YAML

---
# Copyright 2020, City Network International AB.
#
# 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: Install EPEL
when:
- "'s3fs' in systemd_mount_types"
- ansible_facts['os_family'] | lower == 'redhat'
block:
- name: Download EPEL gpg keys
ansible.builtin.get_url:
url: "{{ systemd_centos_epel_key }}"
dest: /etc/pki/rpm-gpg
mode: "0640"
register: _get_yum_keys
until: _get_yum_keys is success
retries: 5
delay: 2
- name: Install EPEL gpg keys
ansible.builtin.rpm_key:
key: "/etc/pki/rpm-gpg/{{ systemd_centos_epel_key.split('/')[-1] }}"
state: present
- name: Install the EPEL repository
ansible.builtin.yum_repository:
name: epel-systemd_mounts
baseurl: "{{ systemd_centos_epel_mirror ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}"
description: "Extra Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch"
gpgcheck: true
enabled: true
state: present
includepkgs: "s3fs-fuse"
register: install_epel_repo
until: install_epel_repo is success
retries: 5
delay: 2
- name: Install required distro packages for mounts
ansible.builtin.package:
name: "{{ systemd_mount_packages }}"
state: present
# NOTE(jrosser) as we call systemd_service from inside a block: with a when:
# parameter, the when: condition must be able to be resolved inside the
# systemd_service role where role vars from systemd_mount are not in scope
- name: Make boolean flag for setting up glusterfs
ansible.builtin.set_fact:
_configure_glusterfs: "{{ 'glusterfs' in systemd_mount_types }}"
- name: Configure fuse for glusterfs
when:
- _configure_glusterfs
block:
- name: Configure systemd-tmpfiles to create /dev/fuse at boot
ansible.builtin.copy:
content: "c /dev/fuse 0600 - - - 10:229"
dest: "/etc/tmpfiles.d/openstack-ansible-systemd_mount-glusterfs-client.conf"
mode: "0644"
register: _glusterfs_server_tmpfiles
- name: Apply systemctl overrides
when: ansible_facts['pkg_mgr'] == 'dnf'
ansible.builtin.include_role:
name: systemd_service
vars:
systemd_services:
- service_name: systemd-tmpfiles-setup-dev
restart_changed: false
load: false
systemd_overrides_only: true
systemd_overrides:
Unit:
ConditionCapability: ""
- name: Restart systemd-tmpfiles-setup-dev
ansible.builtin.service:
name: "systemd-tmpfiles-setup-dev"
state: restarted
when:
- _glusterfs_server_tmpfiles is changed