From 9c3305a136b03649580875acae418d66b6b2c044 Mon Sep 17 00:00:00 2001 From: RobinDuhan <52245137+RobinDuhan@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:36:27 +0530 Subject: [PATCH] [ansible] JFrog Platform 11.0.1 release --- .../jfrog/platform/CHANGELOG.md | 4 +++ .../jfrog/platform/galaxy.yml | 2 +- .../roles/artifactory/defaults/main.yml | 2 +- .../platform/roles/artifactory/vars/main.yml | 2 +- .../roles/distribution/defaults/main.yml | 2 +- .../roles/distribution/tasks/expect.yml | 4 +-- .../roles/distribution/tasks/install.yml | 7 ++-- .../platform/roles/distribution/vars/main.yml | 2 +- .../distribution/vars/script/archive.yml | 2 +- .../platform/roles/xray/defaults/main.yml | 6 ++-- .../platform/roles/xray/handlers/main.yml | 10 +++--- .../platform/roles/xray/tasks/expect.yml | 6 ++-- .../platform/roles/xray/tasks/install.yml | 36 ++++++------------- .../platform/roles/xray/tasks/upgrade.yml | 7 ++-- .../jfrog/platform/roles/xray/vars/main.yml | 2 +- .../roles/xray/vars/script/archive.yml | 4 +++ 16 files changed, 46 insertions(+), 52 deletions(-) diff --git a/Ansible/ansible_collections/jfrog/platform/CHANGELOG.md b/Ansible/ansible_collections/jfrog/platform/CHANGELOG.md index da811df6..1f19d4a9 100644 --- a/Ansible/ansible_collections/jfrog/platform/CHANGELOG.md +++ b/Ansible/ansible_collections/jfrog/platform/CHANGELOG.md @@ -1,6 +1,10 @@ # JFrog Platform Ansible Collection Changelog All changes to this collection will be documented in this file. +## [11.0.1] - Feb 12, 2025 +* Fixed an issue with running install.sh for Xray and Distribution. [GH-424](https://github.com/jfrog/JFrog-Cloud-Installers/issues/424) +* Product Updates/fixes + ## [11.0.0] - Jan 30, 2025 * Insight role has been removed. Use the 10.x version of the platform collection for installation and upgrades. * Artifactory - Added ability to generate bootstrap admin token for artifactory [GH-432](https://github.com/jfrog/JFrog-Cloud-Installers/pull/432) diff --git a/Ansible/ansible_collections/jfrog/platform/galaxy.yml b/Ansible/ansible_collections/jfrog/platform/galaxy.yml index 22bc9590..dfe3215e 100644 --- a/Ansible/ansible_collections/jfrog/platform/galaxy.yml +++ b/Ansible/ansible_collections/jfrog/platform/galaxy.yml @@ -9,7 +9,7 @@ namespace: "jfrog" name: "platform" # The version of the collection. Must be compatible with semantic versioning -version: "11.0.0" +version: "11.0.1" # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: "README.md" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/defaults/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/defaults/main.yml index e83169c8..356e64d4 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/defaults/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/defaults/main.yml @@ -1,7 +1,7 @@ # Defaults file for artifactory # The version of artifactory to install -artifactory_version: 7.104.5 +artifactory_version: 7.104.7 # Set this to true when SSL is enabled (to use artifactory_nginx_ssl role), default to false (implies artifactory uses artifactory_nginx role ) artifactory_nginx_ssl_enabled: false diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/vars/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/vars/main.yml index cd975bbe..b6ae4d9f 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/vars/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/vars/main.yml @@ -1,5 +1,5 @@ # platform collection version -platform_collection_version: 11.0.0 +platform_collection_version: 11.0.1 # indicates where this collection was downloaded from (galaxy, automation_hub, standalone) ansible_marketplace: galaxy diff --git a/Ansible/ansible_collections/jfrog/platform/roles/distribution/defaults/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/distribution/defaults/main.yml index 603f1751..147f540f 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/defaults/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/defaults/main.yml @@ -1,7 +1,7 @@ # defaults file for distribution # The version of distribution to install -distribution_version: 2.28.1 +distribution_version: 2.28.2 # whether to enable HA distribution_ha_enabled: false diff --git a/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/expect.yml b/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/expect.yml index 01fd68ca..d29801c4 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/expect.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/expect.yml @@ -11,7 +11,7 @@ expect { {% for each_request in exp_scenarios %} -nocase -re {{ '{' }}{{ each_request.expecting }}.*} { - send "{{ each_request.sending }}\n" + send "{{ each_request.sending | replace('"', '') | trim }}\n" } {% endfor %} eof { @@ -19,7 +19,7 @@ } } set count "[expr $count + 1]" - if { $count > 16} { + if { $count > 16 } { exit 128 } } diff --git a/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/install.yml b/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/install.yml index f7e044cb..e022ac1c 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/install.yml @@ -118,6 +118,7 @@ apply: environment: YQ_PATH: "{{ distribution_thirdparty_path }}/yq" + register: distribution_install_flag when: install_wrapper_script.stat.exists - name: Configure redis config @@ -143,7 +144,7 @@ when: - distribution_systemyaml is defined - distribution_systemyaml | length > 0 - - distribution_systemyaml_override or (not systemyaml.stat.exists) + - distribution_systemyaml_override or (not systemyaml.stat.exists) or (distribution_install_flag is succeeded ) notify: Restart distribution - name: Configure installer info @@ -181,6 +182,6 @@ status_code: 200 register: result until: result is succeeded - retries: 25 - delay: 5 + retries: 40 + delay: 10 when: not ansible_check_mode diff --git a/Ansible/ansible_collections/jfrog/platform/roles/distribution/vars/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/distribution/vars/main.yml index 5b0ccf45..a93aca0d 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/vars/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/vars/main.yml @@ -1,5 +1,5 @@ # platform collection version -platform_collection_version: 11.0.0 +platform_collection_version: 11.0.1 # indicates were this collection was downlaoded from (galaxy, automation_hub, standalone) ansible_marketplace: galaxy diff --git a/Ansible/ansible_collections/jfrog/platform/roles/distribution/vars/script/archive.yml b/Ansible/ansible_collections/jfrog/platform/roles/distribution/vars/script/archive.yml index 789632a2..d4647d7c 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/vars/script/archive.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/vars/script/archive.yml @@ -9,7 +9,7 @@ distribution_installer_scenario: "sending": "{{ join_key }}" } - { - "expecting": "jfrog url:", + "expecting": "jfrog url( \\[.+)?:(?!.*Skipping prompt)", "sending": "{{ jfrog_url }}" } - { diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/defaults/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/defaults/main.yml index 274eaf16..b14b5eeb 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/defaults/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/defaults/main.yml @@ -1,7 +1,7 @@ # Defaults file for xray # The version of xray to install -xray_version: 3.111.9 +xray_version: 3.111.13 # Whether to enable HA xray_ha_enabled: false @@ -24,7 +24,7 @@ xray_home: "{{ jfrog_home_directory }}/xray" xray_install_script_path: "{{ xray_home }}/app/bin" xray_thirdparty_path: "{{ xray_home }}/app/third-party" -xray_archive_service_cmd: "{{ xray_install_script_path }}/install.sh" +xray_archive_service_cmd: "{{ xray_install_script_path }}/installService.sh" xray_service_file: /lib/systemd/system/xray.service # Xray users and groups @@ -102,7 +102,7 @@ xray_systemyaml: |- value: "{{ xray_rabbitmq_default_cookie }}" url: "{{ xray_rabbitmq_url }}" username: "{{ xray_rabbitmq_user }}" - password: "{{xray_rabbitmq_password }}" + password: "{{ xray_rabbitmq_password }}" security: joinKey: {{ join_key }} router: diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/handlers/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/handlers/main.yml index 923c56ba..f9ef066f 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/handlers/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/handlers/main.yml @@ -2,12 +2,14 @@ # handlers file for xray - name: Restart xray become: true - become_user: xray - ansible.builtin.command: "{{ xray_home }}/app/bin/xray.sh restart" + ansible.builtin.systemd: + name: "{{ xray_daemon }}" + state: restarted when: - xray_start_service | bool - name: Stop xray become: true - become_user: xray - ansible.builtin.command: "{{ xray_home }}/app/bin/xray.sh stop" + ansible.builtin.systemd: + name: "{{ xray_daemon }}" + state: stopped diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/expect.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/expect.yml index 54f70f57..4a52a38e 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/expect.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/expect.yml @@ -10,8 +10,8 @@ while { $CYCLE_END == 0 } { expect { {% for each_request in exp_scenarios %} - -nocase -re {{ '{' }}{{ each_request.expecting }}.*{{ '}' }} { - send "{{ each_request.sending }}\n" + -nocase -re {{ '{' }}{{ each_request.expecting }}.*} { + send "{{ each_request.sending | replace('"', '') | trim }}\n" } {% endfor %} eof { @@ -19,7 +19,7 @@ } } set count "[expr $count + 1]" - if { $count > 16 } { + if { $count > 16} { exit 128 } } diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/install.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/install.yml index 1baad33c..7cc00d4e 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/install.yml @@ -125,6 +125,7 @@ apply: environment: YQ_PATH: "{{ xray_thirdparty_path }}/yq" + register: xray_install_flag when: install_wrapper_script.stat.exists - name: Configure rabbitmq config @@ -158,7 +159,7 @@ when: - xray_systemyaml is defined - xray_systemyaml | length > 0 - - xray_systemyaml_override or (not systemyaml.stat.exists) + - xray_systemyaml_override or (not systemyaml.stat.exists) or (xray_install_flag is succeeded ) notify: Restart xray - name: Ensure permissions are correct @@ -170,33 +171,16 @@ group: "{{ xray_group }}" recurse: true -- name: Include interactive installer scripts - ansible.builtin.include_vars: script/archive.yml - -- name: Install xray - ansible.builtin.include_tasks: expect.yml - vars: - exp_executable_cmd: "./install.sh -u {{ xray_user }} -g {{ xray_group }}" - exp_dir: "{{ xray_install_script_path }}" - exp_scenarios: "{{ xray_installer_scenario['main'] }}" - args: - apply: - environment: - YQ_PATH: "{{ xray_thirdparty_path }}/yq" - when: install_wrapper_script.stat.exists - -- name: Ensure /opt/jfrog/xray directory has correct ownership +- name: Install xray as a service become: true - ansible.builtin.file: - path: "{{ xray_home }}" - owner: xray - group: xray - recurse: yes + ansible.builtin.command: "{{ xray_archive_service_cmd }}" + args: + chdir: "{{ xray_install_script_path }}" + creates: "{{ xray_service_file }}" + register: check_service_status_result -- name: Restart Xray - become: true - become_user: xray - ansible.builtin.command: "{{ xray_home }}/app/bin/xray.sh start" +- name: Restart xray + ansible.builtin.meta: flush_handlers when: - xray_start_service | bool diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/upgrade.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/upgrade.yml index 05405561..dc0a9bf2 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/upgrade.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/upgrade.yml @@ -72,6 +72,7 @@ apply: environment: YQ_PATH: "{{ xray_thirdparty_path }}/yq" + register: xray_install_flag when: - install_wrapper_script.stat.exists - download_xray.changed @@ -101,7 +102,7 @@ when: - xray_systemyaml is defined - xray_systemyaml | length > 0 - - xray_systemyaml_override or (not systemyaml.stat.exists) + - xray_systemyaml_override or (not systemyaml.stat.exists) or (xray_install_flag is succeeded ) notify: Restart xray - name: Configure installer info @@ -136,9 +137,7 @@ when: xray_allow_crontab - name: Restart xray - become: true - become_user: xray - ansible.builtin.command: "{{ xray_home }}/app/bin/xray.sh restart" + ansible.builtin.meta: flush_handlers when: - xray_start_service | bool diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/vars/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/vars/main.yml index 5b0ccf45..a93aca0d 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/vars/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/vars/main.yml @@ -1,5 +1,5 @@ # platform collection version -platform_collection_version: 11.0.0 +platform_collection_version: 11.0.1 # indicates were this collection was downlaoded from (galaxy, automation_hub, standalone) ansible_marketplace: galaxy diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/vars/script/archive.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/vars/script/archive.yml index 8102d7ff..749ba6cb 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/vars/script/archive.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/vars/script/archive.yml @@ -16,6 +16,10 @@ xray_installer_scenario: "expecting": "please specify the ip address of this machine(?!.*Skipping prompt)", "sending": "{{ ansible_host }}" } + - { + "expecting": "do you want to continue", + "sending": "y" + } - { "expecting": "are you adding an additional node", "sending": "{% if xray_ha_node_type is defined and xray_ha_node_type == 'master' %}n{% else %}y{% endif %}"