From 356ccc9847465b49fb46d7739d438e55c53ddf40 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Fri, 3 Mar 2023 20:58:41 +0100 Subject: [PATCH] ajout support el9 --- tasks/main.yml | 35 +++++++++++++++-------------------- tasks/setup-rocky-8.yml | 18 ++++++++++++++++++ tasks/setup-rocky-9.yml | 11 +++++++++++ 3 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 tasks/setup-rocky-8.yml create mode 100644 tasks/setup-rocky-9.yml diff --git a/tasks/main.yml b/tasks/main.yml index fb200bc..95f2620 100755 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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. diff --git a/tasks/setup-rocky-8.yml b/tasks/setup-rocky-8.yml new file mode 100644 index 0000000..9b3605d --- /dev/null +++ b/tasks/setup-rocky-8.yml @@ -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" diff --git a/tasks/setup-rocky-9.yml b/tasks/setup-rocky-9.yml new file mode 100644 index 0000000..beeb708 --- /dev/null +++ b/tasks/setup-rocky-9.yml @@ -0,0 +1,11 @@ +--- +- name: Install msmtp + yum: + name: + - msmtp + - s-nail + state: present + notify: + - test mail + - restart msmtpd + when: ansible_os_family == "RedHat"