Skip to content

Commit

Permalink
Support optional gpgkey and repo_gpgcheck yum repository attributes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rjo-uk authored Sep 30, 2024
1 parent e2a83b4 commit 9dcb2e9
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/support_gpgkey_and_repo_gpgcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Support optional gpgkey and repo_gpgcheck yum repository attributes
8 changes: 8 additions & 0 deletions roles/analysis/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ local_repos_pre_leapp: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # file: local # The filename to use in /etc/yum.repos.d minus the .repo, default local.
# # state: present # Defaults to present
# - name: rhel-server-7-rpms
Expand All @@ -77,6 +78,7 @@ local_repos_pre_leapp: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # file: local # The filename to use in /etc/yum.repos.d minus the .repo, default local.
# # state: present # Defaults to present

Expand All @@ -91,12 +93,14 @@ local_repos_leapp: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# - name: rhel-8-for-x86_64-appstream-rpms
# description: Red Hat 8.8 App Stream
# baseurl: http://repo01.example.com/8.8/rhel-8-for-x86_64-baseos-rpms
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.

# For leapp_upgrade_type == "custom"
# Used to return repos to previous state after leapp analysis if necessary.
Expand All @@ -108,6 +112,7 @@ local_repos_post_analysis: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # file: local # The filename to use in /etc/yum.repos.d minus the .repo, default local.
# state: absent # Defaults to present
# - name: rhel-server-7-rpms
Expand All @@ -116,6 +121,7 @@ local_repos_post_analysis: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # file: local # The filename to use in /etc/yum.repos.d minus the .repo, default local.
# state: absent # Defaults to present
# - name: rhel-server-7-rpms
Expand All @@ -124,6 +130,7 @@ local_repos_post_analysis: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # file: local # The filename to use in /etc/yum.repos.d minus the .repo, default local.
# # state: present # Defaults to present
# - name: rhel-server-7-rpms
Expand All @@ -132,6 +139,7 @@ local_repos_post_analysis: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # file: local # The filename to use in /etc/yum.repos.d minus the .repo, default local.
# # state: present # Defaults to present

Expand Down
2 changes: 2 additions & 0 deletions roles/analysis/tasks/analysis-leapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
baseurl: "{{ item.baseurl }}"
enabled: "{{ item.enabled | default(1) }}"
gpgcheck: "{{ item.gpgcheck | default(0) }}"
gpgkey: "{{ item.gpgkey | default(omit) }}"
repo_gpgcheck: "{{ item.repo_gpgcheck | default(omit) }}"
file: /etc/leapp/files/leapp_upgrade_repositories
state: present
owner: root
Expand Down
2 changes: 2 additions & 0 deletions roles/analysis/tasks/custom-local-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
baseurl: "{{ item.baseurl }}"
enabled: "{{ item.enabled | default(1) }}"
gpgcheck: "{{ item.gpgcheck | default(0) }}"
gpgkey: "{{ item.gpgkey | default(omit) }}"
repo_gpgcheck: "{{ item.repo_gpgcheck | default(omit) }}"
file: "{{ item.file | default('local') }}"
state: "{{ item.state | default('present') }}"
owner: root
Expand Down
6 changes: 6 additions & 0 deletions roles/upgrade/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ local_repos_pre_leapp: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # file: local # The filename to use in /etc/yum.repos.d minus the .repo, default local.
# # state: present # Defaults to present
# - name: rhel-server-7-rpms
Expand All @@ -37,6 +38,7 @@ local_repos_pre_leapp: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # file: local # The filename to use in /etc/yum.repos.d minus the .repo, default local.
# # state: present # Defaults to present

Expand All @@ -50,6 +52,7 @@ local_repos_leapp: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # Can include file in this data structure to reuse this for local_repos_post_upgrade.
# # file: local # Will be ignored for leapp_upgrade_repositories.repo
# # state: present # Defaults to present.
Expand All @@ -59,6 +62,7 @@ local_repos_leapp: []
# # enabled: 1 # Default 1
# # gpgcheck: 0 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # Can include file in this data structure to reuse this for local_repos_post_upgrade.
# # file: local # Will be ignored for leapp_upgrade_repositories.repo
# # state: present # Defaults to present.
Expand All @@ -82,6 +86,7 @@ local_repos_post_upgrade: []
# # enabled: 0 # Default 1
# # gpgcheck: 1 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # state: present # Defaults to present.
# - name: rhel-8-for-x86_64-appstream-rpms
# description: Red Hat 8 App Stream
Expand All @@ -90,6 +95,7 @@ local_repos_post_upgrade: []
# # enabled: 0 # Default 1
# # gpgcheck: 1 # Default 0
# # gpgkey: XXX # Default omit.
# # repo_gpgcheck: 0 # Default omit.
# # state: present # Defaults to present.

# Desired selinux mode post Leapp upgrade.
Expand Down
2 changes: 2 additions & 0 deletions roles/upgrade/tasks/custom-local-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
baseurl: "{{ item.baseurl }}"
enabled: "{{ item.enabled | default(1) }}"
gpgcheck: "{{ item.gpgcheck | default(0) }}"
gpgkey: "{{ item.gpgkey | default(omit) }}"
repo_gpgcheck: "{{ item.repo_gpgcheck | default(omit) }}"
file: "{{ item.file | default('local') }}"
state: "{{ item.state | default('present') }}"
owner: root
Expand Down
2 changes: 2 additions & 0 deletions roles/upgrade/tasks/leapp-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
baseurl: "{{ item.baseurl }}"
enabled: "{{ item.enabled | default(1) }}"
gpgcheck: "{{ item.gpgcheck | default(0) }}"
gpgkey: "{{ item.gpgkey | default(omit) }}"
repo_gpgcheck: "{{ item.repo_gpgcheck | default(omit) }}"
file: /etc/leapp/files/leapp_upgrade_repositories
owner: root
group: root
Expand Down

0 comments on commit 9dcb2e9

Please sign in to comment.