ajout support el9

This commit is contained in:
Gitouche 2023-03-03 20:58:41 +01:00
parent 16f7a16d33
commit 356ccc9847
3 changed files with 44 additions and 20 deletions

View File

@ -1,27 +1,22 @@
---
- name: Include tasks depending on OS
ansible.builtin.include_tasks:
file: "{{ item }}"
apply:
tags:
- wg-install
with_first_found:
- "setup-{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version }}.yml"
- "setup-{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}.yml"
- "setup-{{ ansible_distribution | lower }}-{{ ansible_distribution_release }}.yml"
- "setup-{{ ansible_distribution | lower }}.yml"
- "setup-{{ ansible_os_family | lower }}.yml"
- name: Copy systemd unit file to server
copy:
src: msmtpd.service
dest: /etc/systemd/system/msmtpd.service
mode: 0400
when: ansible_os_family == "RedHat"
- name: Ensure group "msmtp" exists
group:
name: msmtp
state: present
when: ansible_os_family == "RedHat"
- name: Install msmtp
yum:
name:
- "{{ msmtp_rpm_file }}"
- mailx
state: present
disable_gpg_check: yes
notify:
- test mail
- restart msmtpd
dest: /usr/lib/systemd/system/msmtpd.service
mode: 0444
when: ansible_os_family == "RedHat"
- name: Copy mstprc conf file.

18
tasks/setup-rocky-8.yml Normal file
View File

@ -0,0 +1,18 @@
---
- name: Ensure group "msmtp" exists
group:
name: msmtp
state: present
when: ansible_os_family == "RedHat"
- name: Install msmtp
yum:
name:
- "{{ msmtp_rpm_file }}"
- mailx
state: present
disable_gpg_check: yes
notify:
- test mail
- restart msmtpd
when: ansible_os_family == "RedHat"

11
tasks/setup-rocky-9.yml Normal file
View File

@ -0,0 +1,11 @@
---
- name: Install msmtp
yum:
name:
- msmtp
- s-nail
state: present
notify:
- test mail
- restart msmtpd
when: ansible_os_family == "RedHat"