From 0215a031a3e68e6f92e3483567d372c4a1104297 Mon Sep 17 00:00:00 2001 From: EmptyByte Date: Thu, 13 Jun 2024 19:23:59 +0200 Subject: [PATCH] update meta to include RHEL9 and Ubuntu Noble. Fixed issue with install repositories. --- .../platform/roles/artifactory_nginx/meta/main.yml | 4 +++- .../artifactory_nginx/tasks/config/default.yml | 2 +- .../roles/artifactory_nginx/tasks/install/dnf.yml | 4 ++-- .../roles/artifactory_nginx/tasks/install/yum.yml | 4 ++-- .../roles/artifactory_nginx/tasks/repos/debian.yml | 4 ++-- .../roles/artifactory_nginx/tasks/repos/redhat.yml | 4 ++-- .../roles/artifactory_nginx/vars/redhat.yml | 13 +++++++------ 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/meta/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/meta/main.yml index f6e3295e..3bb0bb7e 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/meta/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/meta/main.yml @@ -11,13 +11,15 @@ galaxy_info: platforms: - name: EL versions: - - 7 + - 7 - 8 + - 9 - name: Ubuntu versions: - bionic - focal - jammy + - noble - name: Debian versions: - buster diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/config/default.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/config/default.yml index d4de68d7..63d364a6 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/config/default.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/config/default.yml @@ -29,7 +29,7 @@ mode: "{{ template_nginx_artifactory.mode }}" notify: Restart Nginx -- name: Ensure nginx dir exists +- name: Ensure Nginx dir exists become: true ansible.builtin.file: path: '/var/opt/jfrog/nginx/ssl' diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/install/dnf.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/install/dnf.yml index 43df0e95..1764b408 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/install/dnf.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/install/dnf.yml @@ -3,6 +3,6 @@ ansible.builtin.dnf: name: "{{ nginx_packages }}" state: present - disablerepo: "{{ '*' if nginx_setup_repos or not nginx_system_repositories else omit }}" - enablerepo: "{{ nginx_system_repositories if nginx_setup_repos or not nginx_system_repositories else omit }}" + disablerepo: "{{ '*' if nginx_system_repositories is defined and nginx_system_repositories | length > 0 else omit }}" + enablerepo: "{{ nginx_system_repositories if nginx_system_repositories is defined and nginx_system_repositories | length > 0 else omit }}" become: true diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/install/yum.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/install/yum.yml index cb82dc9b..82e468d8 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/install/yum.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/install/yum.yml @@ -3,6 +3,6 @@ ansible.builtin.yum: name: "{{ nginx_packages }}" state: present - disablerepo: "{{ '*' if nginx_setup_repos or not nginx_system_repositories else omit }}" - enablerepo: "{{ nginx_system_repositories if nginx_setup_repos or not nginx_system_repositories else omit }}" + disablerepo: "{{ '*' if nginx_system_repositories is defined and nginx_system_repositories | length > 0 else omit }}" + enablerepo: "{{ nginx_system_repositories if nginx_system_repositories is defined and nginx_system_repositories | length > 0 else omit }}" become: true diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/repos/debian.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/repos/debian.yml index ac1f68cf..b50290da 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/repos/debian.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/repos/debian.yml @@ -1,11 +1,11 @@ --- -- name: Import nginx signing key +- name: Import Nginx signing key ansible.builtin.apt_key: url: "{{ nginx_repo_signing_key }}" state: present become: true -- name: Add nginx stable repo +- name: Add Nginx stable repo ansible.builtin.apt_repository: repo: "deb {{ nginx_official_repo_url }} {{ ansible_facts['ansible_distribution_release'] | lower }} nginx" filename: "{{ nginx_official_repo_filename }}" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/repos/redhat.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/repos/redhat.yml index 5f6839ac..45258e27 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/repos/redhat.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/tasks/repos/redhat.yml @@ -1,11 +1,11 @@ --- -- name: Import nginx signing key +- name: Import Nginx signing key ansible.builtin.rpm_key: key: "{{ nginx_official_repo_signing_key }}" state: present become: true -- name: Add nginx stable repo +- name: Add Nginx stable repo ansible.builtin.yum_repository: name: "{{ nginx_official_repo_filename }}" description: "{{ nginx_official_repo_description }}" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/vars/redhat.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/vars/redhat.yml index 0f1b4a1f..437bf4e3 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/vars/redhat.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx/vars/redhat.yml @@ -4,12 +4,13 @@ nginx_packages: nginx_system_daemon: nginx -nginx_system_repositories: "{% if ansible_facts['distribution'] | lower == 'redhat' %}\ - ['rhel-{{ ansible_facts['distribution_major_version'] }}-for-x86_64-baseos-rpms',\ - 'rhel-{{ ansible_facts['distribution_major_version'] }}-for-x86_64-appstream-rpms']\ - {% else %}\ - []\ - {% endif %}" +nginx_system_repositories: >- + {%- if ansible_facts['distribution'] | lower == 'redhat' -%} + ['rhel-{{ ansible_facts['distribution_major_version'] }}-for-x86_64-baseos-rpms', + 'rhel-{{ ansible_facts['distribution_major_version'] }}-for-x86_64-appstream-rpms'] + {%- else -%} + [] + {%- endif -%} ########################### ## CERTIFICATES ##