Documentation updates. Fixes AWS test/playbook.

This commit is contained in:
jefferyfry
2020-06-19 10:57:05 -07:00
parent 5ce8d505d1
commit 27d41ff344
12 changed files with 89 additions and 71 deletions

View File

@@ -10,9 +10,23 @@ This Ansible directory consists of the following directories that support the JF
## Getting Started ## Getting Started
1. Install this collection from Ansible Galaxy. This collection is also available in RedHat Automation Hub. 1. Install this collection from Ansible Galaxy. This collection is also available in RedHat Automation Hub.
``` ```
ansible-galaxy collection install jfrog.installers ansible-galaxy collection install jfrog.installers
``` ```
Ensure you reference the collection in your playbook when using these roles.
```
---
- hosts: xray
collections:
- jfrog.installers
roles:
- xray
```
2. Ansible uses SSH to connect to hosts. Ensure that your SSH private key is on your client and the public keys are installed on your Ansible hosts. 2. Ansible uses SSH to connect to hosts. Ensure that your SSH private key is on your client and the public keys are installed on your Ansible hosts.
3. Create your inventory file. Use one of the examples from the [examples directory](examples) to construct an inventory file (hosts.yml) with the host addresses and variables. 3. Create your inventory file. Use one of the examples from the [examples directory](examples) to construct an inventory file (hosts.yml) with the host addresses and variables.
@@ -21,7 +35,7 @@ This Ansible directory consists of the following directories that support the JF
5. Then execute with the following command to provision the JFrog software with Ansible. Variables can also be passed in at the command-line. 5. Then execute with the following command to provision the JFrog software with Ansible. Variables can also be passed in at the command-line.
``` ```
ansible-playbook -i hosts.yml playbook.yml --extra-vars "master_key=$(openssl rand -hex 16) join_key=$(openssl rand -hex 16)" ansible-playbook -i hosts.yml playbook.yml --extra-vars "master_key=$(openssl rand -hex 16) join_key=$(openssl rand -hex 16)"
``` ```

View File

@@ -1,70 +1,42 @@
# JFrog Ansible Installers Collection # JFrog Ansible Installers Collection
This collection provides roles for installing Artifactory and Xray. Additionally, it provides optional SSL and Postgresql roles if these are needed for your deployment.
## Roles Provided This Ansible directory consists of the following directories that support the JFrog Ansible collection.
### 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 * [ansible_collections directory](ansible_collections) - This directory contains the Ansible collection package that has the Ansible roles for Artifactory and Xray. See the collection [README](ansible_collections/README.md) for details on the available roles and variables.
The artifactory_nginx_ssl role installs and configures nginx for SSL. * [examples directory](examples) - This directory contains example playbooks for various architectures from single Artifactory (RT) deployments to high-availability setups.
* [infra directory](infra) - This directory contains example infrastructure templates that can be used for testing and as example deployments.
* [test directory](test) - This directory contains Gradle tests that can be used to verify a deployment. It also has Ansible playbooks for creating infrastructure, provisioning software and testing with Gradle.
### postgres ## Getting Started
The postgres role will install Postgresql software and configure a database and user to support an Artifactory or Xray server.
### xray 1. Install this collection from Ansible Galaxy. This collection is also available in RedHat Automation Hub.
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. ansible-galaxy collection install jfrog.installers
```
### databsase vars Ensure you reference the collection in your playbook when using these roles.
* _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](https://www.jfrog.com/confluence/display/JFROG/Managing+Keys). See below to [autogenerate this key](#autogenerating-master-and-join-keys). - hosts: xray
* _join_key_: This is the Artifactory [Join Key](https://www.jfrog.com/confluence/display/JFROG/Managing+Keys). See below to [autogenerate this key](#autogenerating-master-and-join-keys). collections:
* _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" - jfrog.installers
* _db_type_: This is the database type. eg. "postgresql" roles:
* _db_driver_: This is the JDBC driver class. eg. "org.postgresql.Driver" - xray
* _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"
* _system_file_: Your own [system YAML](https://www.jfrog.com/confluence/display/JFROG/System+YAML+Configuration+File) file can be specified and used. **If specified, this file will be used rather than constructing a file from the parameters above.**
* _binary_store_file_: Your own [binary store file](https://www.jfrog.com/confluence/display/JFROG/Configuring+the+Filestore) can be used. If specified, the default cluster-file-system will not be used.
### primary vars (vars used by the primary Artifactory server) ```
* _artifactory_is_primary_: For the primary node this must be set to **true**.
* _artifactory_license1 - 5_: These are the cluster licenses.
* _artifactory_license_file_: Your own license file can be used. **If specified, a license file constructed from the licenses above will not be used.**
### secondary vars (vars used by the secondary Artifactory server) 2. Ansible uses SSH to connect to hosts. Ensure that your SSH private key is on your client and the public keys are installed on your Ansible hosts.
* _artifactory_is_primary_: For the secondary node(s) this must be set to **false**.
### ssl vars (Used with artifactory_nginx_ssl role) 3. Create your inventory file. Use one of the examples from the [examples directory](examples) to construct an inventory file (hosts.yml) with the host addresses and variables.
* _certificate_: This is the SSL cert.
* _certificate_key_: This is the SSL private key.
### xray vars 4. Create your playbook. Use one of the examples from the [examples directory](examples) to construct a playbook using the JFrog Ansible roles. These roles will be applied to your inventory and provision software.
* _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](https://www.jfrog.com/confluence/display/JFROG/Managing+Keys). See below to [autogenerate this key](#autogenerating-master-and-join-keys).
* _join_key_: This is the Artifactory [Join Key](https://www.jfrog.com/confluence/display/JFROG/Managing+Keys). See below to [autogenerate this key](#autogenerating-master-and-join-keys).
* _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"
* _system_file_: Your own [system YAML](https://www.jfrog.com/confluence/display/JFROG/System+YAML+Configuration+File) file can be specified and used. If specified, this file will be used rather than constructing a file from the parameters above.
## Example Inventory and Playbooks 5. Then execute with the following command to provision the JFrog software with Ansible. Variables can also be passed in at the command-line.
Example playbooks are located in the [examples](../examples) directory. This directory contains several example inventory and playbooks for different Artifactory, HA and Xray architectures.
## Executing a Playbook ```
``` ansible-playbook -i hosts.yml playbook.yml --extra-vars "master_key=$(openssl rand -hex 16) join_key=$(openssl rand -hex 16)"
ansible-playbook -i <hosts file> <playbook file>
``` ```
## Autogenerating Master and Join Keys ## Autogenerating Master and Join Keys

View File

@@ -9,7 +9,7 @@ namespace: "jfrog"
name: "installers" name: "installers"
# The version of the collection. Must be compatible with semantic versioning # The version of the collection. Must be compatible with semantic versioning
version: "1.0.5" version: "1.0.6"
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection # The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: "README.md" readme: "README.md"
@@ -52,9 +52,7 @@ dependencies: {}
repository: "https://github.com/jfrog/JFrog-Cloud-Installers/" repository: "https://github.com/jfrog/JFrog-Cloud-Installers/"
# The URL to any online docs # The URL to any online docs
documentation: documentation: "https://github.com/jfrog/JFrog-Cloud-Installers/blob/master/Ansible/README.md"
- "https://github.com/jfrog/JFrog-Cloud-Installers/blob/master/Ansible/README.md"
- "https://www.jfrog.com/confluence/display/JFROG/"
# The URL to the homepage of the collection/project # The URL to the homepage of the collection/project
homepage: "https://github.com/jfrog/JFrog-Cloud-Installers/" homepage: "https://github.com/jfrog/JFrog-Cloud-Installers/"

View File

@@ -1,9 +1,13 @@
--- ---
- hosts: database - hosts: database
collections:
- jfrog.installers
roles: roles:
- postgres - postgres
- hosts: primary:secondary - hosts: primary:secondary
collections:
- jfrog.installers
roles: roles:
- artifactory - artifactory
- artifactory_nginx_ssl - artifactory_nginx_ssl

View File

@@ -1,12 +1,18 @@
--- ---
- hosts: database - hosts: database
collections:
- jfrog.installers
roles: roles:
- postgres - postgres
- hosts: artifactory - hosts: artifactory
collections:
- jfrog.installers
roles: roles:
- artifactory - artifactory
- hosts: xray - hosts: xray
collections:
- jfrog.installers
roles: roles:
- xray - xray

View File

@@ -1,8 +1,12 @@
--- ---
- hosts: database - hosts: database
collections:
- jfrog.installers
roles: roles:
- postgres - postgres
- hosts: primary - hosts: primary
collections:
- jfrog.installers
roles: roles:
- artifactory - artifactory

View File

@@ -1,9 +1,13 @@
--- ---
- hosts: database - hosts: database
collections:
- jfrog.installers
roles: roles:
- postgres - postgres
- hosts: primary - hosts: primary
collections:
- jfrog.installers
roles: roles:
- artifactory - artifactory
- artifactory_nginx_ssl - artifactory_nginx_ssl

View File

@@ -1,4 +1,6 @@
--- ---
- hosts: xray - hosts: xray
collections:
- jfrog.installers
roles: roles:
- xray - xray

View File

@@ -34,6 +34,12 @@ pipelines:
- sudo apt -y --allow-unauthenticated install ansible - sudo apt -y --allow-unauthenticated install ansible
- sudo pip install packaging - sudo pip install packaging
- sudo pip install boto3 botocore - sudo pip install boto3 botocore
- pwd
- ls
- ls workspace
- ls dependencyState
- ls dependencyState/resources
- ls dependencyState/resources/ansibleRepo
- cd ../dependencyState/resources/ansibleRepo - cd ../dependencyState/resources/ansibleRepo
- echo 'Setting environment variables...' - echo 'Setting environment variables...'
- export artifactory_version="$int_ansibleEnvVars_artifactory_version" - export artifactory_version="$int_ansibleEnvVars_artifactory_version"
@@ -84,6 +90,12 @@ pipelines:
- sudo pip install packaging - sudo pip install packaging
- sudo pip install msrestazure - sudo pip install msrestazure
- sudo pip install ansible[azure] - sudo pip install ansible[azure]
- pwd
- ls
- ls workspace
- ls dependencyState
- ls dependencyState/resources
- ls dependencyState/resources/ansibleRepo
- cd ../dependencyState/resources/ansibleRepo - cd ../dependencyState/resources/ansibleRepo
- echo 'Setting environment variables...' - echo 'Setting environment variables...'
- export artifactory_version="$int_ansibleEnvVars_artifactory_version" - export artifactory_version="$int_ansibleEnvVars_artifactory_version"

View File

@@ -37,7 +37,9 @@
db_url: "jdbc:postgresql://{{ AWSDeployment.stack_outputs.DBInstancePrivate }}:5432/artifactory" db_url: "jdbc:postgresql://{{ AWSDeployment.stack_outputs.DBInstancePrivate }}:5432/artifactory"
server_name: "{{ AWSDeployment.stack_outputs.ALBHostName }}" server_name: "{{ AWSDeployment.stack_outputs.ALBHostName }}"
artifactory_is_primary: true artifactory_is_primary: true
artifactory_license_file: "{{ lookup('env', 'artifactory_license_file') }}" artifactory_license1: "{{ lookup('env', 'artifactory_license1') }}"
artifactory_license2: "{{ lookup('env', 'artifactory_license2') }}"
artifactory_license3: "{{ lookup('env', 'artifactory_license3') }}"
groups: groups:
- artifactory - artifactory