redhat/almalinux
This commit is contained in:
parent
635d63fb33
commit
616f1fdfa1
8
files/fedora40.repo
Normal file
8
files/fedora40.repo
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[fedora40]
|
||||||
|
name=Fedora 40 - \$basearch
|
||||||
|
baseurl=https://download.fedoraproject.org/pub/fedora/linux/releases/40/Everything/\$basearch/os/
|
||||||
|
enabled=0
|
||||||
|
#gpgcheck=1
|
||||||
|
gpgcheck=0
|
||||||
|
#gpgkey=https://getfedora.org/static/fedora.gpg
|
||||||
|
gpgkey=https://fedoraproject.org/fedora.gpg
|
||||||
@ -212,6 +212,7 @@
|
|||||||
- ifupdown
|
- ifupdown
|
||||||
- mosh
|
- mosh
|
||||||
- python3-redis
|
- python3-redis
|
||||||
|
- acl
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: install packages for debian0-11 ubuntu20
|
- name: install packages for debian0-11 ubuntu20
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
- name: include redhat specific
|
- name: include redhat specific
|
||||||
include_tasks: redhat.yml
|
include_tasks: redhat.yml
|
||||||
when: ansible_distribution == "RedHat"
|
when: ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux"
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
@ -39,23 +39,30 @@
|
|||||||
state: absent
|
state: absent
|
||||||
key: "{{ mgmt_ssh_key }}"
|
key: "{{ mgmt_ssh_key }}"
|
||||||
|
|
||||||
- name: find ntp.conf
|
- name: ntpd configuration
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian" or
|
||||||
|
ansible_distribution == "Ubuntu" or
|
||||||
|
(ansible_distribution == "RedHat" and ansible_distribution_major_version|int() == 9) or
|
||||||
|
(ansible_distribution == "AlmaLinux" and ansible_distribution_major_version|int() == 9)
|
||||||
|
block:
|
||||||
|
- name: find ntp.conf
|
||||||
tags: ntp
|
tags: ntp
|
||||||
command: "find /etc -name ntp.conf"
|
command: "find /etc -name ntp.conf"
|
||||||
register: find_ntpconf
|
register: find_ntpconf
|
||||||
|
|
||||||
- name: set ntpconf variable
|
- name: set ntpconf variable
|
||||||
set_fact:
|
set_fact:
|
||||||
ntpconf: "{{ find_ntpconf.stdout_lines[0] }}"
|
ntpconf: "{{ find_ntpconf.stdout_lines[0] }}"
|
||||||
|
|
||||||
- name: ntp.conf remove factory ntp servers
|
- name: ntp.conf remove factory ntp servers
|
||||||
tags: ntp
|
tags: ntp
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: "{{ ntpconf }}"
|
dest: "{{ ntpconf }}"
|
||||||
regexp: '^(pool|server)\s'
|
regexp: '^(pool|server)\s'
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: ntp.conf set ntp server
|
- name: ntp.conf set ntp server
|
||||||
tags: ntp
|
tags: ntp
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: "{{ ntpconf }}"
|
dest: "{{ ntpconf }}"
|
||||||
@ -63,7 +70,7 @@
|
|||||||
line: "server {{ ntp }} iburst"
|
line: "server {{ ntp }} iburst"
|
||||||
insertafter: '^# pool:'
|
insertafter: '^# pool:'
|
||||||
|
|
||||||
- name: ntp.conf remove limited, debian9-99 ubuntu20-99
|
- name: ntp.conf remove limited, debian9-99 ubuntu20-99
|
||||||
tags: ntp
|
tags: ntp
|
||||||
replace:
|
replace:
|
||||||
path: "{{ ntpconf }}"
|
path: "{{ ntpconf }}"
|
||||||
@ -73,13 +80,40 @@
|
|||||||
- (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 9) or
|
- (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 9) or
|
||||||
(ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20)
|
(ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20)
|
||||||
|
|
||||||
- name: ntp.conf set minsane 1
|
- name: ntp.conf set minsane 1
|
||||||
tags: ntp
|
tags: ntp
|
||||||
replace:
|
replace:
|
||||||
path: "{{ ntpconf }}"
|
path: "{{ ntpconf }}"
|
||||||
regexp: "minsane \\d+"
|
regexp: "minsane \\d+"
|
||||||
replace: "minsane 1"
|
replace: "minsane 1"
|
||||||
|
|
||||||
|
- name: chrony configuration
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "RedHat" and ansible_distribution_major_version|int() >= 10
|
||||||
|
block:
|
||||||
|
- name: chrony.conf remove factory ntp servers
|
||||||
|
tags: ntp
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/chrony.conf
|
||||||
|
regexp: '^(pool|server|sourcedir)\s'
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: chrony.conf set ntp server
|
||||||
|
tags: ntp
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/chrony.conf
|
||||||
|
regexp: '^(pool|server)\s'
|
||||||
|
line: "server {{ ntp }} iburst"
|
||||||
|
insertafter: '^# Please consider'
|
||||||
|
|
||||||
|
- name: chrony.conf set allow
|
||||||
|
tags: ntp
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/chrony.conf
|
||||||
|
regexp: '^allow\s'
|
||||||
|
line: "allow all"
|
||||||
|
insertafter: '^#allow'
|
||||||
|
|
||||||
- name: postfix master.cf debian8
|
- name: postfix master.cf debian8
|
||||||
tags: postfix
|
tags: postfix
|
||||||
patch:
|
patch:
|
||||||
@ -129,7 +163,7 @@
|
|||||||
src: postfix_master.cf.patch.redhat9
|
src: postfix_master.cf.patch.redhat9
|
||||||
dest: /etc/postfix/master.cf
|
dest: /etc/postfix/master.cf
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "RedHat"
|
- ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux"
|
||||||
|
|
||||||
- name: enable postfix service on redhat
|
- name: enable postfix service on redhat
|
||||||
tags: postfix
|
tags: postfix
|
||||||
@ -137,7 +171,7 @@
|
|||||||
name: postfix
|
name: postfix
|
||||||
enabled: yes
|
enabled: yes
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "RedHat"
|
- ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux"
|
||||||
|
|
||||||
- name: postfix inet_protocols ipv4 (redhat)
|
- name: postfix inet_protocols ipv4 (redhat)
|
||||||
tags: postfix
|
tags: postfix
|
||||||
@ -146,7 +180,7 @@
|
|||||||
regexp: '^inet_protocols\s'
|
regexp: '^inet_protocols\s'
|
||||||
line: "inet_protocols = ipv4"
|
line: "inet_protocols = ipv4"
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "RedHat"
|
- ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux"
|
||||||
|
|
||||||
- name: postfix myhostname (redhat)
|
- name: postfix myhostname (redhat)
|
||||||
tags: postfix
|
tags: postfix
|
||||||
@ -155,7 +189,7 @@
|
|||||||
regexp: '^myhostname\s'
|
regexp: '^myhostname\s'
|
||||||
line: "myhostname = {{ hostname }}.{{ domain }}"
|
line: "myhostname = {{ hostname }}.{{ domain }}"
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "RedHat"
|
- ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux"
|
||||||
|
|
||||||
- name: postfix relayhost
|
- name: postfix relayhost
|
||||||
tags: postfix
|
tags: postfix
|
||||||
|
|||||||
@ -35,39 +35,107 @@
|
|||||||
- perl-JSON
|
- perl-JSON
|
||||||
- perl-English
|
- perl-English
|
||||||
- net-tools
|
- net-tools
|
||||||
- mlocate
|
|
||||||
- glibc-langpack-hu
|
- glibc-langpack-hu
|
||||||
- setools-console
|
- setools-console
|
||||||
- setroubleshoot-server
|
- setroubleshoot-server
|
||||||
|
- acl
|
||||||
state: present
|
state: present
|
||||||
|
retries: 3
|
||||||
|
delay: 15
|
||||||
|
|
||||||
- name: subscription-manager repo change for epel install
|
- name: install packages for rhel9
|
||||||
tags: dnf
|
tags: dnf
|
||||||
shell: "subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms"
|
dnf:
|
||||||
|
name:
|
||||||
- name: install epel-release
|
- mlocate
|
||||||
tags: dnf
|
state: present
|
||||||
dnf:
|
retries: 3
|
||||||
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
|
delay: 15
|
||||||
disable_gpg_check: yes
|
when: "ansible_distribution_major_version|int() == 9"
|
||||||
|
|
||||||
- name: install packages, 2nd round
|
- name: install packages for rhel10-99
|
||||||
|
tags: dnf
|
||||||
|
dnf:
|
||||||
|
name:
|
||||||
|
- plocate
|
||||||
|
state: present
|
||||||
|
retries: 3
|
||||||
|
delay: 15
|
||||||
|
when: "ansible_distribution_major_version|int() >= 10"
|
||||||
|
|
||||||
|
- name: subscription-manager repo change for epel install
|
||||||
|
tags: dnf
|
||||||
|
shell: "subscription-manager repos --enable codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-$(arch)-rpms"
|
||||||
|
when: ansible_distribution == "RedHat"
|
||||||
|
|
||||||
|
- name: install epel-release on redhat
|
||||||
|
tags: dnf
|
||||||
|
dnf:
|
||||||
|
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
|
||||||
|
disable_gpg_check: yes
|
||||||
|
when: ansible_distribution == "RedHat"
|
||||||
|
retries: 3
|
||||||
|
delay: 15
|
||||||
|
|
||||||
|
- name: install epel-release on alma
|
||||||
|
tags: dnf
|
||||||
|
dnf:
|
||||||
|
name: epel-release
|
||||||
|
when: ansible_distribution == "AlmaLinux"
|
||||||
|
|
||||||
|
- name: install packages, 2nd round, rhel9
|
||||||
tags: dnf
|
tags: dnf
|
||||||
dnf:
|
dnf:
|
||||||
name:
|
name:
|
||||||
- ntpsec
|
|
||||||
- ngrep
|
- ngrep
|
||||||
- pwgen
|
|
||||||
- screen
|
- screen
|
||||||
- mosh
|
- mosh
|
||||||
|
- ntpsec
|
||||||
|
- pwgen
|
||||||
- w3m
|
- w3m
|
||||||
- prename
|
- prename
|
||||||
- python3-redis
|
- python3-redis
|
||||||
|
retries: 3
|
||||||
|
delay: 15
|
||||||
|
when: "ansible_distribution_major_version|int() == 9"
|
||||||
|
|
||||||
|
- name: install packages, 2nd round, rhel10-99
|
||||||
|
tags: dnf
|
||||||
|
dnf:
|
||||||
|
name:
|
||||||
|
- ngrep
|
||||||
|
- screen
|
||||||
|
- mosh
|
||||||
|
- python3-redis
|
||||||
|
- chrony
|
||||||
|
retries: 3
|
||||||
|
delay: 15
|
||||||
|
when: "ansible_distribution_major_version|int() >= 10"
|
||||||
|
|
||||||
|
- name: setup fedora40 repo, rhel10
|
||||||
|
copy:
|
||||||
|
src: fedora40.repo
|
||||||
|
dest: /etc/yum.repos.d/fedora40.repo
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "RedHat"
|
||||||
|
- ansible_distribution_major_version|int() == 10
|
||||||
|
|
||||||
|
- name: install package from fedora40 repo, rhel10
|
||||||
|
tags: dnf
|
||||||
|
dnf:
|
||||||
|
name:
|
||||||
|
- pwgen
|
||||||
|
- prename
|
||||||
|
enablerepo: fedora40
|
||||||
|
retries: 4
|
||||||
|
delay: 30
|
||||||
|
when: "ansible_distribution_major_version|int() == 10"
|
||||||
|
|
||||||
- name: enable ntpd service
|
- name: enable ntpd service
|
||||||
systemd_service:
|
systemd_service:
|
||||||
name: ntpd
|
name: ntpd
|
||||||
enabled: true
|
enabled: true
|
||||||
|
when: "ansible_distribution_major_version|int() == 9"
|
||||||
|
|
||||||
- name: remove motd.d/insights-client
|
- name: remove motd.d/insights-client
|
||||||
file:
|
file:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user