Merge pull request #41 from Serienmorder/master

Add offline support for install
This commit is contained in:
Jeff Fry
2020-09-24 13:58:26 -07:00
committed by GitHub
6 changed files with 59 additions and 16 deletions

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.8" version: "1.0.9"
# 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"

View File

@@ -4,7 +4,7 @@
ansible_marketplace: standalone ansible_marketplace: standalone
# The version of Artifactory to install # The version of Artifactory to install
artifactory_version: 7.6.1 artifactory_version: 7.7.3
# licenses file - specify a licenses file or specify up to 5 licenses # licenses file - specify a licenses file or specify up to 5 licenses
artifactory_license1: artifactory_license1:
@@ -29,7 +29,7 @@ artifactory_file_store_dir: /data
artifactory_flavour: pro artifactory_flavour: pro
extra_java_opts: -server -Xms2g -Xmx14g -Xss256k -XX:+UseG1GC extra_java_opts: -server -Xms2g -Xmx14g -Xss256k -XX:+UseG1GC
artifactory_system_yaml: system.yaml.j2
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_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: "{{ jfrog_home_directory }}/artifactory" artifactory_home: "{{ jfrog_home_directory }}/artifactory"
artifactory_untar_home: "{{ jfrog_home_directory }}/artifactory-{{ artifactory_flavour }}-{{ artifactory_version }}" artifactory_untar_home: "{{ jfrog_home_directory }}/artifactory-{{ artifactory_flavour }}-{{ artifactory_version }}"

View File

@@ -25,6 +25,19 @@
state: directory state: directory
become: yes become: yes
- name: Local Copy artifactory
unarchive:
src: "{{ local_artifactory_tar }}"
dest: "{{ jfrog_home_directory }}"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
creates: "{{ artifactory_untar_home }}"
become: yes
when: local_artifactory_tar is defined
register: downloadartifactory
until: downloadartifactory is succeeded
retries: 3
- name: download artifactory - name: download artifactory
unarchive: unarchive:
src: "{{ artifactory_tar }}" src: "{{ artifactory_tar }}"
@@ -34,6 +47,7 @@
group: "{{ artifactory_group }}" group: "{{ artifactory_group }}"
creates: "{{ artifactory_untar_home }}" creates: "{{ artifactory_untar_home }}"
become: yes become: yes
when: artifactory_tar is defined
register: downloadartifactory register: downloadartifactory
until: downloadartifactory is succeeded until: downloadartifactory is succeeded
retries: 3 retries: 3
@@ -67,7 +81,7 @@
- name: configure system yaml - name: configure system yaml
template: template:
src: system.yaml.j2 src: "{{ artifactory_system_yaml }}"
dest: "{{ artifactory_home }}/var/etc/system.yaml" dest: "{{ artifactory_home }}/var/etc/system.yaml"
become: yes become: yes
when: system_file is not defined when: system_file is not defined
@@ -134,18 +148,36 @@
become: yes become: yes
when: artifactory_license_file is not defined and artifactory_is_primary == true when: artifactory_license_file is not defined and artifactory_is_primary == true
- name: Copy local database driver
copy:
src: "{{ db_local_location }}"
dest: "{{ artifactory_home }}/var/bootstrap/artifactory/tomcat/lib"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
when: db_local_location is defined
become: yes
- name: download database driver - name: download database driver
get_url: get_url:
url: "{{ db_download_url }}" url: "{{ db_download_url }}"
dest: "{{ artifactory_home }}/var/bootstrap/artifactory/tomcat/lib" dest: "{{ artifactory_home }}/var/bootstrap/artifactory/tomcat/lib"
owner: "{{ artifactory_user }}" owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}" group: "{{ artifactory_group }}"
when: db_download_url is defined
become: yes become: yes
- name: create artifactory service - name: create artifactory service
shell: "{{ artifactory_home }}/app/bin/installService.sh" shell: "{{ artifactory_home }}/app/bin/installService.sh"
become: yes become: yes
- name: Ensure permissions are correct
file:
path: "{{ artifactory_home }}"
group: "{{ artifactory_group }}"
owner: "{{ artifactory_user }}"
recurse: yes
become: yes
- name: start and enable the primary node - name: start and enable the primary node
service: service:
name: artifactory name: artifactory

View File

@@ -1,16 +1,27 @@
--- ---
- name: perform dependency installation - name: Nginx Install Block
include_tasks: "{{ ansible_os_family }}.yml" block:
- name: install nginx
- name: install nginx package:
package: name: nginx
name: nginx state: present
state: present register: package_res
register: package_res retries: 5
retries: 5 delay: 60
delay: 60 become: yes
become: yes until: package_res is success
until: package_res is success rescue:
- name: perform dependency installation
include_tasks: "{{ ansible_os_family }}.yml"
- name: install nginx
package:
name: nginx
state: present
register: package_res
retries: 5
delay: 60
become: yes
until: package_res is success
- name: configure main nginx conf file. - name: configure main nginx conf file.
copy: copy: