[ansible] JFrog Platform 7.19.4 (#124)

This commit is contained in:
Ram Mohan Rao Chukka
2021-05-30 20:51:17 +05:30
committed by GitHub
parent c5478f8840
commit 5b9899995b
38 changed files with 399 additions and 310 deletions

View File

@@ -1,7 +1,8 @@
---
# defaults file for artifactory
# indicates where this collection was downloaded from (galaxy, automation_hub, standalone)
ansible_marketplace: standalone
# The version of artifactory to install
artifactory_version: 7.19.4
# 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
@@ -30,9 +31,6 @@ artifactory_taskAffinity: any
# The location where Artifactory should install.
jfrog_home_directory: /opt/jfrog
# The location where Artifactory should store data.
artifactory_file_store_dir: /data
# Pick the Artifactory flavour to install, can be also cpp-ce, jcr, pro.
artifactory_flavour: pro
@@ -42,7 +40,8 @@ artifactory_tar: https://releases.jfrog.io/artifactory/artifactory-pro/org/artif
artifactory_home: "{{ jfrog_home_directory }}/artifactory"
artifactory_untar_home: "{{ jfrog_home_directory }}/artifactory-{{ artifactory_flavour }}-{{ artifactory_version }}"
postgres_driver_download_url: https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.20/postgresql-42.2.20.jar
postgres_driver_version: 42.2.20
postgres_driver_download_url: https://repo1.maven.org/maven2/org/postgresql/postgresql/{{ postgres_driver_version }}/postgresql-{{ postgres_driver_version }}.jar
artifactory_user: artifactory
artifactory_group: artifactory
@@ -59,6 +58,7 @@ artifactory_upgrade_only: false
artifactory_admin_username: admin
artifactory_admin_password: password
artifactory_service_file : /lib/systemd/system/artifactory.service
# Provide binarystore XML content below with 2-space indentation
artifactory_binarystore: |-
@@ -71,6 +71,8 @@ artifactory_binarystore: |-
artifactory_systemyaml: |-
configVersion: 1
shared:
security:
joinKey: "{{ join_key }}"
extraJavaOpts: "{{ artifactory_extra_java_opts }}"
node:
id: {{ ansible_hostname }}
@@ -86,3 +88,6 @@ artifactory_systemyaml: |-
router:
entrypoints:
internalPort: 8046
# Note: artifactory_systemyaml_override is by default false, if you want to change default artifactory_systemyaml
artifactory_systemyaml_override: false

View File

@@ -1,6 +1,6 @@
galaxy_info:
author: "JFrog Maintainers Team <installers@jfrog.com>"
description: "The artifactory role installs the Artifactory Pro software onto the host. Per the Vars below, it will configure a node as primary or secondary. This role uses secondary roles artifactory_nginx to install nginx."
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"

View File

@@ -5,12 +5,16 @@
- name: install nginx
include_role:
name: artifactory_nginx
when: artifactory_nginx_enabled == true
when:
- artifactory_nginx_enabled | bool
- not artifactory_nginx_ssl_enabled | bool
- name: install nginx with SSL
include_role:
name: artifactory_nginx_ssl
when: artifactory_nginx_ssl_enabled == true
when:
- not artifactory_nginx_enabled | bool
- artifactory_nginx_ssl_enabled | bool
- name: Ensure group artifactory exist
become: yes
@@ -55,7 +59,7 @@
command: "cp -r {{ artifactory_untar_home }}/. {{ artifactory_home }}"
when: not app_dir_check.stat.exists
- name: Create required directories
- name: Create required directories
become: yes
file:
path: "{{ item }}"
@@ -64,40 +68,37 @@
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
loop:
- "{{ artifactory_file_store_dir }}"
- "{{ artifactory_home }}/var/data"
- "{{ artifactory_home }}/var/etc"
- "{{ artifactory_home }}/var/etc/security/"
- "{{ artifactory_home }}/var/etc/artifactory/info/"
- name: Check if systemyaml exists
become: yes
stat:
path: "{{ artifactory_home }}/var/etc/system.yaml"
register: systemyaml
- name: Configure systemyaml
become: yes
template:
src: "{{ artifactory_system_yaml_template }}"
dest: "{{ artifactory_home }}/var/etc/system.yaml"
when:
- artifactory_systemyaml is defined
- artifactory_systemyaml|length > 0
- artifactory_systemyaml_override or (not systemyaml.stat.exists)
notify: restart artifactory
- name: Configure master key
become: yes
copy:
dest: "{{ artifactory_home }}/var/etc/security/master.key"
content: |
{{ master_key }}
content: "{{ master_key }}"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
mode: 0640
- name: Configure join key
become: yes
copy:
dest: "{{ artifactory_home }}/var/etc/security/join.key"
content: |
{{ join_key }}
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
mode: 0640
notify: restart artifactory
- name: Configure installer info
become: yes
template:
@@ -110,6 +111,9 @@
template:
src: binarystore.xml.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/binarystore.xml"
when:
- artifactory_binarystore is defined
- artifactory_binarystore|length > 0
notify: restart artifactory
- name: Configure single license
@@ -117,17 +121,27 @@
template:
src: artifactory.lic.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.lic"
when: artifactory_single_license is defined
when:
- artifactory_single_license is defined
- artifactory_single_license|length > 0
notify: restart artifactory
- name: Configure HA licenses
- name: Configure HA licenses
become: yes
template:
src: artifactory.cluster.license.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.cluster.license"
when: artifactory_licenses is defined
when:
- artifactory_licenses is defined
- artifactory_licenses|length > 0
notify: restart artifactory
- name: Check if database driver exists
become: yes
stat:
path: "{{ artifactory_home }}/app/artifactory/tomcat/lib/jf_postgresql-{{ postgres_driver_version }}.jar"
register: database_driver
- name: Download database driver
become: yes
get_url:
@@ -135,13 +149,17 @@
dest: "{{ artifactory_home }}/var/bootstrap/artifactory/tomcat/lib"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
when: postgres_driver_download_url is defined
when:
- postgres_driver_download_url is defined
- not database_driver.stat.exists
notify: restart artifactory
- name: Create artifactory service
become: yes
shell: "{{ artifactory_home }}/app/bin/installService.sh"
args:
creates: "{{ artifactory_service_file }}"
- name: Ensure permissions are correct
become: yes
file:
@@ -153,9 +171,10 @@
- name: Restart artifactory
meta: flush_handlers
- name : Wait for artifactory to be fully deployed
- name : Wait for artifactory to be fully deployed
uri: url=http://127.0.0.1:8082/router/api/v1/system/health timeout=130
register: result
until: result.status == 200
retries: 25
delay: 5
when: not ansible_check_mode

View File

@@ -2,18 +2,6 @@
- debug:
msg: "Performing upgrade of Artifactory version to : {{ artifactory_version }} "
- name: Stop artifactory
become: yes
systemd:
name: "{{ artifactory_daemon }}"
state: stopped
- name: Ensure jfrog_home_directory exists
become: yes
file:
path: "{{ jfrog_home_directory }}"
state: directory
- name: Download artifactory for upgrade
become: yes
unarchive:
@@ -28,41 +16,67 @@
until: downloadartifactory is succeeded
retries: 3
- name: Stop artifactory
become: yes
systemd:
name: "{{ artifactory_daemon }}"
state: stopped
when: downloadartifactory.changed
- name: Ensure jfrog_home_directory exists
become: yes
file:
path: "{{ jfrog_home_directory }}"
state: directory
- name: Delete artifactory app directory
become: yes
file:
path: "{{ artifactory_home }}/app"
state: absent
when: downloadartifactory.changed
- name: Copy new app to artifactory app
become: yes
command: "cp -r {{ artifactory_untar_home }}/app/. {{ artifactory_home }}/app"
- name: Configure join key
become: yes
copy:
dest: "{{ artifactory_home }}/var/etc/security/join.key"
content: |
{{ join_key }}
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
mode: 0640
notify: restart artifactory
when: downloadartifactory.changed
- name: Configure single license
become: yes
template:
src: artifactory.lic.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.lic"
when: artifactory_single_license is defined
when:
- artifactory_single_license is defined
- artifactory_single_license|length > 0
notify: restart artifactory
- name: Configure HA licenses
- name: Configure HA licenses
become: yes
template:
src: artifactory.cluster.license.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.cluster.license"
when: artifactory_licenses is defined
when:
- artifactory_licenses is defined
- artifactory_licenses|length > 0
notify: restart artifactory
- name: Check if database driver exists
become: yes
stat:
path: "{{ artifactory_home }}/app/artifactory/tomcat/lib/jf_postgresql-{{ postgres_driver_version }}.jar"
register: database_driver
- name: Download database driver
become: yes
get_url:
url: "{{ postgres_driver_download_url }}"
dest: "{{ artifactory_home }}/var/bootstrap/artifactory/tomcat/lib"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
when:
- postgres_driver_download_url is defined
- not database_driver.stat.exists
notify: restart artifactory
- name: Configure installer info
@@ -77,13 +91,26 @@
template:
src: binarystore.xml.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/binarystore.xml"
when:
- artifactory_binarystore is defined
- artifactory_binarystore|length > 0
notify: restart artifactory
- name: Check if systemyaml exists
become: yes
stat:
path: "{{ artifactory_home }}/var/etc/system.yaml"
register: systemyaml
- name: Configure systemyaml
become: yes
template:
src: "{{ artifactory_system_yaml_template }}"
dest: "{{ artifactory_home }}/var/etc/system.yaml"
when:
- artifactory_systemyaml is defined
- artifactory_systemyaml|length > 0
- artifactory_systemyaml_override or (not systemyaml.stat.exists)
notify: restart artifactory
- name: Ensure permissions are correct
@@ -97,9 +124,10 @@
- name: Restart artifactory
meta: flush_handlers
- name : Wait for artifactory to be fully deployed
- name : Wait for artifactory to be fully deployed
uri: url=http://127.0.0.1:8082/router/api/v1/system/health timeout=130
register: result
until: result.status == 200
retries: 25
delay: 5
when: not ansible_check_mode

View File

@@ -1,3 +1 @@
{% if (artifactory_licenses) and (artifactory_licenses|length > 0) %}
{{ artifactory_licenses }}
{% endif %}
{{ artifactory_licenses }}

View File

@@ -1,3 +1 @@
{% if (artifactory_single_license) and (artifactory_single_license|length > 0) %}
{{ artifactory_single_license }}
{% endif %}
{{ artifactory_single_license }}

View File

@@ -1,3 +1 @@
{% if (artifactory_binarystore) and (artifactory_binarystore|length > 0) %}
{{ artifactory_binarystore }}
{% endif %}
{{ artifactory_binarystore }}

View File

@@ -1,3 +1 @@
{% if (artifactory_systemyaml) and (artifactory_systemyaml|length > 0) %}
{{ artifactory_systemyaml }}
{% endif %}
{{ artifactory_systemyaml }}

View File

@@ -0,0 +1,6 @@
---
# platform collection version
platform_collection_version: 7.19.4
# indicates where this collection was downloaded from (galaxy, automation_hub, standalone)
ansible_marketplace: galaxy