-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make rpm_packaging playbook runnable against RHEL9 targets (#1872)
- Loading branch information
1 parent
fddb3ce
commit 1726f4f
Showing
8 changed files
with
82 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,3 @@ | ||
--- | ||
- hosts: all | ||
tasks: | ||
- name: Install dependencies for packaging tooling | ||
yum: | ||
name: "{{ package_list }}" | ||
state: present | ||
vars: | ||
package_list: | ||
- git-core | ||
- git-annex | ||
- rubygem-nokogiri | ||
- rpmspectool | ||
- rubygem-gem2rpm | ||
- make | ||
- gcc | ||
- redhat-rpm-config | ||
- ruby-devel | ||
- curl-devel | ||
- gem | ||
- python3-ruamel-yaml | ||
- tito | ||
- mock | ||
- jq | ||
- python3-pip | ||
- wget | ||
- vim | ||
- python3-semver | ||
become: true | ||
|
||
- name: Install obal | ||
pip: | ||
name: obal | ||
state: present | ||
executable: pip3 | ||
become: true | ||
|
||
- name: Clone foreman-packaging | ||
git: | ||
repo: https://github.com/theforeman/foreman-packaging.git | ||
dest: /home/vagrant/foreman-packaging | ||
version: rpm/develop | ||
|
||
- name: Add vagrant user to mock group | ||
user: | ||
name: vagrant | ||
groups: mock | ||
append: true | ||
become: true | ||
... | ||
roles: | ||
- rpm_packaging |
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,5 +1,5 @@ | ||
--- | ||
epel_repositories_state: present | ||
epel_repositories_flavor: "{{ 'epel-next-release' if ansible_distribution_major_version == '9' else 'epel-release' }}" | ||
epel_repositories_flavor: "{{ 'epel-next-release' if ansible_distribution_major_version == '9' and ansible_distribution == 'CentOS' else 'epel-release' }}" | ||
epel_repositories_url: https://dl.fedoraproject.org/pub/epel/{{ epel_repositories_flavor }}-latest-{{ ansible_distribution_major_version }}.noarch.rpm | ||
epel_repositories_name: "{{ epel_repositories_url if (epel_repositories_state == 'present' and ansible_distribution == 'RedHat') else epel_repositories_flavor }}" |
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 @@ | ||
git_annex_package: "{{ 'git-annex-standalone' if ansible_distribution == 'RedHat' else 'git-annex' }}" |
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,17 @@ | ||
- name: Set up EPEL | ||
include_role: | ||
name: epel_repositories | ||
when: ansible_distribution != 'RedHat' | ||
|
||
- name: Set up git-annex repository | ||
yum_repository: | ||
name: git-annex | ||
description: git-annex | ||
baseurl: https://downloads.kitenet.net/git-annex/linux/current/rpms/ | ||
gpgcheck: false | ||
when: ansible_distribution == 'RedHat' | ||
|
||
- name: Install git-annex | ||
yum: | ||
name: "{{ git_annex_package }}" | ||
state: present |
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 @@ | ||
rpm_packaging_user: vagrant |
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,4 @@ | ||
--- | ||
dependencies: | ||
- role: git-annex | ||
- role: epel_repositories |
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 @@ | ||
Requirements: | ||
- `community.general.gem` ansible collection |
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,54 @@ | ||
--- | ||
- name: Install dependencies for packaging tooling | ||
yum: | ||
name: "{{ package_list }}" | ||
state: present | ||
vars: | ||
package_list: | ||
- git-core | ||
- rubygem-nokogiri | ||
- make | ||
- gcc | ||
- redhat-rpm-config | ||
- ruby-devel | ||
- curl-devel | ||
- gem | ||
- python3-ruamel-yaml | ||
- tito | ||
- mock | ||
- jq | ||
- python3-pip | ||
- wget | ||
- vim | ||
- python3-semver | ||
become: true | ||
|
||
- name: Install obal and rpmspectool | ||
pip: | ||
name: "{{ item }}" | ||
state: present | ||
executable: pip3 | ||
with_items: | ||
- obal | ||
- rpmspectool | ||
become: true | ||
|
||
- name: Install gem2rpm | ||
gem: | ||
name: gem2rpm | ||
state: present | ||
user_install: false | ||
become: true | ||
|
||
- name: Clone foreman-packaging | ||
git: | ||
repo: https://github.com/theforeman/foreman-packaging.git | ||
dest: "/home/{{ rpm_packaging_user }}/foreman-packaging" | ||
version: rpm/develop | ||
|
||
- name: Add {{ rpm_packaging_user }} user to mock group | ||
user: | ||
name: "{{ rpm_packaging_user }}" | ||
groups: mock | ||
append: true | ||
become: true |