Browse Source

Include potentially distro-specific tasks at runtime

This avoids Ansible trying to ensure `community.general.pacman` is
available, even if that module will never run (because `when` says so).

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/2228
pull/2233/head
Slavi Pantaleev 3 years ago
parent
commit
c1c152f7ac
8 changed files with 46 additions and 32 deletions
  1. +5
    -16
      roles/custom/matrix-base/tasks/util/ensure_fuse_installed.yml
  2. +6
    -0
      roles/custom/matrix-base/tasks/util/ensure_fuse_installed_archlinux.yml
  3. +6
    -0
      roles/custom/matrix-base/tasks/util/ensure_fuse_installed_debian.yml
  4. +6
    -0
      roles/custom/matrix-base/tasks/util/ensure_fuse_installed_redhat.yml
  5. +5
    -16
      roles/custom/matrix-base/tasks/util/ensure_openssl_installed.yml
  6. +6
    -0
      roles/custom/matrix-base/tasks/util/ensure_openssl_installed_archlinux.yml
  7. +6
    -0
      roles/custom/matrix-base/tasks/util/ensure_openssl_installed_debian.yml
  8. +6
    -0
      roles/custom/matrix-base/tasks/util/ensure_openssl_installed_redhat.yml

+ 5
- 16
roles/custom/matrix-base/tasks/util/ensure_fuse_installed.yml View File

@@ -1,23 +1,12 @@
---

# This is for both RedHat 7 and 8
- name: Ensure fuse installed (RedHat)
ansible.builtin.yum:
name:
- fuse
state: present
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_fuse_installed_redhat.yml"
when: ansible_os_family == 'RedHat'

# This is for both Debian and Raspbian
- name: Ensure fuse installed (Debian/Raspbian)
ansible.builtin.apt:
name:
- fuse
state: present
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_fuse_installed_debian.yml"
when: ansible_os_family == 'Debian'

- name: Ensure fuse installed (Archlinux)
community.general.pacman:
name:
- fuse3
state: present
when: ansible_distribution == 'Archlinux'
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_fuse_installed_archlinux.yml"
when: ansible_os_family == 'Archlinux'

+ 6
- 0
roles/custom/matrix-base/tasks/util/ensure_fuse_installed_archlinux.yml View File

@@ -0,0 +1,6 @@
---

- name: Ensure fuse installed (Archlinux)
community.general.pacman:
name: fuse3
state: present

+ 6
- 0
roles/custom/matrix-base/tasks/util/ensure_fuse_installed_debian.yml View File

@@ -0,0 +1,6 @@
---

- name: Ensure fuse installed (Debian/Raspbian)
ansible.builtin.apt:
name: fuse
state: present

+ 6
- 0
roles/custom/matrix-base/tasks/util/ensure_fuse_installed_redhat.yml View File

@@ -0,0 +1,6 @@
---

- name: Ensure fuse installed (RedHat)
ansible.builtin.yum:
name: fuse
state: present

+ 5
- 16
roles/custom/matrix-base/tasks/util/ensure_openssl_installed.yml View File

@@ -1,23 +1,12 @@
---

# This is for both RedHat 7 and 8
- name: Ensure openssl installed (RedHat)
ansible.builtin.yum:
name:
- openssl
state: present
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_openssl_installed_redhat.yml"
when: ansible_os_family == 'RedHat'

# This is for both Debian and Raspbian
- name: Ensure openssl installed (Debian/Raspbian)
ansible.builtin.apt:
name:
- openssl
state: present
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_openssl_installed_debian.yml"
when: ansible_os_family == 'Debian'

- name: Ensure openssl installed (Archlinux)
community.general.pacman:
name:
- openssl
state: present
when: ansible_distribution == 'Archlinux'
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_openssl_installed_archlinux.yml"
when: ansible_os_family == 'Archlinux'

+ 6
- 0
roles/custom/matrix-base/tasks/util/ensure_openssl_installed_archlinux.yml View File

@@ -0,0 +1,6 @@
---

- name: Ensure openssl installed (Archlinux)
community.general.pacman:
name: openssl
state: present

+ 6
- 0
roles/custom/matrix-base/tasks/util/ensure_openssl_installed_debian.yml View File

@@ -0,0 +1,6 @@
---

- name: Ensure openssl installed (Debian/Raspbian)
ansible.builtin.apt:
name: openssl
state: present

+ 6
- 0
roles/custom/matrix-base/tasks/util/ensure_openssl_installed_redhat.yml View File

@@ -0,0 +1,6 @@
---

- name: Ensure openssl installed (RedHat)
ansible.builtin.yum:
name: openssl
state: present

Loading…
Cancel
Save