-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
856 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,65 @@ | ||
--- | ||
- name: Load OS related variables | ||
ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" | ||
|
||
- name: Load common variables structured on OS related variables | ||
ansible.builtin.include_vars: common.yml | ||
|
||
- name: Import aybarsm linux ansible role | ||
ansible.builtin.import_role: | ||
name: aybarsm.linux.ansible | ||
|
||
- name: Set facts for package manager | ||
ansible.builtin.import_tasks: | ||
file: set_facts.yml | ||
when: package_manager__role_enabled | default(false) | bool | ||
|
||
- name: Import DEB repository and repository key tasks (APT) | ||
ansible.builtin.import_tasks: | ||
file: deb.yml | ||
when: | ||
- package_manager__role_enabled | default(false) | bool | ||
- ansible_os_family | lower == 'debian' | ||
|
||
- name: Check upgrade strategy once compliance | ||
ansible.builtin.fail: | ||
msg: "Upgrade strategy has been set to 'once' but the required conditions are not met. Please enable the role and manage local facts to use 'once' strategy." | ||
when: | ||
- package_manager__upgrade_strategy == 'once' | ||
- not __package_manager__upgrade_once_eligible | ||
|
||
- name: Import upgrade tasks | ||
ansible.builtin.import_tasks: | ||
file: upgrade.yml | ||
when: | ||
- package_manager__role_enabled | default(false) | bool | ||
- __package_manager__upgrade_perform | ||
|
||
- name: Import DEB package tasks (APT) | ||
ansible.builtin.import_tasks: | ||
file: deb_packages.yml | ||
when: | ||
- package_manager__role_enabled | default(false) | bool | ||
- package_manager__package_strategy | lower == 'specific' | ||
- ansible_os_family | lower == 'debian' | ||
|
||
- name: Import common package manager tasks | ||
ansible.builtin.import_tasks: | ||
file: common_packages.yml | ||
when: | ||
- package_manager__role_enabled | default(false) | bool | ||
- package_manager__package_strategy | lower == 'common' | ||
# FIXME: Commented out for testing. Uncomment after testing. | ||
# - name: Load OS related variables | ||
# ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" | ||
|
||
# HACK: This is a workaround to load the OS related variables for debug | ||
# - name: Load OS related variables | ||
# ansible.builtin.include_vars: test.yml | ||
|
||
# FIXME: Commented out for testing. Uncomment after testing. | ||
# - name: Load common variables structured on OS related variables | ||
# ansible.builtin.include_vars: common.yml | ||
|
||
# FIXME: Commented out for testing. Uncomment after testing. | ||
# - name: Import aybarsm linux ansible role | ||
# ansible.builtin.import_role: | ||
# name: aybarsm.linux.ansible | ||
|
||
# FIXME: Commented out for testing. Uncomment after testing. | ||
# - name: Set facts for package manager | ||
# ansible.builtin.import_tasks: | ||
# file: set_facts.yml | ||
# when: package_manager__role_enabled | default(false) | bool | ||
|
||
# FIXME: Commented out for testing. Uncomment after testing. | ||
# - name: Import DEB repository and repository key tasks (APT) | ||
# ansible.builtin.import_tasks: | ||
# file: deb.yml | ||
# when: | ||
# - package_manager__role_enabled | default(false) | bool | ||
# - ansible_os_family | default('') | lower == 'debian' | ||
|
||
# FIXME: Commented out for testing. Uncomment after testing. | ||
# - name: Check upgrade strategy once compliance | ||
# ansible.builtin.fail: | ||
# msg: "Upgrade strategy has been set to 'once' but the required conditions are not met. Please enable the role and manage local facts to use 'once' strategy." | ||
# when: | ||
# - package_manager__upgrade_strategy == 'once' | ||
# - __package_manager__upgrade_once_eligible is defined | ||
# - not __package_manager__upgrade_once_eligible | ||
|
||
# FIXME: Commented out for testing. Uncomment after testing. | ||
# - name: Import upgrade tasks | ||
# ansible.builtin.import_tasks: | ||
# file: upgrade.yml | ||
# when: | ||
# - package_manager__role_enabled | default(false) | bool | ||
# - __package_manager__upgrade_perform | ||
|
||
# FIXME: Commented out for testing. Uncomment after testing. | ||
# - name: Import DEB package tasks (APT) | ||
# ansible.builtin.import_tasks: | ||
# file: deb_packages.yml | ||
# when: | ||
# - package_manager__role_enabled | default(false) | bool | ||
# - package_manager__package_strategy | lower == 'specific' | ||
# - ansible_os_family | default('') | lower == 'debian' | ||
|
||
# FIXME: Commented out for testing. Uncomment after testing. | ||
# - name: Import common package manager tasks | ||
# ansible.builtin.import_tasks: | ||
# file: common_packages.yml | ||
# when: | ||
# - package_manager__role_enabled | default(false) | bool | ||
# - package_manager__package_strategy | lower == 'common' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
roles/package_manager/templates/etc/apk/alpine.repositories.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# {{ ansible_managed }} | ||
|
||
{% set ver_distrib_major_minor = ansible_distribution_version | regex_replace('(\\.[^.]*).*$', '\\1') %} | ||
https://dl-cdn.alpinelinux.org/alpine/v{{ ver_distrib_major_minor }}/main | ||
https://dl-cdn.alpinelinux.org/alpine/v{{ ver_distrib_major_minor }}/community |
10 changes: 10 additions & 0 deletions
10
roles/package_manager/templates/etc/apt/debian.sources.list.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# {{ ansible_managed }} | ||
|
||
deb http://deb.debian.org/debian/ {{ ansible_distribution_release | lower }} main | ||
deb-src http://deb.debian.org/debian/ {{ ansible_distribution_release | lower }} main | ||
|
||
deb http://security.debian.org/debian-security {{ ansible_distribution_release | lower }}-security main | ||
deb-src http://security.debian.org/debian-security {{ ansible_distribution_release | lower }}-security main | ||
|
||
deb http://deb.debian.org/debian/ {{ ansible_distribution_release | lower }}-updates main | ||
deb-src http://deb.debian.org/debian/ {{ ansible_distribution_release | lower }}-updates main |
27 changes: 0 additions & 27 deletions
27
roles/package_manager/templates/etc/apt/default.sources.list.j2
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
roles/package_manager/templates/etc/apt/sources.list.d/temp.disabled.list.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# {{ ansible_managed }} | ||
# This file is temproray disabled |
16 changes: 16 additions & 0 deletions
16
roles/package_manager/templates/etc/apt/ubuntu.sources.list.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# {{ ansible_managed }} | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }} main restricted universe multiverse | ||
deb-src http://archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }} main restricted universe multiverse | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }}-updates main restricted universe multiverse | ||
deb-src http://archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }}-updates main restricted universe multiverse | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }}-security main restricted universe multiverse | ||
deb-src http://archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }}-security main restricted universe multiverse | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }}-backports main restricted universe multiverse | ||
deb-src http://archive.ubuntu.com/ubuntu/ {{ ansible_distribution_release | lower }}-backports main restricted universe multiverse | ||
|
||
deb http://archive.canonical.com/ubuntu {{ ansible_distribution_release | lower }} partner | ||
deb-src http://archive.canonical.com/ubuntu {{ ansible_distribution_release | lower }} partner |
32 changes: 32 additions & 0 deletions
32
roles/package_manager/templates/etc/yum.repos.d/almalinux.almalinux-appstream.repo.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# {{ ansible_managed }} | ||
|
||
[appstream] | ||
name=AlmaLinux $releasever - AppStream | ||
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream | ||
# baseurl=https://repo.almalinux.org/almalinux/$releasever/AppStream/$basearch/os/ | ||
enabled=1 | ||
gpgcheck=1 | ||
countme=1 | ||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-{{ ansible_distribution_major_version }} | ||
metadata_expire=86400 | ||
enabled_metadata=1 | ||
|
||
[appstream-debuginfo] | ||
name=AlmaLinux $releasever - AppStream - Debug | ||
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-debug | ||
# baseurl=https://repo.almalinux.org/vault/$releasever/AppStream/debug/$basearch/ | ||
enabled=0 | ||
gpgcheck=1 | ||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-{{ ansible_distribution_major_version }} | ||
metadata_expire=86400 | ||
enabled_metadata=0 | ||
|
||
[appstream-source] | ||
name=AlmaLinux $releasever - AppStream - Source | ||
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-source | ||
# baseurl=https://repo.almalinux.org/vault/$releasever/AppStream/Source/ | ||
enabled=0 | ||
gpgcheck=1 | ||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-{{ ansible_distribution_major_version }} | ||
metadata_expire=86400 | ||
enabled_metadata=0 |
32 changes: 32 additions & 0 deletions
32
roles/package_manager/templates/etc/yum.repos.d/almalinux.almalinux-baseos.repo.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# {{ ansible_managed }} | ||
|
||
[baseos] | ||
name=AlmaLinux $releasever - BaseOS | ||
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos | ||
# baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/ | ||
enabled=1 | ||
gpgcheck=1 | ||
countme=1 | ||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-{{ ansible_distribution_major_version }} | ||
metadata_expire=86400 | ||
enabled_metadata=1 | ||
|
||
[baseos-debuginfo] | ||
name=AlmaLinux $releasever - BaseOS - Debug | ||
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-debug | ||
# baseurl=https://repo.almalinux.org/vault/$releasever/BaseOS/debug/$basearch/ | ||
enabled=0 | ||
gpgcheck=1 | ||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-{{ ansible_distribution_major_version }} | ||
metadata_expire=86400 | ||
enabled_metadata=0 | ||
|
||
[baseos-source] | ||
name=AlmaLinux $releasever - BaseOS - Source | ||
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-source | ||
# baseurl=https://repo.almalinux.org/vault/$releasever/BaseOS/Source/ | ||
enabled=0 | ||
gpgcheck=1 | ||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-{{ ansible_distribution_major_version }} | ||
metadata_expire=86400 | ||
enabled_metadata=0 |
Oops, something went wrong.