mirror of
https://github.com/ZwareBear/JFrog-Cloud-Installers.git
synced 2026-01-21 01:06:55 -06:00
Documentation updates. Fixes AWS test/playbook.
This commit is contained in:
@@ -10,9 +10,23 @@ This Ansible directory consists of the following directories that support the JF
|
||||
## Getting Started
|
||||
|
||||
1. Install this collection from Ansible Galaxy. This collection is also available in RedHat Automation Hub.
|
||||
|
||||
```
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
```
|
||||
```
|
||||
ansible-playbook -i hosts.yml playbook.yml --extra-vars "master_key=$(openssl rand -hex 16) join_key=$(openssl rand -hex 16)"
|
||||
```
|
||||
|
||||
|
||||
@@ -1,70 +1,42 @@
|
||||
# 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
|
||||
### 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.
|
||||
This Ansible directory consists of the following directories that support the JFrog Ansible collection.
|
||||
|
||||
### artifactory_nginx_ssl
|
||||
The artifactory_nginx_ssl role installs and configures nginx for 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.
|
||||
* [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
|
||||
The postgres role will install Postgresql software and configure a database and user to support an Artifactory or Xray server.
|
||||
## Getting Started
|
||||
|
||||
### xray
|
||||
The xray role will install Xray software onto the host. An Artifactory server and Postgress database is required.
|
||||
1. Install this collection from Ansible Galaxy. This collection is also available in RedHat Automation Hub.
|
||||
|
||||
## Vars Required
|
||||
The following Vars must be configured.
|
||||
```
|
||||
ansible-galaxy collection install jfrog.installers
|
||||
```
|
||||
|
||||
### 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" }
|
||||
Ensure you reference the collection in your playbook when using these roles.
|
||||
|
||||
### 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).
|
||||
* _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_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"
|
||||
* _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.
|
||||
```
|
||||
---
|
||||
- hosts: xray
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- xray
|
||||
|
||||
### 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)
|
||||
* _artifactory_is_primary_: For the secondary node(s) this must be set to **false**.
|
||||
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.
|
||||
|
||||
### ssl vars (Used with artifactory_nginx_ssl role)
|
||||
* _certificate_: This is the SSL cert.
|
||||
* _certificate_key_: This is the SSL private key.
|
||||
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.
|
||||
|
||||
### 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](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.
|
||||
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.
|
||||
|
||||
## Example Inventory and Playbooks
|
||||
Example playbooks are located in the [examples](../examples) directory. This directory contains several example inventory and playbooks for different Artifactory, HA and Xray architectures.
|
||||
5. Then execute with the following command to provision the JFrog software with Ansible. Variables can also be passed in at the command-line.
|
||||
|
||||
## Executing a Playbook
|
||||
```
|
||||
ansible-playbook -i <hosts file> <playbook file>
|
||||
```
|
||||
ansible-playbook -i hosts.yml playbook.yml --extra-vars "master_key=$(openssl rand -hex 16) join_key=$(openssl rand -hex 16)"
|
||||
```
|
||||
|
||||
## Autogenerating Master and Join Keys
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace: "jfrog"
|
||||
name: "installers"
|
||||
|
||||
# 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
|
||||
readme: "README.md"
|
||||
@@ -52,9 +52,7 @@ dependencies: {}
|
||||
repository: "https://github.com/jfrog/JFrog-Cloud-Installers/"
|
||||
|
||||
# The URL to any online docs
|
||||
documentation:
|
||||
- "https://github.com/jfrog/JFrog-Cloud-Installers/blob/master/Ansible/README.md"
|
||||
- "https://www.jfrog.com/confluence/display/JFROG/"
|
||||
documentation: "https://github.com/jfrog/JFrog-Cloud-Installers/blob/master/Ansible/README.md"
|
||||
|
||||
# The URL to the homepage of the collection/project
|
||||
homepage: "https://github.com/jfrog/JFrog-Cloud-Installers/"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,9 +1,13 @@
|
||||
---
|
||||
- hosts: database
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- postgres
|
||||
|
||||
- hosts: primary:secondary
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- artifactory
|
||||
- artifactory_nginx_ssl
|
||||
@@ -1,12 +1,18 @@
|
||||
---
|
||||
- hosts: database
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- postgres
|
||||
|
||||
- hosts: artifactory
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- artifactory
|
||||
|
||||
- hosts: xray
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- xray
|
||||
@@ -1,8 +1,12 @@
|
||||
---
|
||||
- hosts: database
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- postgres
|
||||
|
||||
- hosts: primary
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- artifactory
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
---
|
||||
- hosts: database
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- postgres
|
||||
|
||||
- hosts: primary
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- artifactory
|
||||
- artifactory_nginx_ssl
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
---
|
||||
- hosts: xray
|
||||
collections:
|
||||
- jfrog.installers
|
||||
roles:
|
||||
- xray
|
||||
@@ -34,6 +34,12 @@ pipelines:
|
||||
- sudo apt -y --allow-unauthenticated install ansible
|
||||
- sudo pip install packaging
|
||||
- sudo pip install boto3 botocore
|
||||
- pwd
|
||||
- ls
|
||||
- ls workspace
|
||||
- ls dependencyState
|
||||
- ls dependencyState/resources
|
||||
- ls dependencyState/resources/ansibleRepo
|
||||
- cd ../dependencyState/resources/ansibleRepo
|
||||
- echo 'Setting environment variables...'
|
||||
- export artifactory_version="$int_ansibleEnvVars_artifactory_version"
|
||||
@@ -84,6 +90,12 @@ pipelines:
|
||||
- sudo pip install packaging
|
||||
- sudo pip install msrestazure
|
||||
- sudo pip install ansible[azure]
|
||||
- pwd
|
||||
- ls
|
||||
- ls workspace
|
||||
- ls dependencyState
|
||||
- ls dependencyState/resources
|
||||
- ls dependencyState/resources/ansibleRepo
|
||||
- cd ../dependencyState/resources/ansibleRepo
|
||||
- echo 'Setting environment variables...'
|
||||
- export artifactory_version="$int_ansibleEnvVars_artifactory_version"
|
||||
|
||||
@@ -37,7 +37,9 @@
|
||||
db_url: "jdbc:postgresql://{{ AWSDeployment.stack_outputs.DBInstancePrivate }}:5432/artifactory"
|
||||
server_name: "{{ AWSDeployment.stack_outputs.ALBHostName }}"
|
||||
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:
|
||||
- artifactory
|
||||
|
||||
|
||||
Reference in New Issue
Block a user