Merge pull request #2 from Serienmorder/addimdopotence

Add imdopotence
This commit is contained in:
Serienmorder
2020-10-06 07:20:53 -07:00
committed by GitHub
11 changed files with 150 additions and 24 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.1.0" version: "1.1.1"
# 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

@@ -50,3 +50,7 @@ service_list:
# if this is an upgrade # if this is an upgrade
artifactory_upgrade_only: false artifactory_upgrade_only: false
#default username and password
artifactory_app_username: admin
artifactory_app_user_pass: password

View File

@@ -52,8 +52,30 @@
until: downloadartifactory is succeeded until: downloadartifactory is succeeded
retries: 3 retries: 3
- name: MV untar directory to artifactory home - name: Create artifactory home folder
command: "mv {{ artifactory_untar_home }} {{ artifactory_home }}" file:
state: directory
path: "{{ artifactory_home }}"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes
- name: Create Symlinks for var folder
file:
state: link
src: "{{ artifactory_untar_home }}/var"
dest: "{{ artifactory_home }}/var"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes
- name: Create Symlinks for app folder
file:
state: link
src: "{{ artifactory_untar_home }}/app"
dest: "{{ artifactory_home }}/app"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes become: yes
- name: ensure artifactory_file_store_dir exists - name: ensure artifactory_file_store_dir exists
@@ -180,7 +202,7 @@
- name: Ensure permissions are correct - name: Ensure permissions are correct
file: file:
path: "{{ artifactory_home }}" path: "{{ jfrog_home_directory }}"
group: "{{ artifactory_group }}" group: "{{ artifactory_group }}"
owner: "{{ artifactory_user }}" owner: "{{ artifactory_user }}"
recurse: yes recurse: yes

View File

@@ -0,0 +1,34 @@
---
- name: MV artifactory home to artifactory untar home
command: "mv {{ artifactory_home }} {{ temp_untar_home }}"
become: yes
- name: Ensure untar home permissions are correct
file:
state: directory
path: "{{ temp_untar_home }}"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes
- name: Create artifactory home folder
file:
state: directory
path: "{{ artifactory_home }}"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes
- name: Create Symlinks for var folder
file:
state: link
src: "{{ temp_untar_home }}/var"
dest: "{{ artifactory_home }}/var"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes
- name: Create Symlinks for app folder
file:
state: link
src: "{{ temp_untar_home }}/app"
dest: "{{ artifactory_home }}/app"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes

View File

@@ -1,3 +1,32 @@
- name: Rectify Legacy Installation Block
block:
- name: Check symlink method
stat:
path: /opt/jfrog/artifactory/app
register: newMethod
- name: Check artifactory version
uri:
url: "{{ web_method }}://{{ artifactory_server_url }}:{{ url_port }}/artifactory/api/system/version"
url_username: "{{ artifactory_app_username }}"
url_password: "{{ artifactory_app_user_pass }}"
register: artifactory_installed_version
- name: Debug defunct installation
debug:
var: artifactory_installed_version.json.version
- name: Setup temporary untar home
set_fact:
temp_untar_home: "{{ jfrog_home_directory }}/artifactory-{{ artifactory_flavour }}-{{ artifactory_installed_version }}"
- name: Rectify legacy installation
include_tasks: "legacy_migration.yml"
when: (not newMethod.stat.islnk) and newMethod.stat.exists
rescue:
- name: Setup temporary untar home (assuming version is set var for version)
set_fact:
temp_untar_home: "{{ jfrog_home_directory }}/artifactory-{{ artifactory_flavour }}-{{ artifactory_version }}"
- name: Rectify legacy installation
include_tasks: "legacy_migration.yml"
when: (not newMethod.stat.islnk) and newMethod.stat.exists
always:
- name: perform installation - name: perform installation
include_tasks: "install.yml" include_tasks: "install.yml"
when: not artifactory_upgrade_only when: not artifactory_upgrade_only

View File

@@ -14,6 +14,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 }}"
@@ -23,24 +36,42 @@
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
- name: Delete artifactory app #- name: Delete artifactory app
# file:
# path: "{{ artifactory_home }}/app"
# state: absent
# become: yes
#- name: CP new app to artifactory app
# command: "cp -r {{ artifactory_untar_home }}/app {{ artifactory_home }}/app"
# become: yes
#- name: Delete untar directory
# file:
# path: "{{ artifactory_untar_home }}"
# state: absent
# become: yes
- name: Create Symlinks for app folder
file: file:
path: "{{ artifactory_home }}/app" state: link
state: absent src: "{{ artifactory_untar_home }}/app"
dest: "{{ artifactory_home }}/app"
owner: "{{ artifactory_user }}"
group: "{{ artifactory_group }}"
become: yes become: yes
- name: CP new app to artifactory app - name: Ensure permissions are correct
command: "cp -r {{ artifactory_untar_home }}/app {{ artifactory_home }}/app"
become: yes
- name: Delete untar directory
file: file:
path: "{{ artifactory_untar_home }}" path: "{{ jfrog_home_directory }}"
state: absent group: "{{ artifactory_group }}"
owner: "{{ artifactory_user }}"
recurse: yes
become: yes become: yes
- name: start and enable the primary node - name: start and enable the primary node

View File

@@ -32,7 +32,13 @@ shared:
## Example for mysql/postgresql ## Example for mysql/postgresql
type: "{{ db_type }}" type: "{{ db_type }}"
{%+ if db_type == 'derby' -%}
# driver: "{{ db_driver }}"
# url: "{{ db_url }}"
# username: "{{ db_user }}"
{%+ else -%}
driver: "{{ db_driver }}" driver: "{{ db_driver }}"
url: "{{ db_url }}" url: "{{ db_url }}"
username: "{{ db_user }}" username: "{{ db_user }}"
{%+ endif -%}
password: "{{ db_password }}" password: "{{ db_password }}"

0
Openshift4/helm/openshift-xray/LICENSE Executable file → Normal file
View File

View File