upgraded to artifactory 7.21.5 and xray 3.27.2

This commit is contained in:
Vinay Aggarwal
2021-07-11 15:54:45 -07:00
parent 4ac8b06ce2
commit fbba8620f0
110 changed files with 2378 additions and 562 deletions

View File

@@ -0,0 +1,43 @@
- name: set license for Enterprise
block:
- name: use license file
copy:
src: "{{ artifactory_license_file }}"
dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.cluster.license"
force: no # only copy if file doesn't exist
become: yes
when: artifactory_license_file is defined and artifactory_is_primary == true
- name: use license strings
vars:
artifactory_licenses_dict: "{{ artifactory_licenses | default('{}') }}"
template:
src: artifactory.cluster.license.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.cluster.license"
force: no # only create if file doesn't exist
become: yes
when: artifactory_license_file is not defined and artifactory_is_primary == true
when: artifactory_ha_enabled
- name: set license for Pro
block:
- name: use license file
copy:
src: "{{ artifactory_license_file }}"
dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.lic"
force: no # only create if file doesn't exist
become: yes
when: artifactory_license_file is defined
- name: use license strings
vars:
artifactory_licenses_dict: "{{ artifactory_licenses | default('{}') }}"
template:
src: artifactory.pro.license.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.lic"
force: no # only create if file doesn't exist
become: yes
when: artifactory_license_file is not defined
when: not artifactory_ha_enabled

View File

@@ -0,0 +1,151 @@
---
# tasks file for artifactory
- name: Set artifactory major version
set_fact:
artifactory_major_verion: "{{ artifactory_version.split('.')[0] }}"
- name: create group for artifactory
group:
name: "{{ artifactory_group }}"
state: present
become: yes
- name: create user for artifactory
user:
name: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
system: yes
become: yes
- name: ensure artifactory_download_directory exists
file:
path: "{{ artifactory_download_directory }}"
state: directory
become: yes
- name: ensure artifactory_file_store_dir exists
file:
path: "{{ artifactory_file_store_dir }}"
state: directory
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes
- name: ensure data subdirectories exist and have correct ownership
file:
path: "{{ artifactory_home }}/var/{{ item }}"
state: directory
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
loop:
- "bootstrap"
- "etc"
- "data"
- "etc/info"
- "etc/security"
- "etc/artifactory"
become: yes
- name: check if system yaml file exits
stat:
path: "{{ artifactory_home }}/var/etc/system.yaml"
register: system_yaml
- name: use specified system yaml
copy:
src: "{{ system_file }}"
dest: "{{ artifactory_home }}/var/etc/system.yaml"
become: yes
when: system_file is defined and not system_yaml.stat.exists
- name: configure system yaml
template:
src: system.yaml.j2
dest: "{{ artifactory_home }}/var/etc/system.yaml"
become: yes
when: system_file is not defined and not system_yaml.stat.exists
- name: configure master key
template:
src: master.key.j2
dest: "{{ artifactory_home }}/var/etc/security/master.key"
force: no # only create if file doesn't exist
become: yes
- name: configure join key
template:
src: join.key.j2
dest: "{{ artifactory_home }}/var/etc/security/join.key"
force: no # only create if file doesn't exist
become: yes
- name: configure installer info
template:
src: installer-info.json.j2
dest: "{{ artifactory_home }}/var/etc/info/installer-info.json"
become: yes
- name: use specified binary store file
copy:
src: "{{ binary_store_file }}"
dest: "{{ artifactory_home }}/var/etc/artifactory/binarystore.xml"
force: no # only copy if file doesn't exist
become: yes
when: binary_store_file is defined
- name: set default binary store
template:
src: binarystore.xml.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/binarystore.xml"
force: no # only create if file doesn't exist
become: yes
when: binary_store_file is not defined
- name: configure licenses
include_tasks: configure-licenses.yml
- name: create artifactory service
shell: "{{ artifactory_home }}/app/bin/installService.sh"
become: yes
- name: Delete plugin folder
file:
state: absent
path: "{{ artifactory_home }}/var/etc/artifactory/plugins"
- name: symlink plugin folder to EFS
file:
src: "/efsmount/plugins"
path: "{{ artifactory_home }}/var/etc/artifactory/plugins"
state: link
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
- name: ensure data subdirectories exist and have correct ownership
file:
path: "{{ artifactory_home }}/var/{{ item }}"
state: directory
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
loop:
- "etc/artifactory/plugins"
become: yes
- name: start and enable the primary node
service:
name: artifactory
state: restarted
become: yes
# when: artifactory_is_primary == true
# - name: random wait before restarting to prevent secondary nodes from hitting DB first
# pause:
# seconds: "{{ 120 | random + 10}}"
# when: artifactory_is_primary == false
# - name: start and enable the secondary nodes
# service:
# name: artifactory
# state: restarted
# become: yes
# when: artifactory_is_primary == false