diff --git a/Ansible/ansible_collections/jfrog/platform/CHANGELOG.md b/Ansible/ansible_collections/jfrog/platform/CHANGELOG.md index a1363fe..33cef25 100644 --- a/Ansible/ansible_collections/jfrog/platform/CHANGELOG.md +++ b/Ansible/ansible_collections/jfrog/platform/CHANGELOG.md @@ -1,11 +1,17 @@ # JFrog Platform Ansible Collection Changelog All changes to this collection will be documented in this file. +## [7.25.7] - Sep 16, 2021 +* Bug Fixes + ## [7.24.3] - Aug 17, 2021 * Added required variables check when using `artifactory_nginx_ssl` role * Missioncontrol's Elasticsearch to use default ES JAVA_HOME * Bug Fixes +## [7.23.4] - Aug 9, 2021 +* Missioncontrol's Elasticsearch to use default ES JAVA_HOME + ## [7.23.3] - Aug 5, 2021 * Missioncontrol's Elasticsearch to use new JAVA_HOME path * Missioncontrol's Elasticsearch searchguard plugin to use by default `anonymous_auth_enabled: true` diff --git a/Ansible/ansible_collections/jfrog/platform/galaxy.yml b/Ansible/ansible_collections/jfrog/platform/galaxy.yml index 6534da9..5b2710e 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: "7.24.3" +version: "7.25.7" # 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/group_vars/all/vars.yml b/Ansible/ansible_collections/jfrog/platform/group_vars/all/vars.yml index 465204d..8f55e3a 100755 --- a/Ansible/ansible_collections/jfrog/platform/group_vars/all/vars.yml +++ b/Ansible/ansible_collections/jfrog/platform/group_vars/all/vars.yml @@ -5,9 +5,7 @@ master_key: ee69d96880726d3abf6b42b97d2ae589111ea95c2a8bd5876ec5cd9e8ee34f86 join_key: 83da88eaaa08dfed5b86888fcec85f19ace0c3ff8747bcefcec2c9769ad4043d jfrog_url: >- - {%- for host in groups['artifactory_servers'] -%} - "http://{{ hostvars[host]['ansible_host'] }}:8082" - {%- endfor -%} + "http://{{ hostvars[groups['artifactory_servers'][0]]['ansible_host'] }}:8082" ## Products enabled artifactory_enabled: true @@ -23,9 +21,7 @@ artifactory_db_name: artifactory artifactory_db_user: artifactory artifactory_db_password: password artifactory_db_url: >- - {%- for item in groups['postgres_servers'] -%} - jdbc:postgresql://{{ hostvars[item]['ansible_host'] }}:5432/{{ artifactory_db_name }} - {%- endfor -%} + jdbc:postgresql://{{ hostvars[groups['postgres_servers'][0]]['ansible_host'] }}:5432/{{ artifactory_db_name }} # Xray DB details xray_db_type: postgresql @@ -34,9 +30,7 @@ xray_db_name: xray xray_db_user: xray xray_db_password: password xray_db_url: >- - {%- for item in groups['postgres_servers'] -%} - postgres://{{ hostvars[item]['ansible_host'] }}:5432/{{ xray_db_name }}?sslmode=disable - {%- endfor -%} + postgres://{{ hostvars[groups['postgres_servers'][0]]['ansible_host'] }}:5432/{{ xray_db_name }}?sslmode=disable # Distribution DB details distribution_db_type: postgresql @@ -45,9 +39,7 @@ distribution_db_name: distribution distribution_db_user: distribution distribution_db_password: password distribution_db_url: >- - {%- for item in groups['postgres_servers'] -%} - jdbc:postgresql://{{ hostvars[item]['ansible_host'] }}:5432/{{ distribution_db_name }}?sslmode=disable - {%- endfor -%} + jdbc:postgresql://{{ hostvars[groups['postgres_servers'][0]]['ansible_host'] }}:5432/{{ distribution_db_name }}?sslmode=disable # MissionControl DB details mc_db_type: postgresql @@ -56,9 +48,7 @@ mc_db_name: mc mc_db_user: mc mc_db_password: password mc_db_url: >- - {%- for item in groups['postgres_servers'] -%} - jdbc:postgresql://{{ hostvars[item]['ansible_host'] }}:5432/{{ mc_db_name }}?sslmode=disable - {%- endfor -%} + jdbc:postgresql://{{ hostvars[groups['postgres_servers'][0]]['ansible_host'] }}:5432/{{ mc_db_name }}?sslmode=disable # Postgresql users and databases/schemas db_users: 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 b756dfc..42a09d6 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.24.3 +artifactory_version: 7.25.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 @@ -13,7 +13,7 @@ artifactory_nginx_enabled: true # artifactory_single_license: # Provide individual (HA) licenses file separated by new line and 2-space indentation and set artifactory_ha_enabled: true. -# Example: +# Example: Replace , , with original licenses # artifactory_licenses: |- # @@ -25,7 +25,7 @@ artifactory_nginx_enabled: true artifactory_ha_enabled: false # By default, all nodes are primary (CNHA) - https://www.jfrog.com/confluence/display/JFROG/High+Availability#HighAvailability-Cloud-NativeHighAvailability -artifactory_taskAffinity: any +artifactory_taskaffinity: any # The location where Artifactory should install jfrog_home_directory: /opt/jfrog @@ -80,7 +80,7 @@ artifactory_systemyaml: |- node: id: {{ ansible_hostname }} ip: {{ ansible_host }} - taskAffinity: {{ artifactory_taskAffinity }} + taskAffinity: {{ artifactory_taskaffinity }} haEnabled: {{ artifactory_ha_enabled }} database: type: "{{ artifactory_db_type }}" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/handlers/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/handlers/main.yml index 4cd96cc..5898c53 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/handlers/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/handlers/main.yml @@ -5,3 +5,9 @@ systemd: name: "{{ artifactory_daemon }}" state: restarted + +- name: stop artifactory + become: yes + systemd: + name: "{{ artifactory_daemon }}" + state: stopped \ No newline at end of file diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/meta/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/meta/main.yml index 76ebd4b..f01b654 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/meta/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/meta/main.yml @@ -1,16 +1,27 @@ +--- +dependencies: [] + galaxy_info: author: "JFrog Maintainers Team " description: "The artifactory role installs the Artifactory Pro software onto the host." company: JFrog - issue_tracker_url: "https://github.com/jfrog/JFrog-Cloud-Installers/issues" - license: license (Apache-2.0) - min_ansible_version: 2.9 - + platforms: + - name: EL + versions: + - 7 + - 8 + - name: Ubuntu + versions: + - xenial + - bionic + - focal + - name: Debian + versions: + - stretch + - buster galaxy_tags: - artifactory - - jfrog - -dependencies: [] \ No newline at end of file + - jfrog \ No newline at end of file diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/install.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/install.yml index c9c5b1f..8967bf3 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/install.yml @@ -1,6 +1,3 @@ -- debug: - msg: "Performing installation of Artifactory version : {{ artifactory_version }} " - - name: Install prerequisite packages include_tasks: "{{ ansible_os_family }}.yml" @@ -70,7 +67,10 @@ - name: Copy untar directory to artifactory home become: yes - command: "cp -r {{ artifactory_untar_home }}/. {{ artifactory_home }}" + copy: + src: "{{ artifactory_untar_home }}/" + dest: "{{ artifactory_home }}" + remote_src: yes when: not app_dir_check.stat.exists - name: Create required directories @@ -87,21 +87,22 @@ - "{{ artifactory_home }}/var/etc/security/" - "{{ artifactory_home }}/var/etc/artifactory/info/" -- name: Check if systemyaml exists +- name: Check if system.yaml exists become: yes stat: path: "{{ artifactory_home }}/var/etc/system.yaml" register: systemyaml -- name: Configure systemyaml +- name: Configure system.yaml become: yes template: src: "{{ artifactory_system_yaml_template }}" dest: "{{ artifactory_home }}/var/etc/system.yaml" + mode: 0644 when: - artifactory_systemyaml is defined - artifactory_systemyaml|length > 0 - - artifactory_systemyaml_override or (not systemyaml.stat.exists) + - artifactory_systemyaml_override or (not systemyaml.stat.exists) notify: restart artifactory - name: Configure master key @@ -118,6 +119,7 @@ template: src: installer-info.json.j2 dest: "{{ artifactory_home }}/var/etc/artifactory/info/installer-info.json" + mode: 0644 notify: restart artifactory - name: Configure binary store @@ -125,6 +127,7 @@ template: src: binarystore.xml.j2 dest: "{{ artifactory_home }}/var/etc/artifactory/binarystore.xml" + mode: 0644 when: - artifactory_binarystore is defined - artifactory_binarystore | length > 0 @@ -135,6 +138,7 @@ template: src: artifactory.lic.j2 dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.lic" + mode: 0644 when: - artifactory_single_license is defined - artifactory_single_license|length > 0 @@ -145,6 +149,7 @@ template: src: artifactory.cluster.license.j2 dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.cluster.license" + mode: 0644 when: - artifactory_licenses is defined - artifactory_licenses|length > 0 @@ -170,7 +175,7 @@ - name: Create artifactory service become: yes - shell: "{{ artifactory_home }}/app/bin/installService.sh" + command: "{{ artifactory_home }}/app/bin/installService.sh" args: creates: "{{ artifactory_service_file }}" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml index ed1e91c..5f08996 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml @@ -1,6 +1,4 @@ -- debug: - msg: "Performing upgrade of Artifactory version to : {{ artifactory_version }} " - +--- - name: Check if artifactory tar already exists become: yes stat: @@ -29,12 +27,8 @@ creates: "{{ artifactory_untar_home }}" when: download_artifactory is succeeded -- name: Stop artifactory - become: yes - systemd: - name: "{{ artifactory_daemon }}" - state: stopped - when: download_artifactory.changed +- name: stop artifactory + meta: flush_handlers - name: Ensure jfrog_home_directory exists become: yes @@ -59,6 +53,7 @@ template: src: artifactory.lic.j2 dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.lic" + mode: 0644 when: - artifactory_single_license is defined - artifactory_single_license|length > 0 @@ -69,6 +64,7 @@ template: src: artifactory.cluster.license.j2 dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.cluster.license" + mode: 0644 when: - artifactory_licenses is defined - artifactory_licenses | length > 0 @@ -97,6 +93,7 @@ template: src: installer-info.json.j2 dest: "{{ artifactory_home }}/var/etc/artifactory/info/installer-info.json" + mode: 0644 notify: restart artifactory - name: Configure binary store @@ -104,6 +101,7 @@ template: src: binarystore.xml.j2 dest: "{{ artifactory_home }}/var/etc/artifactory/binarystore.xml" + mode: 0644 when: - artifactory_binarystore is defined - artifactory_binarystore|length > 0 @@ -120,6 +118,7 @@ template: src: "{{ artifactory_system_yaml_template }}" dest: "{{ artifactory_home }}/var/etc/system.yaml" + mode: 0644 when: - artifactory_systemyaml is defined - artifactory_systemyaml|length > 0 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 42c781f..d40582e 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: 7.24.3 +platform_collection_version: 7.25.7 # indicates where this collection was downloaded from (galaxy, automation_hub, standalone) ansible_marketplace: galaxy 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 5dbaba7..ff66d7c 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 @@ -1,16 +1,27 @@ +--- +dependencies: [] + galaxy_info: author: "JFrog Maintainers Team " description: "This role installs NGINX for artifactory. This role is automatically called by the artifactory role and isn't intended to be used separately." company: JFrog - issue_tracker_url: "https://github.com/jfrog/JFrog-Cloud-Installers/issues" - license: license (Apache-2.0) - min_ansible_version: 2.9 - + platforms: + - name: EL + versions: + - 7 + - 8 + - name: Ubuntu + versions: + - xenial + - bionic + - focal + - name: Debian + versions: + - stretch + - buster galaxy_tags: - artifactory - - jfrog - -dependencies: [] \ No newline at end of file + - jfrog \ No newline at end of file diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/meta/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/meta/main.yml index 64dff56..76a2432 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/meta/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/meta/main.yml @@ -1,16 +1,27 @@ +--- +dependencies: [] + galaxy_info: author: "JFrog Maintainers Team " description: "The artifactory_nginx_ssl role installs and configures nginx for SSL." company: JFrog - issue_tracker_url: "https://github.com/jfrog/JFrog-Cloud-Installers/issues" - license: license (Apache-2.0) - min_ansible_version: 2.9 - + platforms: + - name: EL + versions: + - 7 + - 8 + - name: Ubuntu + versions: + - xenial + - bionic + - focal + - name: Debian + versions: + - stretch + - buster galaxy_tags: - artifactory - - jfrog - -dependencies: [] \ No newline at end of file + - jfrog \ No newline at end of file diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/tasks/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/tasks/main.yml index a28c71e..aa64e75 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/tasks/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory_nginx_ssl/tasks/main.yml @@ -1,10 +1,10 @@ - name: "Check required variables" fail: msg="Variable '{{ item }}' is not defined" when: item not in vars - with_items: - - certificate - - certificate_key - - server_name + loop: + - certificate + - certificate_key + - server_name - name: Install prerequisite packages include_tasks: "{{ ansible_os_family }}.yml" @@ -26,7 +26,7 @@ dest: /etc/nginx/nginx.conf owner: root group: root - mode: '0755' + mode: 0755 - name: Configure redirect nginx conf become: yes @@ -35,7 +35,7 @@ dest: /etc/nginx/conf.d/redirect_http_to_https.conf owner: root group: root - mode: '0755' + mode: 0755 when: redirect_http_to_https_enabled | bool notify: restart nginx @@ -46,7 +46,7 @@ dest: /etc/nginx/conf.d/artifactory.conf owner: root group: root - mode: '0755' + mode: 0755 notify: restart nginx - name: Ensure nginx dir exists @@ -54,12 +54,14 @@ file: path: "/var/opt/jfrog/nginx/ssl" state: directory + mode: 0644 - name: Configure certificate become: yes template: src: certificate.pem.j2 dest: "/var/opt/jfrog/nginx/ssl/cert.pem" + mode: 0644 notify: restart nginx - name: Ensure pki exists @@ -67,13 +69,15 @@ file: path: "/etc/pki/tls" state: directory + mode: 0644 - name: Configure key become: yes template: src: certificate.key.j2 dest: "/etc/pki/tls/cert.key" + mode: 0644 notify: restart nginx -- name: Restart nginx +- name: restart nginx meta: flush_handlers 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 9ccb5c3..96c06b8 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.9.0 +distribution_version: 2.9.2 # whether to enable HA distribution_ha_enabled: false diff --git a/Ansible/ansible_collections/jfrog/platform/roles/distribution/handlers/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/distribution/handlers/main.yml index 702c6ae..7349321 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/handlers/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/handlers/main.yml @@ -5,3 +5,9 @@ systemd: name: "{{ distribution_daemon }}" state: restarted + +- name: stop distribution + become: yes + systemd: + name: "{{ distribution_daemon }}" + state: stopped \ No newline at end of file diff --git a/Ansible/ansible_collections/jfrog/platform/roles/distribution/meta/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/distribution/meta/main.yml index b760917..dff46a0 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/meta/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/meta/main.yml @@ -1,16 +1,27 @@ +--- +dependencies: [] + galaxy_info: author: "JFrog Maintainers Team " description: "The distribution role will install distribution software onto the host. An Artifactory server and Postgress database is required." company: JFrog - issue_tracker_url: "https://github.com/jfrog/JFrog-Cloud-Installers/issues" - license: license (Apache-2.0) - min_ansible_version: 2.9 - + platforms: + - name: EL + versions: + - 7 + - 8 + - name: Ubuntu + versions: + - xenial + - bionic + - focal + - name: Debian + versions: + - stretch + - buster galaxy_tags: - distribution - - jfrog - -dependencies: [] \ No newline at end of file + - jfrog \ No newline at end of file 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 06f61dc..980f5d6 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/expect.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/expect.yml @@ -42,3 +42,4 @@ executable: /usr/bin/expect chdir: "{{ exp_dir }}" register: exp_result + changed_when: false 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 c3f8568..c32ff81 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/install.yml @@ -1,6 +1,3 @@ -- debug: - msg: "Performing installation of Distribution version - {{ distribution_version }}" - - name: Install prerequisite packages include_tasks: "{{ ansible_os_family }}.yml" @@ -56,7 +53,10 @@ - name: Copy untar directory to distribution home become: yes - command: "cp -r {{ distribution_untar_home }}/. {{ distribution_home }}" + copy: + src: "{{ distribution_untar_home }}/" + dest: "{{ distribution_home }}" + remote_src: yes when: not app_dir_check.stat.exists - name: Create required directories @@ -108,6 +108,7 @@ template: src: "redis.conf.j2" dest: "{{ distribution_home }}/var/etc/redis/redis.conf" + mode: 0644 notify: restart distribution - name: Check if systemyaml exists @@ -121,6 +122,7 @@ template: src: "{{ distribution_system_yaml_template }}" dest: "{{ distribution_home }}/var/etc/system.yaml" + mode: 0644 when: - distribution_systemyaml is defined - distribution_systemyaml|length > 0 @@ -132,6 +134,7 @@ template: src: installer-info.json.j2 dest: "{{ distribution_home }}/var/etc/info/installer-info.json" + mode: 0644 notify: restart distribution - name: Update distribution permissions @@ -145,21 +148,12 @@ - name: Install Distribution as a service become: yes - shell: "{{ distribution_archive_service_cmd }}" + command: "{{ distribution_archive_service_cmd }}" args: chdir: "{{ distribution_install_script_path }}" creates: "{{ distribution_service_file }}" register: check_service_status_result -- name: Update distribution permissions - become: yes - file: - path: "{{ distribution_home }}" - state: directory - recurse: yes - owner: "{{ distribution_user }}" - group: "{{ distribution_group }}" - - name: Restart distribution meta: flush_handlers diff --git a/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/upgrade.yml b/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/upgrade.yml index cf55d0a..dfea337 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/upgrade.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/distribution/tasks/upgrade.yml @@ -1,6 +1,3 @@ -- debug: - msg: "Performing upgrade of Distribution version to {{ distribution_version }} " - - name: Check if distribution tar already exists become: yes stat: @@ -29,12 +26,8 @@ creates: "{{ distribution_untar_home }}" when: download_distribution is succeeded -- name: Stop distribution - become: yes - systemd: - name: "{{ distribution_daemon }}" - state: stopped - when: download_distribution.changed +- name: stop distribution + meta: flush_handlers - name: Delete distribution app become: yes @@ -48,21 +41,22 @@ command: "cp -r {{ distribution_untar_home }}/app/. {{ distribution_home }}/app" when: download_distribution.changed -- name: Check if systemyaml exists +- name: Check if system.yaml exists become: yes stat: path: "{{ distribution_home }}/var/etc/system.yaml" register: systemyaml -- name: Configure systemyaml +- name: Configure system.yaml become: yes template: src: "{{ distribution_system_yaml_template }}" dest: "{{ distribution_home }}/var/etc/system.yaml" + mode: 0644 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) notify: restart distribution - name: Check if install.sh wrapper script exist @@ -89,19 +83,21 @@ - install_wrapper_script.stat.exists - download_distribution.changed -- name: Ensure {{ distribution_home }}/var/etc/redis exists +- name: Ensure redis config directory exists become: yes file: path: "{{ distribution_home }}/var/etc/redis/" state: directory owner: "{{ distribution_user }}" group: "{{ distribution_group }}" + mode: 0644 - name: Configure redis config become: yes template: src: "redis.conf.j2" dest: "{{ distribution_home }}/var/etc/redis/redis.conf" + mode: 0644 notify: restart distribution - name: Configure installer info @@ -109,6 +105,7 @@ template: src: installer-info.json.j2 dest: "{{ distribution_home }}/var/etc/info/installer-info.json" + mode: 0644 notify: restart distribution - name: Update distribution permissions 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 255931b..455fd61 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: 7.24.3 +platform_collection_version: 7.25.7 # indicates were this collection was downlaoded from (galaxy, automation_hub, standalone) ansible_marketplace: galaxy diff --git a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/defaults/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/defaults/main.yml index 05d4bac..70b7ea6 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/defaults/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/defaults/main.yml @@ -1,7 +1,7 @@ # defaults file for mc # The version of missioncontrol to install -missioncontrol_version: 4.7.10 +missioncontrol_version: 4.7.14 # whether to enable HA mc_ha_enabled: false @@ -44,7 +44,6 @@ mc_es_conf_base: "/etc/elasticsearch" mc_es_user: admin mc_es_password: admin mc_es_url: "http://localhost:9200" -mc_es_base_url: "http://localhost:9200/elasticsearch" mc_es_transport_port: 9300 mc_es_home: "/usr/share/elasticsearch" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/handlers/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/handlers/main.yml index 016570c..7e52f94 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/handlers/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/handlers/main.yml @@ -5,3 +5,9 @@ systemd: name: "{{ mc_daemon }}" state: restarted + +- name: stop missioncontrol + become: yes + systemd: + name: "{{ mc_daemon }}" + state: stopped \ No newline at end of file diff --git a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/meta/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/meta/main.yml index c70b8e9..2910615 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/meta/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/meta/main.yml @@ -1,16 +1,27 @@ +--- +dependencies: [] + galaxy_info: author: "JFrog Maintainers Team " description: "The missioncontrol role will install missioncontrol software onto the host. An Artifactory server and Postgress database is required." company: JFrog - issue_tracker_url: "https://github.com/jfrog/JFrog-Cloud-Installers/issues" - license: license (Apache-2.0) - min_ansible_version: 2.9 - + platforms: + - name: EL + versions: + - 7 + - 8 + - name: Ubuntu + versions: + - xenial + - bionic + - focal + - name: Debian + versions: + - stretch + - buster galaxy_tags: - missioncontrol - - jfrog - -dependencies: [] \ No newline at end of file + - jfrog \ No newline at end of file diff --git a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/expect.yml b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/expect.yml index 06f61dc..980f5d6 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/expect.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/expect.yml @@ -42,3 +42,4 @@ executable: /usr/bin/expect chdir: "{{ exp_dir }}" register: exp_result + changed_when: false diff --git a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/install.yml b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/install.yml index 5fd8df8..c6463ec 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/install.yml @@ -1,6 +1,3 @@ -- debug: - msg: "Performing installation of missionControl version - {{ missioncontrol_version }}" - - name: Install prerequisite packages include_tasks: "{{ ansible_os_family }}.yml" @@ -56,7 +53,10 @@ - name: Copy untar directory to mc home become: yes - command: "cp -r {{ mc_untar_home }}/. {{ mc_home }}" + copy: + src: "{{ mc_untar_home }}/" + dest: "{{ mc_home }}" + remote_src: yes when: not app_dir_check.stat.exists - name: Create required directories @@ -140,7 +140,7 @@ - name: Install mc as a service become: yes - shell: "{{ mc_archive_service_cmd }}" + command: "{{ mc_archive_service_cmd }}" args: chdir: "{{ mc_install_script_path }}" creates: "{{ mc_service_file }}" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/setup-elasticsearch.yml b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/setup-elasticsearch.yml index c7ae3e2..d16f173 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/setup-elasticsearch.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/setup-elasticsearch.yml @@ -19,7 +19,6 @@ file: path: "{{ item }}" state: directory - mode: 0755 recurse: yes owner: elasticsearch group: elasticsearch @@ -67,7 +66,7 @@ mc_elasticsearch_package: "{{ check_elasticsearch_package_result.files[0].path }}" when: check_elasticsearch_package_result.matched > 0 -- name: Ensure /usr/share/elasticsearch exists +- name: Ensure elasticsearch home exists become: yes file: path: "{{ mc_es_home }}" @@ -92,7 +91,10 @@ - name: Copy elasticsearch config files to ES_PATH_CONF dir become: yes - command: "cp -r {{ mc_es_home }}/config/. {{ mc_es_conf_base }}/" + copy: + src: "{{ mc_es_home }}/config/" + dest: "{{ mc_es_conf_base }}" + remote_src: yes when: unarchive_result.changed - name: Remove elasticsearch config dir @@ -110,6 +112,7 @@ dest: "{{ mc_es_conf_base }}/elasticsearch.yml" owner: elasticsearch group: elasticsearch + mode: 0644 when: unarchive_result.extract_results.rc | default(128) == 0 - name: Generate elasticsearch.yml template file @@ -119,6 +122,7 @@ dest: "{{ mc_es_conf_base }}/elasticsearch.yml" owner: elasticsearch group: elasticsearch + mode: 0644 when: unarchive_result.extract_results.rc | default(128) == 0 - name: Create empty unicast_hosts.txt file @@ -126,9 +130,9 @@ file: path: "{{ mc_es_conf_base }}/unicast_hosts.txt" state: touch - mode: 0664 owner: elasticsearch group: elasticsearch + mode: 0664 - name: Setup searchguard plugin import_tasks: setup-searchguard.yml @@ -138,7 +142,6 @@ file: path: "{{ item }}" state: directory - mode: 0755 recurse: yes owner: elasticsearch group: elasticsearch @@ -150,7 +153,7 @@ - name: Start elasticsearch become: yes - shell: "su -c '{{ mc_es_script_path }}/elasticsearch -d' elasticsearch" + command: "su -c '{{ mc_es_script_path }}/elasticsearch -d' elasticsearch" environment: ES_JAVA_HOME: "{{ mc_es_java_home }}" ES_PATH_CONF: "{{ mc_es_conf_base }}/" @@ -179,4 +182,4 @@ environment: JAVA_HOME: "{{ mc_es_java_home }}" register: install_searchguard_result - when: check_searchguard_bundle_result.matched == 1 \ No newline at end of file + when: check_searchguard_bundle_result.matched == 1 diff --git a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/upgrade-elasticsearch.yml b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/upgrade-elasticsearch.yml index 6ce74eb..bc99ae6 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/upgrade-elasticsearch.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/upgrade-elasticsearch.yml @@ -8,6 +8,7 @@ echo "$(ps -ef | grep -v grep | grep ${curr_ps_id})" kill -9 ${curr_ps_id} done + changed_when: false - name: Find searchguard bundle for removal become: yes @@ -41,9 +42,9 @@ file: path: "{{ mc_es_home }}" state: directory - mode: 0755 owner: elasticsearch group: elasticsearch + mode: 0755 - name: Find elasticsearch package become: yes @@ -61,7 +62,6 @@ - name: Extract elasticsearch package become: yes - ignore_errors: yes unarchive: src: "{{ mc_elasticsearch_package }}" dest: "{{ mc_es_home }}" @@ -83,6 +83,7 @@ dest: "{{ mc_es_conf_base }}/elasticsearch.yml" owner: elasticsearch group: elasticsearch + mode: 0644 when: unarchive_result.extract_results.rc | default(128) == 0 - name: Create empty unicast_hosts.txt file @@ -90,16 +91,16 @@ file: path: "{{ mc_es_conf_base }}/unicast_hosts.txt" state: touch - mode: 0644 owner: elasticsearch group: elasticsearch + mode: 0644 - name: Upgrade searchguard plugin import_tasks: upgrade-searchguard.yml - name: Start elasticsearch become: yes - shell: "su -c '{{ mc_es_script_path }}/elasticsearch -d' elasticsearch" + command: "su -c '{{ mc_es_script_path }}/elasticsearch -d' elasticsearch" environment: ES_JAVA_HOME: "{{ mc_es_java_home }}" ES_PATH_CONF: "{{ mc_es_conf_base }}/" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/upgrade.yml b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/upgrade.yml index 1d1bfb0..1888911 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/upgrade.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/tasks/upgrade.yml @@ -1,6 +1,4 @@ -- debug: - msg: "Performing Upgrade of missionControl version - {{ missioncontrol_version }}" - +--- - name: Check if mc tar exists become: yes stat: @@ -29,12 +27,8 @@ creates: "{{ mc_untar_home }}" when: download_mc is succeeded -- name: Stop mc service - become: yes - systemd: - name: "{{ mc_daemon }}" - state: stopped - when: download_mc.changed +- name: stop missioncontrol + meta: flush_handlers - name: Delete current app folder become: yes @@ -105,6 +99,7 @@ template: src: installer-info.json.j2 dest: "{{ mc_home }}/var/etc/info/installer-info.json" + mode: 0644 notify: restart missioncontrol - name: Update correct permissions diff --git a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/vars/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/vars/main.yml index 255931b..455fd61 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/vars/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/missioncontrol/vars/main.yml @@ -1,5 +1,5 @@ # platform collection version -platform_collection_version: 7.24.3 +platform_collection_version: 7.25.7 # indicates were this collection was downlaoded from (galaxy, automation_hub, standalone) ansible_marketplace: galaxy diff --git a/Ansible/ansible_collections/jfrog/platform/roles/postgres/defaults/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/postgres/defaults/main.yml index 67a999f..feee529 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/postgres/defaults/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/postgres/defaults/main.yml @@ -1,4 +1,3 @@ ---- # Default version of Postgres server to install. postgres_version: 13 @@ -93,3 +92,14 @@ postgres_allowed_hosts: address: "0.0.0.0/0", method: "trust", } + +# PostgreSQL misc settings +postgresql_bin_path: "{{ default_postgresql_bin_path }}" +postgresql_config_path: "{{ default_postgresql_config_path }}" +postgresql_data_dir: "{{ default_postgresql_data_dir }}" +postgresql_daemon: "{{ default_postgresql_daemon }}" +postgresql_external_pid_file: "{{ default_postgresql_external_pid_file }}" + +postgres_apt_key_id: "{{ default_postgres_apt_key_id }}" +postgres_apt_key_url: "{{ default_postgres_apt_key_url }}" +postgres_apt_repository_repo: "{{ default_postgres_apt_repository_repo }}" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/postgres/meta/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/postgres/meta/main.yml index e6f64de..dcd809b 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/postgres/meta/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/postgres/meta/main.yml @@ -1,16 +1,27 @@ +--- +dependencies: [] + galaxy_info: author: "JFrog Maintainers Team " description: "The postgres role will install Postgresql software and configure a database and user to support an Artifactory or Xray server." company: JFrog - issue_tracker_url: "https://github.com/jfrog/JFrog-Cloud-Installers/issues" - license: license (Apache-2.0) - min_ansible_version: 2.9 - + platforms: + - name: EL + versions: + - 7 + - 8 + - name: Ubuntu + versions: + - xenial + - bionic + - focal + - name: Debian + versions: + - stretch + - buster galaxy_tags: - postgres - - jfrog - -dependencies: [] \ No newline at end of file + - jfrog \ No newline at end of file diff --git a/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/RedHat.yml b/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/RedHat.yml index 3422c8f..01ea6f3 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/RedHat.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/RedHat.yml @@ -47,6 +47,7 @@ line: "{{ item }}" state: present create: yes + mode: 0644 loop: - LANG=en_us.UTF-8 - LANGUAGE=en_us.UTF-8 diff --git a/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml b/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml index 1b3f0a2..dd7829a 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/postgres/tasks/install.yml @@ -120,6 +120,3 @@ privs: ALL type: database loop: "{{ dbs | default([]) }}" - -- debug: - msg: "Restarted postgres systemd {{ postgresql_daemon }}" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/postgres/templates/pg_hba.conf.j2 b/Ansible/ansible_collections/jfrog/platform/roles/postgres/templates/pg_hba.conf.j2 index b861022..cb2f923 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/postgres/templates/pg_hba.conf.j2 +++ b/Ansible/ansible_collections/jfrog/platform/roles/postgres/templates/pg_hba.conf.j2 @@ -9,10 +9,10 @@ local all all peer host all all 127.0.0.1/32 md5 host all all ::1/128 md5 -## remote connections IPv4 -{% if postgres_allowed_hosts and postgres_allowed_hosts is iterable %} - {% for host in postgres_allowed_hosts %} - {{ host.type | default('host') }} {{ host.database | default('all') }} {{ host.user | default('all') }} {{ host.address | default('0.0.0.0/0') }} {{ item.auth | default('trust') }} - {% endfor %} -{% endif %} +## remote connections IPv4 +{% if postgres_allowed_hosts and postgres_allowed_hosts is iterable -%} +{%- for host in postgres_allowed_hosts %} +{{ host.type | default('host') }} {{ host.database | default('all') }} {{ host.user | default('all') }} {{ host.address | default('0.0.0.0/0') }} {{ item.auth | default('trust') }} +{% endfor %} +{% endif %} diff --git a/Ansible/ansible_collections/jfrog/platform/roles/postgres/vars/Debian.yml b/Ansible/ansible_collections/jfrog/platform/roles/postgres/vars/Debian.yml index 80a73e5..ebfeae8 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/postgres/vars/Debian.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/postgres/vars/Debian.yml @@ -1,8 +1,9 @@ -postgresql_data_dir: "/var/lib/postgresql/{{ postgres_version }}/main" -postgresql_bin_path: "/usr/lib/postgresql/{{ postgres_version }}/bin" -postgresql_config_path: "/etc/postgresql/{{ postgres_version }}/main" -postgresql_daemon: postgresql@{{ postgres_version }}-main -postgresql_external_pid_file: "/var/run/postgresql/{{ postgres_version }}-main.pid" -postgres_apt_key_url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc" -postgres_apt_key_id: "0x7FCC7D46ACCC4CF8" -postgres_apt_repository_repo: "deb https://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main" +default_postgresql_bin_path: /usr/lib/postgresql/{{ postgres_version }}/bin +default_postgresql_config_path: /etc/postgresql/{{ postgres_version }}/main +default_postgresql_data_dir: /var/lib/postgresql/{{ postgres_version }}/main +default_postgresql_daemon: postgresql@{{ postgres_version }}-main +default_postgresql_external_pid_file: /var/run/postgresql/{{ postgres_version }}-main.pid + +default_postgres_apt_key_id: '0x7FCC7D46ACCC4CF8' +default_postgres_apt_key_url: https://www.postgresql.org/media/keys/ACCC4CF8.asc +default_postgres_apt_repository_repo: deb https://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main diff --git a/Ansible/ansible_collections/jfrog/platform/roles/postgres/vars/RedHat.yml b/Ansible/ansible_collections/jfrog/platform/roles/postgres/vars/RedHat.yml index 79b159f..fa7a7cb 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/postgres/vars/RedHat.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/postgres/vars/RedHat.yml @@ -1,5 +1,5 @@ -postgresql_bin_path: "/usr/pgsql-{{ postgres_version }}/bin" -postgresql_data_dir: "/var/lib/pgsql/{{ postgres_version }}/data" -postgresql_config_path: "/var/lib/pgsql/{{ postgres_version }}/data" -postgresql_daemon: postgresql-{{ postgres_version }}.service -postgresql_external_pid_file: "/var/run/postgresql/{{ postgres_version }}-main.pid" +default_postgresql_bin_path: /usr/pgsql-{{ postgres_version }}/bin +default_postgresql_config_path: /var/lib/pgsql/{{ postgres_version }}/data +default_postgresql_data_dir: /var/lib/pgsql/{{ postgres_version }}/data +default_postgresql_daemon: postgresql-{{ postgres_version }}.service +default_postgresql_external_pid_file: /var/run/postgresql/{{ postgres_version }}-main.pid 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 4b5de99..6b9200b 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.30.1 +xray_version: 3.32.2 # whether to enable HA xray_ha_enabled: false 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 9af3a06..46ff450 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/handlers/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/handlers/main.yml @@ -5,3 +5,9 @@ systemd: name: "{{ xray_daemon }}" state: restarted + +- name: stop xray + become: yes + systemd: + name: "{{ xray_daemon }}" + state: stopped diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/meta/main.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/meta/main.yml index c01401f..e6d3773 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/meta/main.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/meta/main.yml @@ -1,16 +1,27 @@ +--- +dependencies: [] + galaxy_info: author: "JFrog Maintainers Team " description: "The xray role will install Xray software onto the host. An Artifactory server and Postgress database is required." company: JFrog - issue_tracker_url: "https://github.com/jfrog/JFrog-Cloud-Installers/issues" - license: license (Apache-2.0) - min_ansible_version: 2.9 - + platforms: + - name: EL + versions: + - 7 + - 8 + - name: Ubuntu + versions: + - xenial + - bionic + - focal + - name: Debian + versions: + - stretch + - buster galaxy_tags: - - xray - - jfrog - -dependencies: [] \ No newline at end of file + - insight + - jfrog \ No newline at end of file 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 06f61dc..980f5d6 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/expect.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/expect.yml @@ -42,3 +42,4 @@ executable: /usr/bin/expect chdir: "{{ exp_dir }}" register: exp_result + changed_when: false 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 3c15b41..cfb2786 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/install.yml @@ -1,6 +1,3 @@ -- debug: - msg: "Performing installation of Xray version : {{ xray_version }}" - - name: Install prerequisite packages include_tasks: "{{ ansible_os_family }}.yml" @@ -56,7 +53,10 @@ - name: Copy untar directory to xray home become: yes - command: "cp -r {{ xray_untar_home }}/. {{ xray_home }}" + copy: + src: "{{ xray_untar_home }}/" + dest: "{{ xray_home }}" + remote_src: yes when: not app_dir_check.stat.exists - name: Create required directories @@ -115,6 +115,7 @@ template: src: "rabbitmq.conf.j2" dest: "{{ xray_home }}/app/bin/rabbitmq/rabbitmq.conf" + mode: 0644 notify: restart xray - name: Configure installer info @@ -122,22 +123,24 @@ template: src: installer-info.json.j2 dest: "{{ xray_home }}/var/etc/info/installer-info.json" + mode: 0644 notify: restart xray -- name: Check if systemyaml exists +- name: Check if system.yaml exists become: yes stat: path: "{{ xray_home }}/var/etc/system.yaml" register: systemyaml -- name: Configure systemyaml +- name: Configure system.yaml become: yes template: src: "{{ xray_system_yaml_template }}" dest: "{{ xray_home }}/var/etc/system.yaml" + mode: 0644 when: - xray_systemyaml is defined - - xray_systemyaml|length > 0 + - xray_systemyaml | length > 0 - xray_systemyaml_override or (not systemyaml.stat.exists) notify: restart xray @@ -152,7 +155,7 @@ - name: Install xray as a service become: yes - shell: "{{ xray_archive_service_cmd }}" + command: "{{ xray_archive_service_cmd }}" args: chdir: "{{ xray_install_script_path }}" creates: "{{ xray_service_file }}" diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/check/archive.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/check/archive.yml deleted file mode 100644 index 528b474..0000000 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/check/archive.yml +++ /dev/null @@ -1,63 +0,0 @@ -- name: Check rabbitmq cluster_keepalive_interval option - become: yes - ignore_errors: yes - shell: | - ./rabbitmqctl --erlang-cookie {{ xray_rabbitmq_default_cookie }} eval \ - 'application:get_env(rabbit, cluster_keepalive_interval).' \ - | tr -d '}{' | cut -d ',' -f2 - args: - chdir: "{{ xray_home }}/app/third-party/rabbitmq/sbin/" - environment: - LC_ALL: en_US.UTF-8 - LC_CTYPE: en_US.UTF-8 - register: cluster_keepalive_interval_value - -- name: Check rabbitmq handshake_timeout option - become: yes - ignore_errors: yes - shell: | - ./rabbitmqctl --erlang-cookie {{ xray_rabbitmq_default_cookie }} eval \ - 'application:get_env(rabbit, handshake_timeout).' \ - | tr -d '}{' | cut -d ',' -f2 - args: - chdir: "{{ xray_home }}/app/third-party/rabbitmq/sbin/" - environment: - LC_ALL: en_US.UTF-8 - LC_CTYPE: en_US.UTF-8 - register: handshake_timeout_value - -- name: Check rabbitmq vm_memory_high_watermark.relative option - become: yes - ignore_errors: yes - shell: | - ./rabbitmqctl --erlang-cookie {{ xray_rabbitmq_default_cookie }} eval \ - 'application:get_env(rabbit, vm_memory_high_watermark).' \ - | tr -d '}{' | cut -d ',' -f2 - args: - chdir: "{{ xray_home }}/app/third-party/rabbitmq/sbin/" - environment: - LC_ALL: en_US.UTF-8 - LC_CTYPE: en_US.UTF-8 - register: vm_memory_high_watermark_relative_value - -- name: Store result - include_role: - name: report - vars: - stop_testing_if_fail: false - test_description: "{{ test_ext_description }}Check rabbitmq custom options values. INST-775" - test_host: "{{ inventory_hostname }}" - test_result: >- - {{ - vm_memory_high_watermark_relative_value.stdout == rabbitmq_custom_values['vm_memory_high_watermark'] - and cluster_keepalive_interval_value.stdout == rabbitmq_custom_values['cluster_keepalive_interval'] - and handshake_timeout_value.stdout == rabbitmq_custom_values['handshake_timeout'] - }} - report_action: "store-result" - log_result: >- - {{ - {} - | combine({'handshake_timeout': {'real': handshake_timeout_value.stdout, 'expected': rabbitmq_custom_values.handshake_timeout}}) - | combine({'vm_memory_high_watermark': {'real': vm_memory_high_watermark_relative_value.stdout, 'expected': rabbitmq_custom_values.vm_memory_high_watermark}}) - | combine({'cluster_keepalive_interval': {'real': cluster_keepalive_interval_value.stdout, 'expected': rabbitmq_custom_values.cluster_keepalive_interval}}) - }} diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/setup/RedHat.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/setup/RedHat.yml index 8bffcc3..2a35638 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/setup/RedHat.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/setup/RedHat.yml @@ -45,6 +45,17 @@ xray_erlang_package: "{{ check_erlang_package_result.files[0].path }}" when: check_erlang_package_result.matched > 0 +- name: Import RabbitMQ release signing key + become: yes + ignore_errors: yes + rpm_key: + key: https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc + state: present + register: import_rabbitmq_signing_key_result + until: import_rabbitmq_signing_key_result is succeeded + delay: 5 + retries: 3 + - name: Install erlang package become: yes yum: diff --git a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/status/archive.yml b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/status/archive.yml deleted file mode 100644 index 3567e4a..0000000 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/rabbitmq/status/archive.yml +++ /dev/null @@ -1,12 +0,0 @@ -- name: Get rabbitmq ha cluster status - become: yes - ignore_errors: yes - shell: | - ./rabbitmqctl --erlang-cookie {{ xray_rabbitmq_default_cookie }} \ - --formatter json cluster_status | jq . - args: - chdir: "{{ xray_home }}/app/third-party/rabbitmq/sbin/" - environment: - LC_ALL: en_US.UTF-8 - LC_CTYPE: en_US.UTF-8 - register: ha_rabbitmq_cluster_status 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 29244db..c0ced65 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/upgrade.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/xray/tasks/upgrade.yml @@ -1,6 +1,4 @@ -- debug: - msg: "Performing upgrade of Xray version to {{ xray_version }}..." - +--- - name: Check if xray tar exists become: yes stat: @@ -30,11 +28,7 @@ when: download_xray is succeeded - name: stop xray - become: yes - systemd: - name: "{{ xray_daemon }}" - state: stopped - when: download_xray.changed + meta: flush_handlers - name: Delete xray app become: yes @@ -88,6 +82,7 @@ template: src: "rabbitmq.conf.j2" dest: "{{ xray_home }}/app/bin/rabbitmq/rabbitmq.conf" + mode: 0644 when: - download_xray.changed notify: restart xray @@ -103,6 +98,7 @@ template: src: "{{ xray_system_yaml_template }}" dest: "{{ xray_home }}/var/etc/system.yaml" + mode: 0644 when: - xray_systemyaml is defined - xray_systemyaml|length > 0 @@ -114,6 +110,7 @@ template: src: installer-info.json.j2 dest: "{{ xray_home }}/var/etc/info/installer-info.json" + mode: 0644 notify: restart xray - name: Ensure permissions are correct 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 255931b..455fd61 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: 7.24.3 +platform_collection_version: 7.25.7 # 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 670a215..f160fb2 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 @@ -14,7 +14,7 @@ xray_installer_scenario: } - { "expecting": "please specify the ip address of this machine(?!.*Skipping prompt)", - "sending": "{% if xray_ha_node_type is defined and xray_ha_node_type == 'master' %}{{ ansible_host }}{% else %}{{ ansible_host }}{% endif %}" + "sending": "{{ ansible_host }}" } - { "expecting": "are you adding an additional node",