Skip to content

Commit

Permalink
support for RockyLinux on old Ansible releases
Browse files Browse the repository at this point in the history
Starting from Ansible 2.11, ansible_os_family fallback to RedHat for RockyLinux
See: ansible/ansible#74530
  • Loading branch information
nqb committed Feb 1, 2022
1 parent 9e212bf commit fa6f27f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.3] - 2022-02-01
### Added
- Support for RockyLinux on old Ansible releases

## [1.3.2] - 2021-10-18
### Added
- Allow to override state of packages
Expand Down
37 changes: 37 additions & 0 deletions tasks/rocky.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
- name: install dependencies to install packages from repos
yum:
name: "{{ gitlab_buildpkg_tools__rpm_deps_pkgs }}"
state: "{{ gitlab_buildpkg_tools__rpm_deps_pkgs_state }}"

- name: add public keys
rpm_key:
key: "{{ item }}"
state: present
loop: "{{ gitlab_buildpkg_tools__rpm_combined_keys }}"

- name: install repos
template:
src: 'yum.repo.j2'
dest: "/etc/yum.repos.d/{{ item['name'] }}.repo"
mode: 0644
owner: 'root'
group: 'root'
loop: "{{ gitlab_buildpkg_tools__rpm_combined_repos }}"
loop_control:
label: "{{ item['name'] }}"

- name: enable or disable repos
ini_file:
path: "/etc/yum.repos.d/{{ item['name'] }}"
section: "{{ item['id'] }}"
option: 'enabled'
value: "{{ item['enabled'] }}"
loop: "{{ gitlab_buildpkg_tools__rpm_enabled_repos }}"

# update_cache to take new key(s) and repo(s) into account
- name: install packages from RPM repos
yum:
name: "{{ gitlab_buildpkg_tools__rpm_pkgs }}"
update_cache: yes
state: "{{ gitlab_buildpkg_tools__rpm_pkgs_state }}"

0 comments on commit fa6f27f

Please sign in to comment.