From 5220267673ee44d7a0ae8e978a59e5f8a57f905c Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 20 Jun 2022 22:14:47 +0200 Subject: [PATCH] add redhat compatibilty --- defaults/main.yml | 4 +--- tasks/main.yml | 8 +++++++- vars/Archlinux.yml | 4 ++++ vars/RedHat.yml | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 vars/Archlinux.yml create mode 100644 vars/RedHat.yml diff --git a/defaults/main.yml b/defaults/main.yml index 8d414aa..39ff2cf 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,6 +4,4 @@ msmtp_mailhub_port: 587 msmtp_hostname: ducamps.win msmtp_auth_user: vincent@ducamps.win msmtp_auth_pass: the_mandrill_api_key -msmtp_package: - - msmtp - - msmtp-mta \ No newline at end of file + diff --git a/tasks/main.yml b/tasks/main.yml index 7c9733b..aebcacd 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,3 +1,9 @@ +- name: Include OS-specific variables + include_vars: "{{ item }}" + with_first_found: + - files: + - "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml" + - "{{ ansible_os_family }}.yml" - name: uninstall ssmtp package: @@ -39,4 +45,4 @@ #sudo chown root:mail /usr/sbin/msmtp /etc/msmtp{,/{msmtp.conf,revaliases}} #sudo chmod 2711 /usr/sbin/msmtp -#sudo chmod o-rwx /etc/msmtp /etc/msmtp/msmtp.conf; \ No newline at end of file +#sudo chmod o-rwx /etc/msmtp /etc/msmtp/msmtp.conf; diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml new file mode 100644 index 0000000..20eb449 --- /dev/null +++ b/vars/Archlinux.yml @@ -0,0 +1,4 @@ +--- +msmtp_package: + - msmtp + - msmtp-mta diff --git a/vars/RedHat.yml b/vars/RedHat.yml new file mode 100644 index 0000000..1f12550 --- /dev/null +++ b/vars/RedHat.yml @@ -0,0 +1,2 @@ +msmtp_package: + - msmtp