mirror of
https://github.com/ZwareBear/JFrog-Cloud-Installers.git
synced 2026-01-21 02:06:56 -06:00
Updated documentation. Add new tests for software upgrades.
This commit is contained in:
@@ -12,6 +12,7 @@ This Ansible directory consists of the following directories that support the JF
|
|||||||
|
|
||||||
| collection_version | artifactory_version | xray_version |
|
| collection_version | artifactory_version | xray_version |
|
||||||
|--------------------|---------------------|--------------|
|
|--------------------|---------------------|--------------|
|
||||||
|
| 1.0.8 | 7.6.1 | 3.5.2 |
|
||||||
| 1.0.7 | 7.6.1 | 3.5.2 |
|
| 1.0.7 | 7.6.1 | 3.5.2 |
|
||||||
| 1.0.6 | 7.5.0 | 3.3.0 |
|
| 1.0.6 | 7.5.0 | 3.3.0 |
|
||||||
| 1.0.6 | 7.4.3 | 3.3.0 |
|
| 1.0.6 | 7.4.3 | 3.3.0 |
|
||||||
@@ -84,11 +85,29 @@ ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -A us
|
|||||||
eg.
|
eg.
|
||||||
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -A ubuntu@{{ azureDeployment.deployment.outputs.lbIp.value }} -W %h:%p"'
|
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -A ubuntu@{{ azureDeployment.deployment.outputs.lbIp.value }} -W %h:%p"'
|
||||||
```
|
```
|
||||||
|
## Upgrades
|
||||||
|
The Artifactory and Xray roles support software updates. To use a role to perform a software update only, use the _artifactory_upgrade_only_ or _xray_upgrade_only_ variable and specify the version. See the following example.
|
||||||
|
|
||||||
|
```
|
||||||
|
- hosts: artifactory
|
||||||
|
vars:
|
||||||
|
artifactory_version: "{{ lookup('env', 'artifactory_version_upgrade') }}"
|
||||||
|
artifactory_upgrade_only: true
|
||||||
|
roles:
|
||||||
|
- artifactory
|
||||||
|
|
||||||
|
- hosts: xray
|
||||||
|
vars:
|
||||||
|
xray_version: "{{ lookup('env', 'xray_version_upgrade') }}"
|
||||||
|
xray_upgrade_only: true
|
||||||
|
roles:
|
||||||
|
- xray
|
||||||
|
```
|
||||||
|
|
||||||
## Building the Collection Archive
|
## Building the Collection Archive
|
||||||
1. Go to the [ansible_collections/jfrog/installers directory](ansible_collections/jfrog/installers).
|
1. Go to the [ansible_collections/jfrog/installers directory](ansible_collections/jfrog/installers).
|
||||||
2. Update the galaxy.yml meta file as needed. Update the version.
|
2. Update the galaxy.yml meta file as needed. Update the version.
|
||||||
3. Build the archive.
|
3. Build the archive. (Requires Ansible 2.9+)
|
||||||
```
|
```
|
||||||
ansible-galaxy collection build
|
ansible-galaxy collection build
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ pipelines:
|
|||||||
- ls
|
- ls
|
||||||
- eval $(ssh-agent -s)
|
- eval $(ssh-agent -s)
|
||||||
- ssh-add <(echo "$int_ansiblePrivateKey_key")
|
- ssh-add <(echo "$int_ansiblePrivateKey_key")
|
||||||
- ansible-playbook Ansible/test/aws/playbook.yaml
|
- ansible-playbook Ansible/test/aws/playbook-ha-install.yaml
|
||||||
onComplete:
|
onComplete:
|
||||||
- echo "AWS Ansible playbook complete."
|
- echo "AWS Ansible playbook complete."
|
||||||
- name: execute_azure_ansible_playbook
|
- name: execute_azure_ansible_playbook
|
||||||
@@ -105,6 +105,6 @@ pipelines:
|
|||||||
- eval $(ssh-agent -s)
|
- eval $(ssh-agent -s)
|
||||||
- ssh-add <(echo "$int_ansiblePrivateKey_key")
|
- ssh-add <(echo "$int_ansiblePrivateKey_key")
|
||||||
- az login --service-principal -u "$clientId" -p "$clientSecret" --tenant "$tenantId"
|
- az login --service-principal -u "$clientId" -p "$clientSecret" --tenant "$tenantId"
|
||||||
- ansible-playbook Ansible/test/azure/playbook.yaml
|
- ansible-playbook Ansible/test/azure/playbook-ha-install.yaml
|
||||||
onComplete:
|
onComplete:
|
||||||
- echo "Azure Ansible playbook complete."
|
- echo "Azure Ansible playbook complete."
|
||||||
@@ -37,9 +37,7 @@
|
|||||||
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_license1: "{{ lookup('env', 'artifactory_license1') }}"
|
artifactory_license_file: "{{ lookup('env', 'artifactory_license_file') }}"
|
||||||
artifactory_license2: "{{ lookup('env', 'artifactory_license2') }}"
|
|
||||||
artifactory_license3: "{{ lookup('env', 'artifactory_license3') }}"
|
|
||||||
groups:
|
groups:
|
||||||
- artifactory
|
- artifactory
|
||||||
|
|
||||||
@@ -84,6 +82,11 @@
|
|||||||
- { db_name: "xraydb", db_owner: "xray" }
|
- { db_name: "xraydb", db_owner: "xray" }
|
||||||
groups: database
|
groups: database
|
||||||
|
|
||||||
|
- name: Set up test environment file
|
||||||
|
copy:
|
||||||
|
src: ../tests/src/test/resources/testenv_tpl.yaml
|
||||||
|
dest: ../tests/src/test/resources/testenv.yaml
|
||||||
|
|
||||||
- name: Set up test environment url
|
- name: Set up test environment url
|
||||||
replace:
|
replace:
|
||||||
path: ../tests/src/test/resources/testenv.yaml
|
path: ../tests/src/test/resources/testenv.yaml
|
||||||
@@ -140,12 +143,7 @@
|
|||||||
- name: Test
|
- name: Test
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
tasks:
|
tasks:
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
shell:
|
shell:
|
||||||
cmd: ./gradlew clean unified_test
|
cmd: ./gradlew clean unified_test
|
||||||
chdir: ../tests/
|
chdir: ../tests/
|
||||||
- name: Cleanup and delete stack
|
|
||||||
cloudformation:
|
|
||||||
stack_name: "{{ lookup('env', 'stack_name') }}"
|
|
||||||
region: "us-east-1"
|
|
||||||
state: "absent"
|
|
||||||
172
Ansible/test/aws/playbook-ha-upgrade.yaml
Normal file
172
Ansible/test/aws/playbook-ha-upgrade.yaml
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
---
|
||||||
|
- name: Provision AWS test infrastructure
|
||||||
|
hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- shell: 'pwd'
|
||||||
|
register: cmd
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "{{ cmd.stdout }}"
|
||||||
|
- name: Create AWS test system
|
||||||
|
cloudformation:
|
||||||
|
stack_name: "{{ lookup('env', 'stack_name') }}"
|
||||||
|
state: "present"
|
||||||
|
region: "us-east-1"
|
||||||
|
disable_rollback: true
|
||||||
|
template: "{{ lookup('env', 'cfn_template') }}"
|
||||||
|
template_parameters:
|
||||||
|
SSHKeyName: "{{ lookup('env', 'ssh_public_key_name') }}"
|
||||||
|
tags:
|
||||||
|
Stack: "{{ lookup('env', 'stack_name') }}"
|
||||||
|
register: AWSDeployment
|
||||||
|
- name: Get AWS deployment details
|
||||||
|
debug:
|
||||||
|
var: AWSDeployment
|
||||||
|
|
||||||
|
- name: Add bastion
|
||||||
|
add_host:
|
||||||
|
hostname: "{{ AWSDeployment.stack_outputs.BastionInstancePublic }}"
|
||||||
|
groups: bastion
|
||||||
|
ansible_user: "ubuntu"
|
||||||
|
- name: Add new RT primary to host group
|
||||||
|
add_host:
|
||||||
|
hostname: "{{ AWSDeployment.stack_outputs.RTPriInstancePrivate }}"
|
||||||
|
ansible_user: "ubuntu"
|
||||||
|
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -A ubuntu@{{ AWSDeployment.stack_outputs.BastionInstancePublic }} -W %h:%p"'
|
||||||
|
artifactory_version: "{{ lookup('env', 'artifactory_version') }}"
|
||||||
|
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') }}"
|
||||||
|
groups:
|
||||||
|
- artifactory
|
||||||
|
|
||||||
|
- name: Add RT secondaries to host group
|
||||||
|
add_host:
|
||||||
|
hostname: "{{ AWSDeployment.stack_outputs.RTSecInstancePrivate }}"
|
||||||
|
ansible_user: "ubuntu"
|
||||||
|
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -A ubuntu@{{ AWSDeployment.stack_outputs.BastionInstancePublic }} -W %h:%p"'
|
||||||
|
artifactory_version: "{{ lookup('env', 'artifactory_version') }}"
|
||||||
|
db_url: "jdbc:postgresql://{{ AWSDeployment.stack_outputs.DBInstancePrivate }}:5432/artifactory"
|
||||||
|
server_name: "{{ AWSDeployment.stack_outputs.ALBHostName }}"
|
||||||
|
artifactory_is_primary: false
|
||||||
|
groups:
|
||||||
|
- artifactory
|
||||||
|
|
||||||
|
- name: Add xrays to host group
|
||||||
|
add_host:
|
||||||
|
hostname: "{{ AWSDeployment.stack_outputs.XrayInstancePrivate }}"
|
||||||
|
ansible_user: "ubuntu"
|
||||||
|
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -A ubuntu@{{ AWSDeployment.stack_outputs.BastionInstancePublic }} -W %h:%p"'
|
||||||
|
xray_version: "{{ lookup('env', 'xray_version') }}"
|
||||||
|
jfrog_url: "http://{{ AWSDeployment.stack_outputs.ALBHostName }}"
|
||||||
|
master_key: "{{ lookup('env', 'master_key') }}"
|
||||||
|
join_key: "{{ lookup('env', 'join_key') }}"
|
||||||
|
db_type: "postgresql"
|
||||||
|
db_driver: "org.postgresql.Driver"
|
||||||
|
db_user: "xray"
|
||||||
|
db_password: "xray"
|
||||||
|
db_url: "postgres://{{ AWSDeployment.stack_outputs.DBInstancePrivate }}:5432/xraydb?sslmode=disable"
|
||||||
|
groups: xray
|
||||||
|
|
||||||
|
- name: Add DBs to host group
|
||||||
|
add_host:
|
||||||
|
hostname: "{{ AWSDeployment.stack_outputs.DBInstancePrivate }}"
|
||||||
|
ansible_user: "ubuntu"
|
||||||
|
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -A ubuntu@{{ AWSDeployment.stack_outputs.BastionInstancePublic }} -W %h:%p"'
|
||||||
|
db_users:
|
||||||
|
- { db_user: "artifactory", db_password: "Art1fAct0ry" }
|
||||||
|
- { db_user: "xray", db_password: "xray" }
|
||||||
|
dbs:
|
||||||
|
- { db_name: "artifactory", db_owner: "artifactory" }
|
||||||
|
- { db_name: "xraydb", db_owner: "xray" }
|
||||||
|
groups: database
|
||||||
|
|
||||||
|
- name: Set up test environment file
|
||||||
|
copy:
|
||||||
|
src: ../tests/src/test/resources/testenv_tpl.yaml
|
||||||
|
dest: ../tests/src/test/resources/testenv.yaml
|
||||||
|
|
||||||
|
- name: Set up test environment url
|
||||||
|
replace:
|
||||||
|
path: ../tests/src/test/resources/testenv.yaml
|
||||||
|
regexp: 'urlval'
|
||||||
|
replace: "http://{{ AWSDeployment.stack_outputs.ALBHostName }}"
|
||||||
|
|
||||||
|
- name: Set up test environment external_ip
|
||||||
|
replace:
|
||||||
|
path: ../tests/src/test/resources/testenv.yaml
|
||||||
|
regexp: 'ipval'
|
||||||
|
replace: "{{ AWSDeployment.stack_outputs.ALBHostName }}"
|
||||||
|
|
||||||
|
- name: Set up test environment rt_password
|
||||||
|
replace:
|
||||||
|
path: ../tests/src/test/resources/testenv.yaml
|
||||||
|
regexp: 'passval'
|
||||||
|
replace: "password"
|
||||||
|
|
||||||
|
- name: show testenv.yaml
|
||||||
|
debug: var=item
|
||||||
|
with_file:
|
||||||
|
- ../tests/src/test/resources/testenv.yaml
|
||||||
|
|
||||||
|
- name: Wait 300 seconds for port 22
|
||||||
|
wait_for:
|
||||||
|
port: 22
|
||||||
|
host: "{{ AWSDeployment.stack_outputs.BastionInstancePublic }}"
|
||||||
|
delay: 10
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "Unified URL is at http://{{ AWSDeployment.stack_outputs.ALBHostName }}"
|
||||||
|
|
||||||
|
# apply roles to install software
|
||||||
|
- hosts: database
|
||||||
|
roles:
|
||||||
|
- postgres
|
||||||
|
|
||||||
|
- hosts: artifactory
|
||||||
|
vars:
|
||||||
|
artifactory_ha_enabled: true
|
||||||
|
master_key: "{{ lookup('env', 'master_key') }}"
|
||||||
|
join_key: "{{ lookup('env', 'join_key') }}"
|
||||||
|
db_download_url: "https://jdbc.postgresql.org/download/postgresql-42.2.12.jar"
|
||||||
|
db_type: "postgresql"
|
||||||
|
db_driver: "org.postgresql.Driver"
|
||||||
|
db_user: "artifactory"
|
||||||
|
db_password: "Art1fAct0ry"
|
||||||
|
roles:
|
||||||
|
- artifactory
|
||||||
|
|
||||||
|
- hosts: xray
|
||||||
|
roles:
|
||||||
|
- xray
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- name: Run tests
|
||||||
|
shell:
|
||||||
|
cmd: ./gradlew clean unified_test
|
||||||
|
chdir: ../tests/
|
||||||
|
|
||||||
|
# Now upgrade
|
||||||
|
- name: Upgrade
|
||||||
|
hosts: localhost
|
||||||
|
tasks:
|
||||||
|
- pause:
|
||||||
|
prompt: "Proceed to upgrade?"
|
||||||
|
minutes: 5
|
||||||
|
|
||||||
|
- hosts: artifactory
|
||||||
|
vars:
|
||||||
|
artifactory_version: "{{ lookup('env', 'artifactory_version_upgrade') }}"
|
||||||
|
artifactory_upgrade_only: true
|
||||||
|
roles:
|
||||||
|
- artifactory
|
||||||
|
|
||||||
|
- hosts: xray
|
||||||
|
vars:
|
||||||
|
xray_version: "{{ lookup('env', 'xray_version_upgrade') }}"
|
||||||
|
xray_upgrade_only: true
|
||||||
|
roles:
|
||||||
|
- xray
|
||||||
@@ -1,3 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ansible-playbook Ansible/test/aws/playbook.yaml
|
export stack_name=$1
|
||||||
|
export cfn_template="~/git/JFrog-Cloud-Installers/Ansible/infra/aws/lb-rt-xray-ha-ubuntu16.json"
|
||||||
|
export ssh_public_key_name=jeff-ansible
|
||||||
|
export artifactory_license_file="~/Desktop/artifactory.cluster.license"
|
||||||
|
export master_key=d8c19a03036f83ea45f2c658e22fdd60
|
||||||
|
export join_key=d8c19a03036f83ea45f2c658e22fdd61
|
||||||
|
export ansible_user=ubuntu
|
||||||
|
export artifactory_version="7.4.3"
|
||||||
|
export xray_version="3.4.0"
|
||||||
|
ansible-playbook Ansible/test/aws/playbook-ha-install.yaml
|
||||||
14
Ansible/test/aws/runAwsUpgrade.sh
Executable file
14
Ansible/test/aws/runAwsUpgrade.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
export stack_name=$1
|
||||||
|
export cfn_template="~/git/JFrog-Cloud-Installers/Ansible/infra/aws/lb-rt-xray-ha-ubuntu16.json"
|
||||||
|
export ssh_public_key_name=jeff-ansible
|
||||||
|
export artifactory_license_file="~/Desktop/artifactory.cluster.license"
|
||||||
|
export master_key=d8c19a03036f83ea45f2c658e22fdd60
|
||||||
|
export join_key=d8c19a03036f83ea45f2c658e22fdd61
|
||||||
|
export ansible_user=ubuntu
|
||||||
|
export artifactory_version="7.4.3"
|
||||||
|
export xray_version="3.4.0"
|
||||||
|
export artifactory_version_upgrade="7.6.1"
|
||||||
|
export xray_version_upgrade="3.5.2"
|
||||||
|
ansible-playbook Ansible/test/aws/playbook-ha-upgrade.yaml
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
artifactory:
|
artifactory:
|
||||||
url: urlval
|
url: http://Ansib-Appli-1NLZU3V2AGK49-291976964.us-east-1.elb.amazonaws.com
|
||||||
external_ip: ipval
|
external_ip: Ansib-Appli-1NLZU3V2AGK49-291976964.us-east-1.elb.amazonaws.com
|
||||||
distribution: artifactory_ha
|
distribution: artifactory_ha
|
||||||
rt_username: admin
|
rt_username: admin
|
||||||
rt_password: passval
|
rt_password: password
|
||||||
6
Ansible/test/tests/src/test/resources/testenv_tpl.yaml
Normal file
6
Ansible/test/tests/src/test/resources/testenv_tpl.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
artifactory:
|
||||||
|
url: urlval
|
||||||
|
external_ip: ipval
|
||||||
|
distribution: artifactory_ha
|
||||||
|
rt_username: admin
|
||||||
|
rt_password: passval
|
||||||
Reference in New Issue
Block a user