From aeb0bea30d67f4c25d6d5fd4fa6ff541bd5562b1 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Tue, 29 Apr 2025 13:22:59 -0400 Subject: [PATCH 1/2] Use the `apt_repository` module on Debian systems Instead of using the `copy` module to create the SourceList file we instead use the `apt_repository` module. --- tasks/setup_Debian.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tasks/setup_Debian.yml b/tasks/setup_Debian.yml index d5ed4f9..6e7026c 100644 --- a/tasks/setup_Debian.yml +++ b/tasks/setup_Debian.yml @@ -25,10 +25,9 @@ executable: /bin/bash - name: Add the Okta ASA repo - ansible.builtin.copy: - content: >- + ansible.builtin.apt_repository: + filename: oktapam-stable + repo: >- deb [signed-by=/usr/share/keyrings/oktapam-2023-archive-keyring.gpg] https://dist.scaleft.com/repos/deb {{ ansible_distribution_release }} okta - dest: /etc/apt/sources.list.d/oktapam-stable.list - mode: u=rw,g=,o= From 9e5a813cd7fa5db9dd4a21f0251a1b92dcb81962 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Tue, 29 Apr 2025 13:27:27 -0400 Subject: [PATCH 2/2] Use the `yum_repository` module on RedHat systems Instead of using the `copy` module to create the repository file we instead use the `yum_repository` module. --- tasks/setup_RedHat.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tasks/setup_RedHat.yml b/tasks/setup_RedHat.yml index 3cc4433..1683b07 100644 --- a/tasks/setup_RedHat.yml +++ b/tasks/setup_RedHat.yml @@ -17,21 +17,17 @@ ternary(ansible_distribution + 'Linux', ansible_distribution) }} - name: Add the Okta ASA repo - ansible.builtin.copy: - # yamllint complains about the length of a few of the lines below, + ansible.builtin.yum_repository: + # yamllint complains about the length of a couple of the lines below, # but there is no way to shorten them. # # yamllint disable rule:line-length - content: | - [oktapam-stable] - name=Okta PAM Stable - {{ ansible_distribution_tweaked }} {{ ansible_distribution_major_version }} - baseurl=https://dist.scaleft.com/repos/rpm/stable/{{ ansible_distribution_tweaked | lower }}/{{ ansible_distribution_major_version }}/$basearch - gpgcheck=1 - repo_gpgcheck=1 - enabled=1 - gpgkey=https://dist.scaleft.com/GPG-KEY-OktaPAM-2023 + baseurl: https://dist.scaleft.com/repos/rpm/stable/{{ ansible_distribution_tweaked | lower }}/{{ ansible_distribution_major_version }}/$basearch + description: Okta PAM Stable - {{ ansible_distribution_tweaked }} {{ ansible_distribution_major_version }} # Re-enable the line-length yamllint rule. # # yamllint enable rule:line-length - dest: /etc/yum.repos.d/oktapam-stable.repo - mode: u=rw,g=,o= + gpgcheck: true + gpgkey: https://dist.scaleft.com/GPG-KEY-OktaPAM-2023 + name: oktapam-stable + repo_gpgcheck: true