mirror of
https://github.com/ZwareBear/JFrog-Cloud-Installers.git
synced 2026-01-21 09:06:57 -06:00
updated containers, self published and MP to 7.18.6
This commit is contained in:
@@ -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/
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# defaults file for xray
|
||||
# indicates were this collection was downlaoded from (galaxy, automation_hub, standalone)
|
||||
ansible_marketplace: standalone
|
||||
|
||||
# The version of xray to install
|
||||
xray_version: 3.17.4
|
||||
|
||||
# whether to enable HA
|
||||
xray_ha_enabled: true
|
||||
|
||||
# The location where xray should install.
|
||||
xray_download_directory: /opt/jfrog
|
||||
|
||||
# whether to customer data directory
|
||||
use_custom_data_directory: false
|
||||
|
||||
# location for customer directory. Will be symlink to as artifactory/var
|
||||
custom_data_directory: /xray-user-data
|
||||
|
||||
# The remote xray download file
|
||||
xray_tar: https://releases.jfrog.io/artifactory/jfrog-xray/xray-linux/{{ xray_version }}/jfrog-xray-{{ xray_version }}-linux.tar.gz
|
||||
|
||||
#The xray install directory
|
||||
xray_home: "{{ xray_download_directory }}/jfrog-xray-{{ xray_version }}-linux"
|
||||
|
||||
#xray users and groups
|
||||
xray_user: xray
|
||||
xray_group: xray
|
||||
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for xray
|
||||
@@ -0,0 +1,53 @@
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your role description
|
||||
company: your company (optional)
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
# issue_tracker_url: http://example.com/issue/tracker
|
||||
|
||||
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||
# - BSD-3-Clause (default)
|
||||
# - MIT
|
||||
# - GPL-2.0-or-later
|
||||
# - GPL-3.0-only
|
||||
# - Apache-2.0
|
||||
# - CC-BY-4.0
|
||||
license: license (GPL-2.0-or-later, MIT, etc)
|
||||
|
||||
min_ansible_version: 2.9
|
||||
|
||||
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||
# min_ansible_container_version:
|
||||
|
||||
#
|
||||
# Provide a list of supported platforms, and for each platform a list of versions.
|
||||
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
||||
# To view available platforms and versions (or releases), visit:
|
||||
# https://galaxy.ansible.com/api/v1/platforms/
|
||||
#
|
||||
# platforms:
|
||||
# - name: Fedora
|
||||
# versions:
|
||||
# - all
|
||||
# - 25
|
||||
# - name: SomePlatform
|
||||
# versions:
|
||||
# - all
|
||||
# - 1.0
|
||||
# - 7
|
||||
# - 99.99
|
||||
|
||||
galaxy_tags: []
|
||||
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||
# remove the '[]' above, if you add tags to this list.
|
||||
#
|
||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
dependencies: []
|
||||
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||
# if you add dependencies to this list.
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
- name: Install db5.3-util
|
||||
apt:
|
||||
deb: "{{ xray_home }}/app/third-party/misc/db5.3-util_5.3.28-3ubuntu3_amd64.deb"
|
||||
ignore_errors: yes
|
||||
become: yes
|
||||
|
||||
- name: Install db-util
|
||||
apt:
|
||||
deb: "{{ xray_home }}/app/third-party/misc/db-util_1_3a5.3.21exp1ubuntu1_all.deb"
|
||||
ignore_errors: yes
|
||||
become: yes
|
||||
|
||||
- name: Install libssl
|
||||
apt:
|
||||
deb: "{{ xray_home }}/app/third-party/rabbitmq/libssl1.1_1.1.0j-1_deb9u1_amd64.deb"
|
||||
ignore_errors: yes
|
||||
become: yes
|
||||
|
||||
- name: Install socat
|
||||
apt:
|
||||
deb: "{{ xray_home }}/app/third-party/rabbitmq/socat_1.7.3.1-2+deb9u1_amd64.deb"
|
||||
become: yes
|
||||
|
||||
- name: Install libwxbase3.0-0v5
|
||||
apt:
|
||||
name: libwxbase3.0-0v5
|
||||
update_cache: yes
|
||||
state: present
|
||||
ignore_errors: yes
|
||||
become: yes
|
||||
|
||||
- name: Install erlang
|
||||
apt:
|
||||
deb: "{{ xray_home }}/app/third-party/rabbitmq/esl-erlang_21.2.1-1~ubuntu~xenial_amd64.deb"
|
||||
become: yes
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: Install db-utl
|
||||
yum:
|
||||
name: "{{ xray_home }}/app/third-party/misc/libdb-utils-5.3.21-19.el7.x86_64.rpm"
|
||||
state: present
|
||||
vars:
|
||||
ansible_python_interpreter: /bin/python2
|
||||
|
||||
- name: Install socat
|
||||
yum:
|
||||
name: "{{ xray_home }}/app/third-party/rabbitmq/socat-1.7.3.2-2.el7.x86_64.rpm"
|
||||
state: present
|
||||
vars:
|
||||
ansible_python_interpreter: /bin/python2
|
||||
|
||||
- name: Install erlang
|
||||
yum:
|
||||
name: "{{ xray_home }}/app/third-party/rabbitmq/erlang-23.2.7-1.el7.x86_64.rpm"
|
||||
state: present
|
||||
vars:
|
||||
ansible_python_interpreter: /bin/python2
|
||||
@@ -0,0 +1,44 @@
|
||||
- name: setup directory symlink for using custom data directory/volume
|
||||
block:
|
||||
- name: Create a xfs filesystem on /dev/nvme1n1
|
||||
# First non-root device is always mapped to /dev/nvme1n1
|
||||
# See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html
|
||||
community.general.filesystem:
|
||||
dev: /dev/nvme1n1
|
||||
fstype: xfs
|
||||
|
||||
- name: ensure external data directory exists
|
||||
file:
|
||||
path: "{{ custom_data_directory }}"
|
||||
state: directory
|
||||
|
||||
- name: Mount the EBS volume
|
||||
ansible.posix.mount:
|
||||
path: "{{ custom_data_directory }}"
|
||||
src: /dev/nvme1n1
|
||||
state: mounted
|
||||
fstype: xfs
|
||||
|
||||
- name: set custom data directory permission
|
||||
file:
|
||||
path: "{{ custom_data_directory }}"
|
||||
state: directory
|
||||
recurse: yes
|
||||
owner: "{{ xray_user }}"
|
||||
group: "{{ xray_group }}"
|
||||
mode: "u=rwX,g=rwX,o=rwX"
|
||||
|
||||
- name: remove var directory if exists
|
||||
file:
|
||||
path: "{{ xray_home }}/var"
|
||||
state: absent
|
||||
|
||||
- name: symlink custom data directory to var
|
||||
file:
|
||||
src: "{{ custom_data_directory }}"
|
||||
path: "{{ xray_home }}/var"
|
||||
state: link
|
||||
owner: "{{ xray_user }}"
|
||||
group: "{{ xray_group }}"
|
||||
become: yes
|
||||
when: use_custom_data_directory and custom_data_directory is defined
|
||||
@@ -0,0 +1,52 @@
|
||||
- name: initialize Postgres DB
|
||||
block:
|
||||
- name: check if user/role exists
|
||||
command: psql -A -t {{db_master_url}} -c "SELECT 1 FROM pg_roles WHERE rolname='{{db_user}}'"
|
||||
register: user_exists
|
||||
|
||||
- debug:
|
||||
var: user_exists.stdout_lines
|
||||
|
||||
- name: create user/role
|
||||
command: psql {{db_master_url}} -c "CREATE USER {{db_user}} WITH PASSWORD '{{db_password}}'"
|
||||
register: shell_output
|
||||
when: user_exists.stdout != "1"
|
||||
|
||||
- debug:
|
||||
var: shell_output.stdout_lines
|
||||
when: user_exists.stdout != "1"
|
||||
|
||||
- name: grant membership role
|
||||
command: psql {{db_master_url}} -c "GRANT {{db_user}} TO {{db_master_user}}"
|
||||
register: shell_output
|
||||
when: user_exists.stdout != "1"
|
||||
|
||||
- debug:
|
||||
var: shell_output.stdout_lines
|
||||
when: user_exists.stdout != "1"
|
||||
|
||||
- name: check if xraydb exists
|
||||
command: psql -A -t {{db_master_url}} -c "SELECT 1 FROM pg_database WHERE datname='xraydb'"
|
||||
register: db_exists
|
||||
|
||||
- debug:
|
||||
var: db_exists.stdout_lines
|
||||
|
||||
- name: create xraydb database
|
||||
command: psql {{db_master_url}} -c "CREATE DATABASE xraydb WITH OWNER={{db_user}} ENCODING='UTF8'"
|
||||
register: shell_output
|
||||
when: db_exists.stdout != "1"
|
||||
|
||||
- debug:
|
||||
var: shell_output.stdout_lines
|
||||
when: db_exists.stdout != "1"
|
||||
|
||||
- name: grant xraydb privileges to role
|
||||
command: psql {{db_master_url}} -c "GRANT ALL PRIVILEGES ON DATABASE xraydb TO {{db_user}}"
|
||||
register: shell_output
|
||||
when: db_exists.stdout != "1"
|
||||
|
||||
- debug:
|
||||
var: shell_output.stdout_lines
|
||||
when: db_exists.stdout != "1"
|
||||
become: yes
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
- name: initialize postgres database
|
||||
include_tasks: initialize-pg-db.yml
|
||||
|
||||
- name: create group for xray
|
||||
group:
|
||||
name: "{{ xray_group }}"
|
||||
state: present
|
||||
become: yes
|
||||
|
||||
- name: create user for xray
|
||||
user:
|
||||
name: "{{ xray_user }}"
|
||||
group: "{{ xray_group }}"
|
||||
system: yes
|
||||
become: yes
|
||||
|
||||
- name: ensure xray_download_directory exists
|
||||
file:
|
||||
path: "{{ xray_download_directory }}"
|
||||
state: directory
|
||||
become: yes
|
||||
|
||||
- name: perform prerequisite installation
|
||||
include_tasks: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: setup directory symlink for using custom data directory/volume
|
||||
include_tasks: custom-data-directory.yml
|
||||
when: use_custom_data_directory and custom_data_directory is defined
|
||||
|
||||
- name: ensure data subdirectories exist and have correct ownership
|
||||
file:
|
||||
path: "{{ xray_home }}/var/{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ xray_user }}"
|
||||
group: "{{ xray_group }}"
|
||||
loop:
|
||||
- "etc"
|
||||
- "data"
|
||||
- "etc/info"
|
||||
- "etc/security"
|
||||
become: yes
|
||||
|
||||
- name: configure system yaml
|
||||
template:
|
||||
src: system.yaml.j2
|
||||
dest: "{{ xray_home }}/var/etc/system.yaml"
|
||||
force: no # only create if file doesn't exist
|
||||
become: yes
|
||||
|
||||
- name: configure master key
|
||||
template:
|
||||
src: master.key.j2
|
||||
dest: "{{ xray_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: "{{ xray_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: "{{ xray_home }}/var/etc/info/installer-info.json"
|
||||
force: no # only create if file doesn't exist
|
||||
become: yes
|
||||
|
||||
- name: create xray service
|
||||
shell: "{{ xray_home }}/app/bin/installService.sh"
|
||||
become: yes
|
||||
|
||||
- name: start and enable xray
|
||||
service:
|
||||
name: xray
|
||||
state: restarted
|
||||
become: yes
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"productId": "Ansible_artifactory/1.0.0",
|
||||
"features": [
|
||||
{
|
||||
"featureId": "Partner/ACC-006973"
|
||||
},
|
||||
{
|
||||
"featureId": "Channel/{{ ansible_marketplace }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{{ join_key }}
|
||||
@@ -0,0 +1 @@
|
||||
{{ master_key }}
|
||||
@@ -0,0 +1,39 @@
|
||||
## @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:
|
||||
## Base URL of the JFrog Platform Deployment (JPD)
|
||||
## This is the URL to the machine where JFrog Artifactory is deployed, or the load balancer pointing to it. It is recommended to use DNS names rather than direct IPs.
|
||||
## Examples: "http://jfrog.acme.com" or "http://10.20.30.40:8082"
|
||||
jfrogUrl: {{ jfrog_url }}
|
||||
|
||||
## 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 }}
|
||||
|
||||
## 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 }}"
|
||||
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- xray
|
||||
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for xray
|
||||
Reference in New Issue
Block a user