mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 08:15:54 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
7
roles/repo_base/defaults/main.yml
Normal file
7
roles/repo_base/defaults/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
repo_remi_release_uri: "http://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm"
|
||||
repo_postgres: True
|
||||
# Only available for CentOS >= 8
|
||||
# if True, will switch to the CentOS Stream repo
|
||||
repo_centos_stream: False
|
||||
...
|
29
roles/repo_base/tasks/AlmaLinux-8.yml
Normal file
29
roles/repo_base/tasks/AlmaLinux-8.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
|
||||
- name: Configure repositories
|
||||
yum_repository:
|
||||
file: "{{ item.file }}"
|
||||
description: "AlmaLinux {{ item.name }}"
|
||||
name: "{{ item.name }}"
|
||||
baseurl: https://repo.almalinux.org/almalinux/$releasever/{{ item.dir }}/$basearch/os/
|
||||
gpgcheck: True
|
||||
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
|
||||
enabled: "{{ item.enabled | default(True) }}"
|
||||
loop:
|
||||
- name: baseos
|
||||
file: almalinux
|
||||
dir: BaseOS
|
||||
- name: appstream
|
||||
file: almalinux
|
||||
dir: AppStream
|
||||
- name: extras
|
||||
file: almalinux
|
||||
dir: extras
|
||||
- name: powertools
|
||||
file: almalinux-powertools
|
||||
dir: PowerTools
|
||||
tags: repo
|
||||
|
||||
- include: epel_{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml
|
||||
- include: fws_{{ ansible_os_family }}.yml
|
||||
- include: postgres_client_{{ ansible_os_family }}.yml
|
51
roles/repo_base/tasks/CentOS-7.yml
Normal file
51
roles/repo_base/tasks/CentOS-7.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
|
||||
- name: Configure base repositories
|
||||
yum_repository:
|
||||
file: CentOS-Base
|
||||
description: "Centos - {{ item.repo }}"
|
||||
name: "{{ item.repo }}"
|
||||
baseurl: http://mirror.centos.org/centos/$releasever/{{ item.dir }}/$basearch/
|
||||
gpgcheck: True
|
||||
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
|
||||
exclude: 'lasso*'
|
||||
loop:
|
||||
- repo: base
|
||||
dir: os
|
||||
- repo: updates
|
||||
dir: updates
|
||||
- repo: extras
|
||||
dir: extras
|
||||
tags: repo
|
||||
|
||||
- name: Configure centosplus
|
||||
yum_repository:
|
||||
file: CentOS-Base
|
||||
description: "Centos - centosplus"
|
||||
name: centosplus
|
||||
baseurl: http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
|
||||
gpgcheck: True
|
||||
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
|
||||
enabled: False
|
||||
tags: repo
|
||||
|
||||
- name: Install yum priorities plugin
|
||||
yum:
|
||||
name:
|
||||
- yum-plugin-priorities
|
||||
tags: repo
|
||||
|
||||
- name: Remove obsolete repo
|
||||
file: path=/etc/yum.repos.d/{{ item }}.repo state=absent
|
||||
loop:
|
||||
- nux-dextop
|
||||
- seadrive
|
||||
- remi-safe
|
||||
- redis
|
||||
- fws-extra-nginx
|
||||
- CentOS-Linux-BaseOS
|
||||
tags: repo
|
||||
|
||||
- include: epel_{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml
|
||||
- include: fws_{{ ansible_os_family }}.yml
|
||||
- include: postgres_client_{{ ansible_os_family }}.yml
|
125
roles/repo_base/tasks/CentOS-8.yml
Normal file
125
roles/repo_base/tasks/CentOS-8.yml
Normal file
@@ -0,0 +1,125 @@
|
||||
---
|
||||
|
||||
- when: not repo_centos_stream
|
||||
block:
|
||||
- name: Configure repositories
|
||||
yum_repository:
|
||||
file: "{{ item.file }}"
|
||||
description: "CentOS {{ item.name }}"
|
||||
name: "{{ item.name }}"
|
||||
baseurl: http://mirror.centos.org/$contentdir/$releasever/{{ item.dir }}/$basearch/os/
|
||||
gpgcheck: True
|
||||
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||
enabled: "{{ item.enabled | default(True) }}"
|
||||
loop:
|
||||
- name: baseos
|
||||
file: CentOS-Linux-Base
|
||||
dir: BaseOS
|
||||
- name: appstream
|
||||
file: CentOS-Linux-AppStream
|
||||
dir: AppStream
|
||||
- name: plus
|
||||
file: CentOS-Linux-Plus
|
||||
dir: centosplus
|
||||
enabled: False
|
||||
- name: extras
|
||||
file: CentOS-Linux-Extras
|
||||
dir: extras
|
||||
- name: powertools
|
||||
file: CentOS-Linux-PowerTools
|
||||
dir: PowerTools
|
||||
|
||||
- name: Remove Base file
|
||||
file: path=/etc/yum.repos.d/{{ item }}.repo state=absent
|
||||
loop:
|
||||
- CentOS-Stream-AppStream
|
||||
- CentOS-Stream-Base
|
||||
- CentOS-Stream-ContinuousRelease
|
||||
- CentOS-Stream-Debuginfo
|
||||
- CentOS-Stream-Devel
|
||||
- CentOS-Stream-Extras
|
||||
- CentOS-Stream-FastTrack
|
||||
- CentOS-Stream-centosplus
|
||||
- CentOS-Stream-PowerTools
|
||||
|
||||
# Waiting for the allowerasing args to dnf module, landing in ansible 2.10
|
||||
- name: Switch to centos-linux-repos
|
||||
shell: rpm -q centos-linux-repos || dnf install centos-linux-repos -y --allowerasing
|
||||
args:
|
||||
warn: False
|
||||
changed_when: False
|
||||
|
||||
tags: repo
|
||||
|
||||
- when: repo_centos_stream
|
||||
block:
|
||||
- name: Check if stream variable is set
|
||||
copy: content={{ item.content }} dest={{ item.dest }}
|
||||
loop:
|
||||
- content: "{{ ansible_distribution_major_version }}-stream"
|
||||
dest: /etc/dnf/vars/stream
|
||||
|
||||
- name: Configure repositories
|
||||
yum_repository:
|
||||
file: "{{ item.file }}"
|
||||
description: "CentOS {{ item.name }}"
|
||||
name: "{{ item.name }}"
|
||||
baseurl: http://mirror.centos.org/$contentdir/$stream/{{ item.dir }}/$basearch/os/
|
||||
gpgcheck: True
|
||||
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
|
||||
loop:
|
||||
- name: baseos
|
||||
file: CentOS-Stream-BaseOS
|
||||
dir: BaseOS
|
||||
- name: appstream
|
||||
file: CentOS-Stream-AppStream
|
||||
dir: AppStream
|
||||
- name: extras
|
||||
file: CentOS-Stream-Extras
|
||||
dir: extras
|
||||
- name: powertools
|
||||
file: CentOS-Stream-PowerTools
|
||||
dir: PowerTools
|
||||
|
||||
- name: Remove Base file
|
||||
file: path=/etc/yum.repos.d/{{ item }}.repo state=absent
|
||||
loop:
|
||||
- CentOS-Linux-AppStream
|
||||
- CentOS-Linux-BaseOS
|
||||
- CentOS-Linux-Base
|
||||
- CentOS-Linux-ContinuousRelease
|
||||
- CentOS-Linux-Debuginfo
|
||||
- CentOS-Linux-Devel
|
||||
- CentOS-Linux-Extras
|
||||
- CentOS-Linux-FastTrack
|
||||
- CentOS-Linux-centosplus
|
||||
- CentOS-Linux-Plus
|
||||
- CentOS-Linux-PowerTools
|
||||
|
||||
# Waiting for the allowerasing args to dnf module, landing in ansible 2.10
|
||||
- name: Switch to centos-stream-repos
|
||||
shell: rpm -q centos-stream-repos || dnf install centos-stream-repos -y --allowerasing
|
||||
args:
|
||||
warn: False
|
||||
changed_when: False
|
||||
|
||||
tags: repo
|
||||
|
||||
- name: Remove old repo files
|
||||
file: path=/etc/yum.repos.d/{{ item }}.repo state=absent
|
||||
loop:
|
||||
- CentOS-Base
|
||||
- CentOS-CR
|
||||
- CentOS-Extras
|
||||
- CentOS-BaseOS
|
||||
- CentOS-AppStream
|
||||
- CentOS-PowerTools
|
||||
- CentOS-centosplus
|
||||
- CentOS-cr
|
||||
- CentOS-extras
|
||||
- CentOS-fasttrack
|
||||
tags: repo
|
||||
|
||||
- include: epel_{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml
|
||||
- include: fws_{{ ansible_os_family }}.yml
|
||||
- include: postgres_client_{{ ansible_os_family }}.yml
|
1
roles/repo_base/tasks/Debian.yml
Normal file
1
roles/repo_base/tasks/Debian.yml
Normal file
@@ -0,0 +1 @@
|
||||
---
|
11
roles/repo_base/tasks/epel_RedHat-7.yml
Normal file
11
roles/repo_base/tasks/epel_RedHat-7.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
|
||||
- name: Configure EPEL repository
|
||||
yum_repository:
|
||||
name: epel
|
||||
description: "Extra Package for Enterprise Linux"
|
||||
baseurl: http://mirrors.ircam.fr/pub/fedora/epel/$releasever/$basearch http://mir01.syntis.net/epel/$releasever/$basearch
|
||||
gpgcheck: True
|
||||
gpgkey: https://mir01.syntis.net/epel/RPM-GPG-KEY-EPEL-7
|
||||
exclude: dehydrated
|
||||
tags: repo
|
20
roles/repo_base/tasks/epel_RedHat-8.yml
Normal file
20
roles/repo_base/tasks/epel_RedHat-8.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Configure EPEL repository
|
||||
yum_repository:
|
||||
name: epel
|
||||
description: "Extra Package for Enterprise Linux"
|
||||
baseurl: http://mirrors.ircam.fr/pub/fedora/epel/$releasever/Everything/$basearch http://mir01.syntis.net/epel/$releasever/Everything/$basearch
|
||||
gpgcheck: True
|
||||
gpgkey: https://mir01.syntis.net/epel/RPM-GPG-KEY-EPEL-8
|
||||
exclude: dehydrated
|
||||
tags: repo
|
||||
|
||||
- name: Config EPEL Modular repository
|
||||
yum_repository:
|
||||
name: epel-modular
|
||||
description: "Extra Packages for Enterprise Linux Modular $releasever - $basearch"
|
||||
baseurl: http://mirrors.ircam.fr/pub/fedora/epel/$releasever/Modular/$basearch http://mir01.syntis.net/epel/$releasever/Modular/$basearch
|
||||
gpgcheck: True
|
||||
gpgkey: https://mir01.syntis.net/epel/RPM-GPG-KEY-EPEL-8
|
||||
tags: repo
|
22
roles/repo_base/tasks/fws_RedHat.yml
Normal file
22
roles/repo_base/tasks/fws_RedHat.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
|
||||
- name: Configure FWS repository
|
||||
yum_repository:
|
||||
name: fws
|
||||
description: "Firewall Services"
|
||||
baseurl: http://repo.firewall-services.com/centos/$releasever/
|
||||
gpgcheck: True
|
||||
gpgkey: http://repo.firewall-services.com/RPM-GPG-KEY
|
||||
tags: repo
|
||||
|
||||
- name: Configure FWS Testing repository
|
||||
yum_repository:
|
||||
name: fws-testing
|
||||
description: "Firewall Services Testing"
|
||||
file: fws
|
||||
baseurl: http://repo.firewall-services.com/centos-testing/$releasever/
|
||||
gpgcheck: True
|
||||
gpgkey: http://repo.firewall-services.com/RPM-GPG-KEY
|
||||
enabled: False
|
||||
tags: repo
|
||||
|
12
roles/repo_base/tasks/main.yml
Normal file
12
roles/repo_base/tasks/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
|
||||
- include: '{{ repo_item }}'
|
||||
with_first_found:
|
||||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
|
||||
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml'
|
||||
- '{{ ansible_distribution }}.yml'
|
||||
- '{{ ansible_os_family }}.yml'
|
||||
loop_control:
|
||||
loop_var: repo_item
|
||||
tags: repo
|
||||
|
5
roles/repo_base/tasks/postgres_client_RedHat.yml
Normal file
5
roles/repo_base/tasks/postgres_client_RedHat.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Configure latest PostgreSQL repository
|
||||
template: src=postgresql-client.repo.j2 dest=/etc/yum.repos.d/postgresql-client.repo
|
||||
tags: repo
|
10
roles/repo_base/templates/postgresql-client.repo.j2
Normal file
10
roles/repo_base/templates/postgresql-client.repo.j2
Normal file
@@ -0,0 +1,10 @@
|
||||
[postgresql-client]
|
||||
baseurl = https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-$releasever-$basearch
|
||||
gpgcheck = 1
|
||||
gpgkey = https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-14
|
||||
name = PostgreSQL Client
|
||||
includepkgs = postgresql14 postgresql14-libs
|
||||
{% if ansible_os_family == 'RedHat' and ansible_distribution_major_version is version('8', '>=') %}
|
||||
# Workaround a bug in dnf which would make the default module mask packages from postgres repo
|
||||
module_hotfixes = true
|
||||
{% endif %}
|
Reference in New Issue
Block a user