Checking in code for rt 7.27.3 version

This commit is contained in:
Vinay Aggarwal
2021-10-04 13:05:03 -07:00
parent 161f222b2a
commit 4cb7e10617
393 changed files with 31569 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@@ -0,0 +1,43 @@
---
# defaults file for artifactory
# indicates were this collection was downlaoded from (galaxy, automation_hub, standalone)
ansible_marketplace: standalone
# The version of Artifactory to install
artifactory_version: 7.19.4
# licenses - cluster license content in json
artifactory_licenses:
# whether to enable HA
artifactory_ha_enabled: true
# value for whether a host is primary. this should be set in host vars
artifactory_is_primary: true
# The location where Artifactory should install.
artifactory_download_directory: /opt/jfrog
# The location where Artifactory should store data.
artifactory_file_store_dir: /data
extra_java_opts: -server -Xms2g -Xmx14g -Xss256k -XX:+UseG1GC
artifactory_tar: https://releases.jfrog.io/artifactory/artifactory-pro/org/artifactory/pro/jfrog-artifactory-pro/{{ artifactory_version }}/jfrog-artifactory-pro-{{ artifactory_version }}-linux.tar.gz
artifactory_home: "{{ artifactory_download_directory }}/artifactory-pro-{{ artifactory_version }}"
artifactory_user: artifactory
artifactory_group: artifactory
# Set the parameters required for the service.
service_list:
- name: artifactory
description: Start script for Artifactory
start_command: "{{ artifactory_home }}/bin/artifactory.sh start"
stop_command: "{{ artifactory_home }}/bin/artifactory.sh stop"
type: forking
status_pattern: artifactory
user_name: "{{ artifactory_user }}"
group_name: "{{ artifactory_group }}"
product_id: CloudFormation_QS_EC2/1.0.0

View File

@@ -0,0 +1,10 @@
---
# handlers file for artifactory
- name: systemctl daemon-reload
systemd:
daemon_reload: yes
- name: restart artifactory
service:
name: artifactory
state: restarted

View File

@@ -0,0 +1,6 @@
---
exceptions:
- variation: Alpine
reason: Artifactory start/stop scripts don't properly work.
- variation: amazonlinux:1
reason: "Shutting down artifactory: /usr/bin/java\nfinding\nUsing the default catalina management port (8015) to test shutdown\nArtifactory Tomcat already stopped"

View File

@@ -0,0 +1,35 @@
---
galaxy_info:
author: Robert de Bock
role_name: artifactory
description: Install and configure artifactory on your system.
license: Apache-2.0
company: none
min_ansible_version: 2.8
platforms:
- name: Debian
versions:
- all
- name: EL
versions:
- 7
- 8
- name: Fedora
versions:
- all
- name: OpenSUSE
versions:
- all
- name: Ubuntu
versions:
- bionic
galaxy_tags:
- artifactory
- centos
- redhat
- server
- system
dependencies: []

View File

@@ -0,0 +1,2 @@
---
tox_parallel: yes

View File

@@ -0,0 +1,6 @@
---
project_name: JFrog
reference: "https://github.com/robertdebock/ansible-role-artifactory/blob/master/defaults/main.yml"
versions:
- name: Artifactory
url: "https://releases.jfrog.io/artifactory/"

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,158 @@
---
# 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: ensure efs plugin folder exists
file:
path: "/efsmount/plugins"
state: directory
become: yes
- name: symlink plugin folder to EFS
file:
src: "/efsmount/plugins"
path: "{{ artifactory_home }}/var/etc/artifactory/plugins"
state: link
force: yes
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

View File

@@ -0,0 +1,6 @@
{% if artifactory_licenses_dict %}
{% for key in (artifactory_licenses_dict.keys() | select('match', '^ArtifactoryLicense\d$')) %}
{{ artifactory_licenses_dict[key] }}
{% endfor %}
{% endif %}

View File

@@ -0,0 +1,8 @@
{% if artifactory_licenses_dict %}
{% for key in (artifactory_licenses_dict.keys() | select('match', '^ArtifactoryLicense\d$')) %}
{% if loop.first %}
{{ artifactory_licenses_dict[key] }}
{% endif %}
{% endfor %}
{% endif %}

View File

@@ -0,0 +1,14 @@
<config version="2">
<chain>
<provider id="cache-fs" type="cache-fs">
<provider id="s3-storage-v3" type="s3-storage-v3"/>
</provider>
</chain>
<provider id="s3-storage-v3" type="s3-storage-v3">
<endpoint>s3.{{ s3_region }}.amazonaws.com</endpoint>
<bucketName>{{ s3_bucket }}</bucketName>
<path>artifactory/filestore</path>
<region>{{ s3_region }}</region>
<useInstanceCredentials>true</useInstanceCredentials>
</provider>
</config>

View File

@@ -0,0 +1,8 @@
{
"productId": "{{ product_id }}",
"features": [
{
"featureId": "Partner/ACC-006973"
}
]
}

View File

@@ -0,0 +1,41 @@
## @formatter:off
## JFROG ARTIFACTORY SYSTEM CONFIGURATION FILE
## HOW TO USE: comment-out any field and keep the correct yaml indentation by deleting only the leading '#' character.
configVersion: 1
## NOTE: JFROG_HOME is a place holder for the JFrog root directory containing the deployed product, the home directory for all JFrog products.
## Replace JFROG_HOME with the real path! For example, in RPM install, JFROG_HOME=/opt/jfrog
## NOTE: Sensitive information such as passwords and join key are encrypted on first read.
## NOTE: The provided commented key and value is the default.
## SHARED CONFIGURATIONS
## A shared section for keys across all services in this config
shared:
## Java options
extraJavaOpts: "{{ extra_java_opts }}"
## Node Settings
node:
## A unique id to identify this node.
## Default: auto generated at startup.
id: {{ ansible_machine_id }}
## Sets this node as primary in HA installation
# primary: {{ artifactory_is_primary }}
Affinity: "any"
## Sets this node as part of HA installation
haEnabled: {{ artifactory_ha_enabled }}
## Database Configuration
database:
## One of: mysql, oracle, mssql, postgresql, mariadb
## Default: Embedded derby
## Example for mysql/postgresql
type: "{{ db_type }}"
driver: "{{ db_driver }}"
url: "{{ db_url }}"
username: "{{ db_user }}"
password: "{{ db_password }}"