Added ARM, AWS templates and pipelines.

This commit is contained in:
jefferyfry
2020-04-28 21:10:29 -07:00
parent 38d2524ee1
commit 4e9153dffa
156 changed files with 5757 additions and 725 deletions

View File

@@ -1,52 +0,0 @@
# rt7ansible
This repo contains the Ansible collection for JFrog Artifactory Pro 7 roles. These roles allow you to provision Artifactory for High-Availability using a Primary node and multiple Secondary nodes. Additionally, a Postgresql role is provided for installing an Artifactory Postgresql database.
## Roles Provided
### artifactory
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 and artifactory-java to install nginx and java dependencies.
### artifactory-nginx-ssl
The artifactory-nginx-ssl role installs and configures nginx for SSL.
### artifactory-postgres
The artifactory-postgres role will install Postgresql software and configure an artifactory database and user.
## Vars Required
The following Vars must be configured.
### all
* ansible_user: The SSH user to access the hosts. eg. "ubuntu"
* ansible_ssh_private_key_file: The SSH key to use. eg. "/Users/jefff/.ssh/jeff-ec2-us-east.pem"
* db_user: The Artifactory database user to configure. eg. "artifactory"
* db_password: The Artifactory database password to configure. "Art1fact0ry"
* server_name: This is the server name. eg. "artifactory.54.175.51.178.xip.io"
### artifactory
* master_key: This is the Artifactory Master Key.
* join_key: This is the Artifactory Join Key.
* db_download_url: This is the download URL for the JDBC driver for your database. eg. "https://jdbc.postgresql.org/download/postgresql-42.2.12.jar"
* db_type: This is the database type. eg. "postgresql"
* db_driver: This is the JDBC driver class. eg. "org.postgresql.Driver"
* db_url: This is the JDBC database url. eg. "jdbc:postgresql://10.0.0.120:5432/artifactory"
### primary
* artifactory_is_primary: For the primary node this must be set to **true**.
* artifactory_license1 - 5: These are the cluster licenses.
### secondary
* artifactory_is_primary: For the secondary node(s) this must be set to **false**.
### SSL Config (Used with artifactory-nginx-ssl role)
* certificate: This is the SSL cert.
* certificate_key: This is the SSL private key.
### Example Inventory YAML
An example inventory YAM is [here](hosts.yml).
### Example Playbook
An playbook is [here](rt7provision.yml).
## Executing a Playbook
```
ansible-playbook -i hosts.yml rt7provision.yml
```

View File

@@ -1,8 +0,0 @@
[defaults]
# Installs collections into [current dir]/ansible_collections/namespace/collection_name
collections_paths = ./
# Installs roles into [current dir]/roles/namespace.rolename
roles_path = ./jfrog/rt7ansible/roles
host_key_checking = false

View File

@@ -1,125 +0,0 @@
---
all:
vars:
ansible_user: "ubuntu"
ansible_ssh_private_key_file: "/Users/jefff/.ssh/jeff-ansible-ec2.pem"
db_user: "artifactory"
db_password: "Art1fAct0ry"
children:
database:
hosts:
100.26.167.170:
artifactory:
vars:
master_key: "c97b862469de0d94fbb7d48130637a5a"
join_key: "9bcca98f375c0728d907cc6ee39d4f02"
db_download_url: "https://jdbc.postgresql.org/download/postgresql-42.2.12.jar"
db_type: "postgresql"
db_driver: "org.postgresql.Driver"
db_url: "jdbc:postgresql://10.0.0.160:5432/artifactory"
server_name: "ec2-100-25-104-198.compute-1.amazonaws.com"
certificate: |
-----BEGIN CERTIFICATE-----
MIIF8zCCA9ugAwIBAgIJAK/iP1hhhVNKMA0GCSqGSIb3DQEBCwUAMHUxCzAJBgNV
BAYTAlVTMQswCQYDVQQIDAJXQTEQMA4GA1UEBwwHU2VhdHRsZTESMBAGA1UECgwJ
Q2xvdWRCZWVzMTMwMQYDVQQDDCplYzItMTAwLTI1LTEwNC0xOTguY29tcHV0ZS0x
LmFtYXpvbmF3cy5jb20wHhcNMjAwNDI5MDM1OTIxWhcNMjIwODAyMDM1OTIxWjB1
MQswCQYDVQQGEwJVUzELMAkGA1UECAwCV0ExEDAOBgNVBAcMB1NlYXR0bGUxEjAQ
BgNVBAoMCUNsb3VkQmVlczEzMDEGA1UEAwwqZWMyLTEwMC0yNS0xMDQtMTk4LmNv
bXB1dGUtMS5hbWF6b25hd3MuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
CgKCAgEAn92BnDtr7fUbtGF0uPmsk7OWDtyY+ElLvq9Borp10AUtLllXGB4Ap6Xf
HoZy943wi+d+pVf3S/oElnAsRlbEUwOSL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IY0xh6CZ+AAFLwTO26g8
MrCWPKZv6r646O4zxFhRPNZi0OIFJOO5OUY8gUhC0bcJ8ZSJU7Wzczl4AgcLNs5n
WgW2uxfW5ft1CRsyTkQytaYznBQlvnhKUZczHRp23qxYJNEhv31fRdqXaiYalUne
PsECggEAOJZJwvvxi74HZI5rkdJBN3fXfo1zaZuTs+wDUXhcQreLy3sBSoX3eSVm
grnrIBsxw3oDqp+Mg++aCrr4GM2Jiymbogg1aN11MT7oFLhKWLKW6JrUT9Av4KYp
LFbXCuaEgMk60bKNbNcAI378gEHq8I352q/ezWnQys/PtVuUx3VwsPnuvUypEAuL
90RgMx7g46Q3GC7TQmlqNyaEDaVGY2PYSQZjNje8TTf7pJopue/9KF1cTyN2pgpz
i6ZGjYpEzFf484iIOxv1HWndfvcQg6y+rw1n08sR8bh759YFrv8fz/vxou7m9BUL
wE0kp6bIPqO7luLz5sqjxGiSRTiWSQ==
-----END PRIVATE KEY-----
children:
primary:
hosts:
100.25.104.198:
vars:
artifactory_is_primary: true
artifactory_license1: cHJvZHVjdHM6CiAgYXJ0aWZhY3Rvcnk6CiAgICBwcm9kdWN0OiBaWGh3YVhKbGN6b2dNakF5TUMwd055MHdNbFF3TURvd01Eb3dNRm9LYVdRNklHSTJaakk0TURsakxXVXhNakV0TkdOa01TMWlNRGczTFdVMk5tSmlNVGxrTlRjMlpRcHZkMjVsY2pvZ1NrWnliMmNnVkVWVFZBcHdjbTl3WlhKMGFXVnpPaUI3ZlFwemFXZHVZWFIxY21VNklHNTFiR3dLZEhKcFlXdzZJSFJ5ZFdVS2RIbHdaVG9nVkZKSlFVd0tkbUZzYVdSR2NtOXRPaUF5TURJd0xUQXhMVEF5VkRJeE9qQXdPalE1TGpBd09Gb0sKICAgIHNpZ25hdHVyZTogU20vVlV1a3dnVTRlaEtHVmpwbE9XUHB5SzJpcS9pUVdjNklPOXdhNCtYdUR6SERrTFlPRFpkdm80bWxtU0d3NFVlak1mUXRiczFQbW8rTndnZERJbHVHQ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Tnpnd01RcHZkMjVsY2pvZ1NrWnliMmNnVkVWVFZBcHdjbTl3WlhKMGFXVnpPaUI3ZlFwemFXZHVZWFIxY21VNklHNTFiR3dLZEhKcFlXdzZJSFJ5ZFdVS2RIbHdaVG9nVkZKSlFVd0tkbUZzYVdSR2NtOXRPaUF5TURJd0xUQXhMVEF5VkRJeE9qQXdPalE1TGpBM09Wb0sKICAgIHNpZ25hdHVyZTogYytEdkJWNXdiRlRnUEFxT0VFWDU0S3IwQWlMWUVNNTJuRHNUcGI4OHNXdmIxTGl1YlRvdXA0NXNMVU9aTnZvVlFuM2szREw4MTFQdHU1WUM5T3dVNXdTNDVkTkQrZHNLREN3eTE4T0c3SU05ZHZ6bml2RU5mb2xsL2VFMTNtazZVS0RLQmhXUkxlYjVvM0tIbkZGRTRTZ004UVNRNGFsWnA5cjA3aUJTUVRrVkxPVnliTUJtSFpkMVJlSmUwcTN0TXZGUVNFNTJHU3FzaURkZ0lVQTVjL1lUQVVnclRoc1lCRVpJQmJCTXVITnNSay9rZHRobmRHWitsQnB0bzlHR25HQ3EzZ0lOQU94Q2tHSnlvMWpGK28xMi9tR3Q1NnVocXVJN2s3SzMzMUpvMGl1L2VWWkxOWEtGNjl5OEE2K0dyMnVheExEajQwaGYwU0pHZ3FESVdBPT0KdmVyc2lvbjogMQo=
# secondary:
# hosts:
# 54.160.107.157:
# 35.153.79.44:
# vars:
# artifactory_is_primary: false

View File

@@ -1,33 +0,0 @@
---
language: python
services: docker
env:
global:
- ROLE_NAME: java
matrix:
- MOLECULE_DISTRO: centos8
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: centos6
- MOLECULE_DISTRO: fedora31
- MOLECULE_DISTRO: ubuntu1804
- MOLECULE_DISTRO: ubuntu1604
- MOLECULE_DISTRO: debian10
- MOLECULE_DISTRO: debian9
install:
# Install test dependencies.
- pip install molecule yamllint ansible-lint docker
before_script:
# Use actual Ansible Galaxy role name for the project directory.
- cd ../
- mv ansible-role-$ROLE_NAME geerlingguy.$ROLE_NAME
- cd geerlingguy.$ROLE_NAME
script:
# Run tests.
- molecule test
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@@ -1,6 +0,0 @@
---
extends: default
rules:
line-length:
max: 120
level: warning

View File

@@ -1,6 +0,0 @@
---
# Set java_packages if you would like to use a different version than the
# default for the OS (see defaults per OS in `vars` directory).
# java_packages: []
java_home: ""

View File

@@ -1,42 +0,0 @@
---
dependencies: []
galaxy_info:
role_name: java
author: geerlingguy
description: Java for Linux
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.4
platforms:
- name: EL
versions:
- 6
- 7
- 8
- name: Fedora
versions:
- all
- name: Debian
versions:
- wheezy
- jessie
- stretch
- buster
- name: Ubuntu
versions:
- precise
- trusty
- xenial
- bionic
- name: FreeBSD
versions:
- 10.2
galaxy_tags:
- development
- system
- web
- java
- jdk
- openjdk
- oracle

View File

@@ -1,41 +0,0 @@
---
- name: Include OS-specific variables for Fedora or FreeBSD.
include_vars: "{{ ansible_distribution }}.yml"
when: ansible_distribution == 'FreeBSD' or ansible_distribution == 'Fedora'
- name: Include version-specific variables for CentOS/RHEL.
include_vars: "RedHat-{{ ansible_distribution_version.split('.')[0] }}.yml"
when: ansible_distribution == 'CentOS' or
ansible_distribution == 'Red Hat Enterprise Linux' or
ansible_distribution == 'RedHat'
- name: Include version-specific variables for Ubuntu.
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
when: ansible_distribution == 'Ubuntu'
- name: Include version-specific variables for Debian.
include_vars: "{{ ansible_distribution|title }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
when: ansible_os_family == 'Debian'
- name: Define java_packages.
set_fact:
java_packages: "{{ __java_packages | list }}"
when: java_packages is not defined
# Setup/install tasks.
- include_tasks: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
- include_tasks: setup-Debian.yml
when: ansible_os_family == 'Debian'
- include_tasks: setup-FreeBSD.yml
when: ansible_os_family == 'FreeBSD'
# Environment setup.
- name: Set JAVA_HOME if configured.
template:
src: java_home.sh.j2
dest: /etc/profile.d/java_home.sh
mode: 0644
when: java_home is defined and java_home

View File

@@ -1,18 +0,0 @@
---
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199 and
# https://github.com/geerlingguy/ansible-role-java/issues/64
- name: Ensure 'man' directory exists.
file:
path: /usr/share/man/man1
state: directory
recurse: true
when:
- ansible_distribution == 'Ubuntu'
- ansible_distribution_version == '18.04'
- name: Ensure Java is installed.
apt:
update_cache: yes
name: "{{ java_packages }}"
state: present
become: true

View File

@@ -1,12 +0,0 @@
---
- name: Ensure Java is installed.
pkgng:
name: "{{ java_packages }}"
state: present
become: true
- name: ensure proc is mounted
mount: name=/proc fstype=procfs src=proc opts=rw state=mounted
- name: ensure fdesc is mounted
mount: name=/dev/fd fstype=fdescfs src=fdesc opts=rw state=mounted

View File

@@ -1,6 +0,0 @@
---
- name: Ensure Java is installed.
package:
name: "{{ java_packages }}"
state: present
become: true

View File

@@ -1 +0,0 @@
export JAVA_HOME={{ java_home }}

View File

@@ -1,6 +0,0 @@
---
# JDK version options include:
# - java
# - openjdk-11-jdk
__java_packages:
- openjdk-11-jdk

View File

@@ -1,7 +0,0 @@
---
# JDK version options include:
# - java
# - openjdk-6-jdk
# - openjdk-7-jdk
__java_packages:
- openjdk-7-jdk

View File

@@ -1,6 +0,0 @@
---
# JDK version options include:
# - java
# - openjdk-8-jdk
__java_packages:
- openjdk-8-jdk

View File

@@ -1,6 +0,0 @@
---
# JDK version options include:
# - java
# - java-1.8.0-openjdk
__java_packages:
- java-1.8.0-openjdk

View File

@@ -1,7 +0,0 @@
---
# JDK version options for FreeBSD include:
# - openjdk
# - openjdk6
# - openjdk8
__java_packages:
- openjdk

View File

@@ -1,7 +0,0 @@
---
# JDK version options include:
# - java
# - java-1.6.0-openjdk
# - java-1.7.0-openjdk
__java_packages:
- java-1.7.0-openjdk

View File

@@ -1,8 +0,0 @@
---
# JDK version options include:
# - java
# - java-1.6.0-openjdk
# - java-1.7.0-openjdk
# - java-1.8.0-openjdk
__java_packages:
- java-1.8.0-openjdk

View File

@@ -1,7 +0,0 @@
---
# JDK version options include:
# - java-1.8.0-openjdk
# - java-11-openjdk
# - java-latest-openjdk
__java_packages:
- java-11-openjdk

View File

@@ -1,7 +0,0 @@
---
# JDK version options include:
# - java
# - openjdk-6-jdk
# - openjdk-7-jdk
__java_packages:
- openjdk-7-jdk

View File

@@ -1,7 +0,0 @@
---
# JDK version options include:
# - java
# - openjdk-6-jdk
# - openjdk-7-jdk
__java_packages:
- openjdk-7-jdk

View File

@@ -1,7 +0,0 @@
---
# JDK version options include:
# - java
# - openjdk-8-jdk
# - openjdk-9-jdk
__java_packages:
- openjdk-8-jdk

View File

@@ -1,6 +0,0 @@
---
# JDK version options include:
# - java
# - openjdk-11-jdk
__java_packages:
- openjdk-11-jdk

View File

@@ -1,17 +0,0 @@
---
artifactory_tar: https://dl.bintray.com/jfrog/artifactory-pro/org/artifactory/pro/jfrog-artifactory-pro/{{ artifactory_version }}/jfrog-artifactory-pro-{{ artifactory_version }}-linux.tar.gz
artifactory_home: "{{ artifactory_download_directory }}/artifactory-{{ artifactory_flavour }}-{{ 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 }}"

View File

@@ -1,38 +0,0 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View File

@@ -1,2 +0,0 @@
---
# defaults file for xray-postgres

View File

@@ -1,2 +0,0 @@
---
# handlers file for xray-postgres

View File

@@ -1,2 +0,0 @@
---
# tasks file for xray-postgres

View File

@@ -1,5 +0,0 @@
---
- hosts: localhost
remote_user: root
roles:
- xray-postgres

View File

@@ -1,2 +0,0 @@
---
# vars file for xray-postgres

View File

@@ -1,29 +0,0 @@
---
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

@@ -1,38 +0,0 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View File

@@ -1,2 +0,0 @@
---
# defaults file for xray

View File

@@ -1,53 +0,0 @@
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.

View File

@@ -1,2 +0,0 @@
---
# tasks file for xray

View File

@@ -1,11 +0,0 @@
---
- hosts: database
gather_facts: true
roles:
- jfrog/rt7ansible/roles/artifactory-postgres
- hosts: primary:secondary
gather_facts: true
roles:
- jfrog/rt7ansible/roles/artifactory
- jfrog/rt7ansible/roles/artifactory-nginx-ssl

54
Ansible/awsPipelines.yaml Normal file
View File

@@ -0,0 +1,54 @@
resources:
- name: ansibleRepo
type: GitRepo
configuration:
gitProvider: jefferyfryGithub
path: jefferyfry/JFrog-Cloud-Installers
pipelines:
- name: ansible_aws_automation_pipeline
steps:
- name: execute_aws_ansible_playbook
type: Bash
configuration:
runtime:
type: image
image:
auto:
language: java
versions:
- "8"
integrations:
- name: ansibleAwsKeys
- name: ansibleEnvVars
- name: ansiblePrivateKey
inputResources:
- name: ansibleRepo
execution:
onStart:
- echo "Executing AWS Ansible playbook..."
onExecute:
- sudo apt-get update
- sudo apt-get install gnupg2
- sudo apt-get install software-properties-common
- sudo apt-add-repository --yes --update ppa:ansible/ansible
- sudo apt -y --allow-unauthenticated install ansible
- sudo pip install packaging
- sudo pip install boto3 botocore
- cd ../dependencyState/resources/ansibleRepo
- echo 'Setting environment variables...'
- export artifactory_license1="$int_ansibleEnvVars_artifactory_license1"
- export artifactory_license2="$int_ansibleEnvVars_artifactory_license2"
- export artifactory_license3="$int_ansibleEnvVars_artifactory_license3"
- export master_key="$int_ansibleEnvVars_master_key"
- export join_key="$int_ansibleEnvVars_join_key"
- export ssh_public_key_name="$int_ansibleEnvVars_ssh_public_key_name"
- export cfn_template="$int_ansibleEnvVars_cfn_template"
- export stack_name="$int_ansibleEnvVars_stack_name"
- export AWS_ACCESS_KEY_ID="$int_ansibleEnvVars_AWS_ACCESS_KEY_ID"
- export AWS_SECRET_KEY="$int_ansibleEnvVars_AWS_SECRET_KEY"
- printenv
- eval $(ssh-agent -s)
- ssh-add <(echo "$int_ansiblePrivateKey_key")
- ansible-playbook Ansible/test/aws/playbook.yaml
onComplete:
- echo "AWS Ansible playbook complete."

View File

@@ -0,0 +1,57 @@
resources:
- name: ansibleRepo
type: GitRepo
configuration:
gitProvider: jefferyfryGithub
path: jefferyfry/JFrog-Cloud-Installers
pipelines:
- name: ansible_azure_automation_pipeline
steps:
- name: execute_azure_ansible_playbook
type: Bash
configuration:
runtime:
type: image
image:
auto:
language: java
versions:
- "8"
integrations:
- name: ansibleAzureKeys
- name: ansibleEnvVars
- name: ansiblePrivateKey
inputResources:
- name: ansibleRepo
execution:
onStart:
- echo "Executing Azure Ansible playbook..."
onExecute:
- sudo apt-get update
- sudo apt-get install gnupg2
- sudo apt-get install software-properties-common
- sudo apt-add-repository --yes --update ppa:ansible/ansible
- sudo apt -y --allow-unauthenticated install ansible
- sudo pip install packaging
- sudo pip install msrestazure
- sudo pip install ansible[azure]
- cd ../dependencyState/resources/ansibleRepo
- echo 'Setting environment variables...'
- export artifactory_license1="$int_ansibleEnvVars_artifactory_license1"
- export artifactory_license2="$int_ansibleEnvVars_artifactory_license2"
- export artifactory_license3="$int_ansibleEnvVars_artifactory_license3"
- export master_key="$int_ansibleEnvVars_master_key"
- export join_key="$int_ansibleEnvVars_join_key"
- export ssh_public_key="$int_ansibleEnvVars_ssh_public_key"
- export arm_template="$int_ansibleEnvVars_arm_template"
- export azure_resource_group="$int_ansibleEnvVars_azure_resource_group"
- export clientId="$int_ansibleAzureKeys_appId"
- export clientSecret="$int_ansibleAzureKeys_password"
- export tenantId="$int_ansibleAzureKeys_tenant"
- printenv
- eval $(ssh-agent -s)
- ssh-add <(echo "$int_ansiblePrivateKey_key")
- az login --service-principal -u "$clientId" -p "$clientSecret" --tenant "$tenantId"
- ansible-playbook Ansible/test/azure/playbook.yaml
onComplete:
- echo "Azure Ansible playbook complete."

View File

@@ -0,0 +1,77 @@
# Ansible
This repo contains the Ansible collection for JFrog roles. These roles allow you to provision Artifactory for High-Availability using a Primary node and multiple Secondary nodes. Additionally, a Postgresql role is provided for installing an Artifactory Postgresql database.
## Roles Provided
### artifactory
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.
### artifactory-nginx-ssl
The artifactory-nginx-ssl role installs and configures nginx for SSL.
### postgres
The postgres role will install Postgresql software and configure a database and user to support an Artifactory or Xray server.
### xray
The xray role will install Xray software onto the host. An Artifactory server and Postgress database is required.
## Vars Required
The following Vars must be configured.
### databsase vars
* db_users: This is a list of database users to create. eg. db_users: - { db_user: "artifactory", db_password: "Art1fAct0ry" }
* dbs: This is the database to create. eg. dbs: - { db_name: "artifactory", db_owner: "artifactory" }
### artifactory vars
* artifactory_version: The version of Artifactory to install. eg. "7.4.1"
* master_key: This is the Artifactory Master Key.
* join_key: This is the Artifactory Join Key.
* db_download_url: This is the download URL for the JDBC driver for your database. eg. "https://jdbc.postgresql.org/download/postgresql-42.2.12.jar"
* db_type: This is the database type. eg. "postgresql"
* db_driver: This is the JDBC driver class. eg. "org.postgresql.Driver"
* db_url: This is the JDBC database url. eg. "jdbc:postgresql://10.0.0.120:5432/artifactory"
* db_user: The database user to configure. eg. "artifactory"
* db_password: The database password to configure. "Art1fact0ry"
* server_name: This is the server name. eg. "artifactory.54.175.51.178.xip.io"
### primary vars
* artifactory_is_primary: For the primary node this must be set to **true**.
* artifactory_license1 - 5: These are the cluster licenses.
### secondary vars
* artifactory_is_primary: For the secondary node(s) this must be set to **false**.
### ssl vars (Used with artifactory-nginx-ssl role)
* certificate: This is the SSL cert.
* certificate_key: This is the SSL private key.
### xray vars
* xray_version: The version of Artifactory to install. eg. "3.3.0"
* jfrog_url: This is the URL to the Artifactory base URL. eg. "http://ec2-54-237-207-135.compute-1.amazonaws.com"
* master_key: This is the Artifactory Master Key.
* join_key: This is the Artifactory Join Key.
* db_type: This is the database type. eg. "postgresql"
* db_driver: This is the JDBC driver class. eg. "org.postgresql.Driver"
* db_url: This is the database url. eg. "postgres://10.0.0.59:5432/xraydb?sslmode=disable"
* db_user: The database user to configure. eg. "xray"
* db_password: The database password to configure. "xray"
## Example Inventory and Playbooks
Example playbooks are located in the [project](../project) directory. This directory contains several example inventory and plaaybooks for different Artifactory, HA and Xray architectures.
## Executing a Playbook
```
ansible-playbook -i <hosts file> <playbook file>
eg.
ansible-playbook -i example-playbooks/rt-xray-ha/hosts.yml example-playbooks/rt-xray-ha/playbook.yml
```
## Bastion Hosts
In many cases, you may want to run this Ansible collection through a Bastion host to provision JFrog servers. You can include the following Var for a host or group of hosts:
```
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -A user@host -W %h:%p"'
eg.
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -A ubuntu@{{ azureDeployment.deployment.outputs.lbIp.value }} -W %h:%p"'
```

View File

@@ -6,7 +6,7 @@
namespace: jfrog
# The name of the collection. Has the same character restrictions as 'namespace'
name: rt7ansible
name: ansible
# The version of the collection. Must be compatible with semantic versioning
version: 1.0.0

View File

@@ -7,35 +7,35 @@
owner: root
group: root
mode: '0755'
become: true
become: yes
- name: ensure nginx dir exists
file:
path: "/var/opt/jfrog/nginx/ssl"
state: directory
become: true
become: yes
- name: configure certificate
template:
src: certificate.pem.j2
dest: "/var/opt/jfrog/nginx/ssl/cert.pem"
become: true
become: yes
- name: ensure pki exists
file:
path: "/etc/pki/tls"
state: directory
become: true
become: yes
- name: configure key
template:
src: certificate.key.j2
dest: "/etc/pki/tls/cert.key"
become: true
become: yes
- name: restart nginx
service:
name: nginx
state: restarted
enabled: yes
become: true
become: yes

View File

@@ -1,10 +1,13 @@
---
# tasks file for artifactory-nginx
- name: install nginx
package:
name: nginx
state: present
become: true
register: package_res
retries: 5
delay: 60
become: yes
until: package_res is success
- name: configure main nginx conf file.
copy:
@@ -13,7 +16,7 @@
owner: root
group: root
mode: '0755'
become: true
become: yes
- name: configure the artifactory nginx conf
template:
@@ -22,11 +25,11 @@
owner: root
group: root
mode: '0755'
become: true
become: yes
- name: restart nginx
service:
name: nginx
state: restarted
enabled: yes
become: true
become: yes

View File

@@ -6,11 +6,18 @@ ansible_marketplace: standalone
# The version of Artifactory to install
artifactory_version: 7.4.1
# licenses
artifactory_license1:
artifactory_license2:
artifactory_license3:
artifactory_license4:
artifactory_license5:
# 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: false
artifactory_is_primary: true
# The location where Artifactory should install.
artifactory_download_directory: /opt/jfrog
@@ -24,6 +31,21 @@ artifactory_file_store_dir: /data
# https://dl.bintray.com/jfrog/artifactory-pro/org/artifactory/pro/jfrog-artifactory-pro/{{ artifactory_version }}/jfrog-artifactory-pro-{{ artifactory_version }}-linux.tar.gz
artifactory_flavour: pro
java_version: java-1.8.0
extra_java_opts: -server -Xms2g -Xmx14g -Xss256k -XX:+UseG1GC
artifactory_tar: https://dl.bintray.com/jfrog/artifactory-pro/org/artifactory/pro/jfrog-artifactory-pro/{{ artifactory_version }}/jfrog-artifactory-pro-{{ artifactory_version }}-linux.tar.gz
artifactory_home: "{{ artifactory_download_directory }}/artifactory-{{ artifactory_flavour }}-{{ 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 }}"

View File

@@ -1,9 +1,5 @@
---
# tasks file for artifactory
- name: install java
include_role:
name: artifactory-java
- name: install nginx
include_role:
name: artifactory-nginx
@@ -12,20 +8,20 @@
group:
name: "{{ artifactory_group }}"
state: present
become: true
become: yes
- name: create user for artifactory
user:
name: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
system: yes
become: true
become: yes
- name: ensure artifactory_download_directory exists
file:
path: "{{ artifactory_download_directory }}"
state: directory
become: true
become: yes
- name: download artifactory
unarchive:
@@ -35,7 +31,7 @@
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
creates: "{{ artifactory_home }}"
become: true
become: yes
register: downloadartifactory
until: downloadartifactory is succeeded
retries: 3
@@ -46,33 +42,41 @@
state: directory
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: true
become: yes
- name: ensure etc exists
file:
path: "{{ artifactory_home }}/etc"
path: "{{ artifactory_home }}/var/etc"
state: directory
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: true
become: yes
- name: configure system yaml
template:
src: system.yaml.j2
dest: "{{ artifactory_home }}/var/etc/system.yaml"
become: true
become: yes
- name: ensure {{ artifactory_home }}/var/etc/security/ exists
file:
path: "{{ artifactory_home }}/var/etc/security/"
state: directory
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes
- name: configure master key
template:
src: master.key.j2
dest: "{{ artifactory_home }}/var/etc/security/master.key"
become: true
become: yes
- name: configure join key
template:
src: join.key.j2
dest: "{{ artifactory_home }}/var/etc/security/join.key"
become: true
become: yes
- name: ensure {{ artifactory_home }}/var/etc/info/ exists
file:
@@ -80,25 +84,25 @@
state: directory
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: true
become: yes
- name: configure installer info
template:
src: installer-info.json.j2
dest: "{{ artifactory_home }}/var/etc/info/installer-info.json"
become: true
become: yes
- name: configure binary store
template:
src: binarystore.xml.j2
dest: "{{ artifactory_home }}/var/etc/binarystore.xml"
become: true
become: yes
- name: configure cluster license
template:
src: artifactory.cluster.license.j2
dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.cluster.license"
become: true
become: yes
when: artifactory_is_primary == true
- name: download database driver
@@ -107,17 +111,17 @@
dest: "{{ artifactory_home }}/var/bootstrap/artifactory/tomcat/lib"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: true
become: yes
- name: create artifactory service
shell: "{{ artifactory_home }}/app/bin/installService.sh"
become: true
become: yes
- name: start and enable the primary node
service:
name: artifactory
state: started
become: true
state: restarted
become: yes
when: artifactory_is_primary == true
- name: random wait before restarting to prevent secondary nodes from hitting DB first
@@ -128,6 +132,6 @@
- name: start and enable the secondary nodes
service:
name: artifactory
state: started
become: true
state: restarted
become: yes
when: artifactory_is_primary == false

View File

@@ -19,8 +19,13 @@
{% endif %}
{% if artifactory_license4 %}
{% if artifactory_license4|length %}
{{ artifactory_license4 }}
{% endif %}
{% endif %}
{% if artifactory_license5 %}
{% if artifactory_license5|length %}
{{ artifactory_license5 }}
{% endif %}
{% endif %}

View File

@@ -23,7 +23,7 @@ shared:
primary: {{ artifactory_is_primary }}
## Sets this node as part of HA installation
haEnabled: {{ true }}
haEnabled: {{ artifactory_ha_enabled }}
## Database Configuration
database:

View File

@@ -0,0 +1,2 @@
---

View File

@@ -1,27 +1,29 @@
---
- name: install python2 psycopg2
apt:
name: python-psycopg2
update_cache: yes
become: yes
- name: install ansible-related package
yum:
name:
- python3-psycopg2
- sudo
- wget
state: present
become: True
- name: install python3 psycopg2
apt:
name: python3-psycopg2
update_cache: yes
become: yes
- name: add postgres apt key
apt_key:
url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
id: "0x7FCC7D46ACCC4CF8"
state: present
become: True
become: yes
- name: register APT repository
apt_repository:
repo: deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main
state: present
filename: pgdg
become: True
become: yes
- name: install postgres packages
apt:
@@ -30,4 +32,4 @@
- postgresql-server-dev-{{ postgres_server_version }}
- postgresql-contrib-{{ postgres_server_version }}
state: present
become: True
become: yes

View File

@@ -5,9 +5,9 @@
when: > # not for Fedora
ansible_distribution == 'CentOS' or
ansible_distribution == 'Red Hat Enterprise Linux'
become: True
become: yes
- name: install ansible-related package
- name: install python2 psycopg2
yum:
name:
- python-psycopg2
@@ -15,7 +15,15 @@
- wget
- perl
state: present
become: True
- name: install python3 psycopg2
yum:
name:
- python3-psycopg2
- sudo
- wget
- perl
state: present
- name: fixup some locale issues
lineinfile:
@@ -52,7 +60,7 @@
yum:
name: "{{ base }}/{{ postgres_server_version }}/redhat/rhel-{{ ver }}-x86_64/{{ latest_version.stdout }}"
state: present
become: True
become: yes
- name: install postgres packages
yum:
@@ -61,4 +69,4 @@
- postgresql{{ postgres_server_pkg_version }}-contrib
- postgresql{{ postgres_server_pkg_version }}-devel
state: present
become: True
become: yes

View File

@@ -2,23 +2,11 @@
- name: define distribution-specific variables
include_vars: "{{ ansible_os_family }}.yml"
#- name: define postgres version-specific variables
# include_vars: "{{ lookup('first_found', params) }}"
# vars:
# params:
# files:
# - "{{ ansible_os_family }}_pg-{{ postgres_server_version }}.yml"
# - "{{ ansible_os_family }}_pg-default.yml"
# paths:
# - "vars"
# skip: true
# ignore_errors: true
- name: create directory for bind mount if necessary
file:
path: "{{ postgres_server_bind_mount_var_lib_pgsql_target }}"
state: directory
become: true
become: yes
when: postgres_server_bind_mount_var_lib_pgsql
@@ -29,7 +17,7 @@
opts: bind
state: mounted
fstype: none
become: true
become: yes
when: postgres_server_bind_mount_var_lib_pgsql
- name: perform installation
@@ -40,7 +28,7 @@
dest: /etc/profile.d/postgres-path.sh
mode: a=rx
content: "export PATH=$PATH:/usr/pgsql-{{ postgres_server_version }}/bin"
become: true
become: yes
- name: initialize PostgreSQL database cluster
environment:
@@ -71,37 +59,47 @@
name: "{{ postgres_server_service_name }}"
state: started
enabled: yes
become: true
become: yes
- name: Create artifactory users
- name: Hold until Postgresql is up and running
wait_for:
port: 5432
- name: Create users
become_user: postgres
become: true
become: yes
postgresql_user:
name: "{{ db_user }}"
password: "{{ db_password }}"
name: "{{ item.db_user }}"
password: "{{ item.db_password }}"
conn_limit: "-1"
loop: "{{ db_users|default([]) }}"
no_log: true # secret passwords
- name: Create a artifactory database
- name: Create a database
become_user: postgres
become: true
become: yes
postgresql_db:
name: artifactory
owner: "{{ db_user }}"
name: "{{ item.db_name }}"
owner: "{{ item.db_owner }}"
encoding: UTF-8
loop: "{{ dbs|default([]) }}"
- name: Grant privs to artifactory on artifactory db
- name: Grant privs on db
become_user: postgres
become: true
become: yes
postgresql_privs:
database: artifactory
role: artifactory
database: "{{ item.db_name }}"
role: "{{ item.db_owner }}"
state: present
privs: ALL
type: database
loop: "{{ dbs|default([]) }}"
- name: restart postgres
service:
name: "{{ postgres_server_service_name }}"
state: restarted
become: true
become: yes
- debug:
msg: "Restarted postgres service {{ postgres_server_service_name }}"

View File

@@ -1,7 +1,7 @@
---
postgres_server_cmd_initdb: /usr/lib/postgresql/{{ postgres_server_version }}/bin/initdb -D
postgres_server_initdb_become: True
postgres_server_initdb_become: yes
postgres_server_data_location: /var/lib/postgresql/{{ postgres_server_version }}/main
postgres_server_config_location: /etc/postgresql/{{ postgres_server_version }}/main
postgres_server_service_name: postgresql@{{ postgres_server_version }}-main

View File

@@ -1,4 +1,4 @@
---
postgres_server_cmd_initdb: /usr/pgsql-{{ postgres_server_version }}/bin/initdb -D /var/lib/pgsql/{{ postgres_server_version }}/data
postgres_server_initdb_become: true
postgres_server_initdb_become: yes

View File

@@ -0,0 +1,23 @@
---
# 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.3.0
# whether to enable HA
xray_ha_enabled: true
# The location where xray should install.
xray_download_directory: /opt/jfrog
# The remote xray download file
xray_tar: https://bintray.com/standAloneDownload/downloadArtifact?agree=true&artifactPath=/jfrog/jfrog-xray/xray-linux/{{ xray_version }}/jfrog-xray-{{ xray_version }}-linux.tar.gz&callback_id=anonymous&product=xray
#The xray install directory
xray_home: "{{ xray_download_directory }}/jfrog-xray-{{ xray_version }}-linux"
#xray users and groups
xray_user: xray
xray_group: xray

View File

@@ -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

View File

@@ -0,0 +1,16 @@
---
- name: Install db-utl
yum:
name: "{{ xray_home }}/app/third-party/misc/db4-utils-4.7.25-20.el6_7.x86_64.rpm"
state: present
- name: Install socat
yum:
name: "{{ xray_home }}/app/third-party/rabbitmq/socat-1.7.3.2-2.el7.x86_64.rpm"
state: present
- name: Install erlang
yum:
name: "{{ xray_home }}/app/third-party/rabbitmq/erlang-21.1.4-1.el7.centos.x86_64.rpm"
state: present

Some files were not shown because too many files have changed in this diff Show More