Skip to content

Commit

Permalink
common role: Add debian support
Browse files Browse the repository at this point in the history
  • Loading branch information
quartje committed Dec 14, 2023
1 parent 67eb7e4 commit 4a7d34c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 31 deletions.
36 changes: 15 additions & 21 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
yum:
name: epel-release.noarch
state: present
when: ansible_os_family == 'RedHat'

- name: Install tools / clients
yum:
package:
name:
- telnet
- sudo
Expand All @@ -32,13 +33,16 @@
yum:
name:
- ntp
when: ansible_distribution_major_version == '7'
when: (ansible_distribution_major_version == '7') and (ansible_os_family == 'RedHat')

- name: Install CentOS8 / Rocky 8 packages
yum:
- name: Install Chrony
package:
name:
- chrony
when: ansible_distribution_major_version == '8' or ansible_distribution_major_version == '9'
state: present
when:
- ansible_os_family == 'RedHat' and ansible_distribution_major_version >= '8'
- ansible_os_family == 'Debian'

- name: Install git on development vm
yum:
Expand Down Expand Up @@ -103,17 +107,19 @@
name: ntpd
state: started
enabled: yes
when: ansible_distribution_major_version == '7'
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7'

- name: Start chrony
service:
name: chronyd
state: started
enabled: yes
when: ansible_distribution_major_version == '8' or ansible_distribution_major_version == '9'
when:
- ansible_os_family == 'RedHat' and ansible_distribution_major_version >= '8'
- ansible_os_family == 'Debian'

- name: Remove exim,sendmail when Postfix needs to be installed
yum:
package:
name:
- exim
- sendmail
Expand All @@ -125,7 +131,7 @@
- sendmail_smarthost is defined

- name: Install Postfix
yum:
package:
name:
- postfix
state: present
Expand All @@ -143,18 +149,6 @@
notify:
- "reload postfix"

- name: Copy Postfix pseudo-email config
template:
src: "{{ item }}.j2"
dest: "/etc/postfix/{{ item }}"
when: sendmail_smarthost is defined and handle_pseudo_email
with_items:
- mysql-pseudo.cf
- header_checks
notify:
- "reload postfix"
- "rebuild header_checks"

- name: start and enable Postfix
service:
name: postfix
Expand Down
10 changes: 0 additions & 10 deletions roles/common/templates/mysql-pseudo.cf.j2

This file was deleted.

0 comments on commit 4a7d34c

Please sign in to comment.