[Ansible] JFrog Platform 7.24.3 (#153)

This commit is contained in:
Ram Mohan Rao Chukka
2021-08-17 09:43:00 +05:30
committed by GitHub
parent 16ce388773
commit 55a3842fac
58 changed files with 493 additions and 353 deletions

View File

@@ -1,15 +1,14 @@
---
# defaults file for xray
# The version of xray to install
xray_version: 3.29.0
xray_version: 3.30.1
# whether to enable HA
xray_ha_enabled: false
xray_ha_node_type : master
xray_ha_node_type: master
# The location where xray should install.
# The location where xray should install
jfrog_home_directory: /opt/jfrog
# The remote xray download file
@@ -26,7 +25,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 }}/installService.sh"
xray_service_file : /lib/systemd/system/xray.service
xray_service_file: /lib/systemd/system/xray.service
#xray users and groups
xray_user: xray
@@ -37,8 +36,6 @@ xray_gid: 1035
xray_daemon: xray
flow_type: archive
#rabbitmq user
xray_rabbitmq_user: guest
xray_rabbitmq_password: guest
@@ -50,21 +47,18 @@ xray_upgrade_only: false
xray_system_yaml_template: system.yaml.j2
linux_distro: "{{ ansible_distribution | lower }}{{ansible_distribution_major_version}}"
linux_distro: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}"
xray_db_util_search_filter:
ubuntu16:
db5: 'db5.3-util.*ubuntu.*amd64\.deb'
db: 'db-util.*ubuntu.*all.deb'
ubuntu18:
db5: 'db5.3-util.*ubuntu.*amd64\.deb'
db5: 'db5.3-util.*ubuntu1.1.*amd64\.deb'
db: 'db-util.*ubuntu.*all.deb'
ubuntu20:
db5: 'db5.3-util.*ubuntu.*amd64\.deb'
db5: 'db5.3-util.*dfsg.*ubuntu.*amd64\.deb'
db: 'db-util.*ubuntu.*all.deb'
debian8:
db5: 'db5.3-util.*deb8.*amd64\.deb'
db: 'db-util_([0-9]{1,3}\.?){3}_all\.deb'
debian9:
db5: 'db5.3-util.*deb9.*amd64\.deb'
db: 'db-util_([0-9]{1,3}\.?){3}_all\.deb'
@@ -76,7 +70,7 @@ xray_db_util_search_filter:
yum_python_interpreter: >-
{%- if linux_distro is not defined -%}
/usr/bin/python3
{%- elif linux_distro in ['centos7', 'rhel7'] -%}
{%- elif linux_distro in ['centos7', 'redhat7'] -%}
/usr/bin/python
{%- else -%}
/usr/bin/python3

View File

@@ -0,0 +1,13 @@
- name: Install prerequisite packages
become: yes
apt:
name: ["expect", "locales"]
state: present
update_cache: yes
cache_valid_time: 3600
- name: Ensure UTF-8 locale exists
become: yes
locale_gen:
name: en_US.UTF-8
state: present

View File

@@ -0,0 +1,5 @@
- name: Install prerequisite packages
become: yes
yum:
name: expect
state: present

View File

@@ -1,33 +1,18 @@
---
- debug:
msg: "Performing installation of Xray version : {{ xray_version }}"
- name: Install expect dependency
become: yes
yum:
name: expect
state: present
when: ansible_os_family == 'RedHat'
- name: Install expect dependency
become: yes
apt:
name: expect
state: present
update_cache: yes
when: ansible_os_family == 'Debian'
- name: Install prerequisite packages
include_tasks: "{{ ansible_os_family }}.yml"
- name: Ensure group xray exist
become: yes
group:
name: "{{ xray_group }}"
gid: "{{ xray_gid }}"
state: present
- name: Ensure user xray exist
become: yes
user:
uid: "{{ xray_uid }}"
name: "{{ xray_user }}"
group: "{{ xray_group }}"
create_home: yes
@@ -150,10 +135,10 @@
template:
src: "{{ xray_system_yaml_template }}"
dest: "{{ xray_home }}/var/etc/system.yaml"
when:
- xray_systemyaml is defined
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)
notify: restart xray
- name: Ensure permissions are correct
@@ -167,8 +152,7 @@
- name: Install xray as a service
become: yes
shell: |
{{ xray_archive_service_cmd }}
shell: "{{ xray_archive_service_cmd }}"
args:
chdir: "{{ xray_install_script_path }}"
creates: "{{ xray_service_file }}"
@@ -177,10 +161,13 @@
- name: Restart xray
meta: flush_handlers
- name : Wait for xray to be fully deployed
uri: url=http://127.0.0.1:8082/router/api/v1/system/health timeout=130
- name: Make sure xray is up and running
uri:
url: http://127.0.0.1:8082/router/api/v1/system/health
timeout: 130
status_code: 200
register: result
until: result.status == 200
until: result is succeeded
retries: 25
delay: 5
when: not ansible_check_mode

View File

@@ -1,10 +1,11 @@
- name: perform installation
- name: Perform installation
include_tasks: "install.yml"
when:
- xray_enabled
- not xray_upgrade_only
- name: perform upgrade
- name: Perform upgrade
include_tasks: "upgrade.yml"
when:
- xray_enabled
- xray_upgrade_only
- xray_upgrade_only

View File

@@ -1,15 +1,12 @@
- name: Set package prefix
set_fact:
rhel_package_prefix: >-
{%- if linux_distro in ['centos7','rhel7'] -%}
{%- if linux_distro in ['centos7','redhat7'] -%}
el7
{%- elif linux_distro in ['centos8','rhel8'] -%}
{%- elif linux_distro in ['centos8','redhat8'] -%}
el8
{%- endif -%}
- debug:
msg: "rhel_package_prefix: {{ rhel_package_prefix }}"
- name: Find socat package
become: yes
find:

View File

@@ -1,9 +1,9 @@
- name: Set package prefix
set_fact:
rhel_package_prefix: >-
{%- if linux_distro in ['centos7','rhel7'] -%}
{%- if linux_distro in ['centos7','redhat7'] -%}
el7
{%- elif linux_distro in ['centos8','rhel8'] -%}
{%- elif linux_distro in ['centos8','redhat8'] -%}
el8
{%- endif -%}

View File

@@ -1,4 +1,3 @@
---
- debug:
msg: "Performing upgrade of Xray version to {{ xray_version }}..."
@@ -33,7 +32,7 @@
- name: stop xray
become: yes
systemd:
name: "{{ xray_daemon }}"
name: "{{ xray_daemon }}"
state: stopped
when: download_xray.changed
@@ -104,10 +103,10 @@
template:
src: "{{ xray_system_yaml_template }}"
dest: "{{ xray_home }}/var/etc/system.yaml"
when:
- xray_systemyaml is defined
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)
notify: restart xray
- name: configure installer info
@@ -129,10 +128,13 @@
- name: Restart xray
meta: flush_handlers
- name : wait for xray to be fully deployed
uri: url=http://127.0.0.1:8082/router/api/v1/system/health timeout=130
- name: Make sure xray is up and running
uri:
url: http://127.0.0.1:8082/router/api/v1/system/health
timeout: 130
status_code: 200
register: result
until: result.status == 200
until: result is succeeded
retries: 25
delay: 5
when: not ansible_check_mode

View File

@@ -1,6 +1,5 @@
---
# platform collection version
platform_collection_version: 7.23.3
platform_collection_version: 7.24.3
# indicates were this collection was downlaoded from (galaxy, automation_hub, standalone)
ansible_marketplace: galaxy
ansible_marketplace: galaxy