diff --git a/Ansible/CHANGELOG.md b/Ansible/CHANGELOG.md index 25ace90..ece5411 100644 --- a/Ansible/CHANGELOG.md +++ b/Ansible/CHANGELOG.md @@ -2,10 +2,20 @@ All notable changes to this project will be documented in this file. +## [1.1.2] - 2020-10-29 +- Updated default versions to RT 7.10.2 and Xray 3.10.3. +- Removed obsolete gradle tests. + +## [1.1.1] - 2020-10-15 +- added idempotence to artifactory installer +- added fix for derby deployments +- Migration to reduce changes during playbook runs contains breaking changes. You either must run once before upgrade, or provide playbook with valid credentials to access version information for it to perform properly. +- First time installers need not worry about above + ## [1.1.0] - 2020-09-27 - Validated for Artifactory 7.7.8 and Xray 3.8.6. - Added offline support for Artifactory and Xray. - Added support for configurable Postgres pg_hba.conf. - Misc fixes due to Artifactory 7.7.8. -- Published 1.1.0 to [Ansible Galaxy](https://galaxy.ansible.com/jfrog/installers). \ No newline at end of file +- Published 1.1.0 to [Ansible Galaxy](https://galaxy.ansible.com/jfrog/installers). diff --git a/Ansible/README.md b/Ansible/README.md index f22db8d..aaaf08d 100644 --- a/Ansible/README.md +++ b/Ansible/README.md @@ -12,6 +12,8 @@ This Ansible directory consists of the following directories that support the JF | collection_version | artifactory_version | xray_version | |--------------------|---------------------|--------------| +| 1.1.2 | 7.10.2 | 3.10.3 | +| 1.1.1 | 7.10.2 | 3.9.1 | | 1.1.0 | 7.7.8 | 3.8.6 | | 1.0.9 | 7.7.3 | 3.8.0 | | 1.0.8 | 7.7.3 | 3.8.0 | diff --git a/Ansible/ansible_collections/jfrog/installers/galaxy.yml b/Ansible/ansible_collections/jfrog/installers/galaxy.yml index 64bf9c9..d407f59 100644 --- a/Ansible/ansible_collections/jfrog/installers/galaxy.yml +++ b/Ansible/ansible_collections/jfrog/installers/galaxy.yml @@ -9,7 +9,7 @@ namespace: "jfrog" name: "installers" # The version of the collection. Must be compatible with semantic versioning -version: "1.1.0" +version: "1.1.2" # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: "README.md" diff --git a/Ansible/ansible_collections/jfrog/installers/jfrog-installers-1.1.0.tar.gz b/Ansible/ansible_collections/jfrog/installers/jfrog-installers-1.1.0.tar.gz deleted file mode 100644 index 5e8aebb..0000000 Binary files a/Ansible/ansible_collections/jfrog/installers/jfrog-installers-1.1.0.tar.gz and /dev/null differ diff --git a/Ansible/ansible_collections/jfrog/installers/jfrog-installers-1.1.2.tar.gz b/Ansible/ansible_collections/jfrog/installers/jfrog-installers-1.1.2.tar.gz new file mode 100644 index 0000000..a9fdeb6 Binary files /dev/null and b/Ansible/ansible_collections/jfrog/installers/jfrog-installers-1.1.2.tar.gz differ diff --git a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/README.md b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/README.md index 8847ec0..50ecaf6 100644 --- a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/README.md +++ b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/README.md @@ -1,6 +1,8 @@ # 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. +1.1.1 contains breaking changes. To mitigate this, use the role before doing any upgrades, let it mitigate the path changes, and then run again with your upgrade. + ## Role Variables * _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). diff --git a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/defaults/main.yml b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/defaults/main.yml index 64a426c..1a8ca54 100644 --- a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/defaults/main.yml +++ b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/defaults/main.yml @@ -50,3 +50,7 @@ service_list: # if this is an upgrade artifactory_upgrade_only: false + +#default username and password +artifactory_app_username: admin +artifactory_app_user_pass: password diff --git a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/install.yml b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/install.yml index a0e98ff..9537459 100644 --- a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/install.yml +++ b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/install.yml @@ -52,8 +52,30 @@ until: downloadartifactory is succeeded retries: 3 -- name: MV untar directory to artifactory home - command: "mv {{ artifactory_untar_home }} {{ artifactory_home }}" +- 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: "{{ 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 - name: ensure artifactory_file_store_dir exists @@ -180,7 +202,7 @@ - name: Ensure permissions are correct file: - path: "{{ artifactory_home }}" + path: "{{ jfrog_home_directory }}" group: "{{ artifactory_group }}" owner: "{{ artifactory_user }}" recurse: yes diff --git a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/legacy_migration.yml b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/legacy_migration.yml new file mode 100644 index 0000000..e3e15d5 --- /dev/null +++ b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/legacy_migration.yml @@ -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 diff --git a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/main.yml b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/main.yml index 3afccb3..65728de 100644 --- a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/main.yml +++ b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/main.yml @@ -1,6 +1,44 @@ -- name: perform installation - include_tasks: "install.yml" - when: not artifactory_upgrade_only -- name: perform upgrade - include_tasks: "upgrade.yml" - when: artifactory_upgrade_only \ No newline at end of file +- name: Rectify Legacy Installation Block + block: + - name: Check to see if artifactory has a service and stop it + service: + name: artifactory + state: stopped + become: yes + - 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: Check to see if artifactory has a service and stop it + service: + name: artifactory + state: stopped + - 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 + include_tasks: "install.yml" + when: not artifactory_upgrade_only + - name: perform upgrade + include_tasks: "upgrade.yml" + when: artifactory_upgrade_only \ No newline at end of file diff --git a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/upgrade.yml b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/upgrade.yml index a0273dd..5ac0fd8 100644 --- a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/upgrade.yml +++ b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/tasks/upgrade.yml @@ -14,6 +14,19 @@ state: directory 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 unarchive: src: "{{ artifactory_tar }}" @@ -23,24 +36,42 @@ group: "{{ artifactory_group }}" creates: "{{ artifactory_untar_home }}" become: yes + when: artifactory_tar is defined register: downloadartifactory until: downloadartifactory is succeeded 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: - path: "{{ artifactory_home }}/app" - state: absent + state: link + src: "{{ artifactory_untar_home }}/app" + dest: "{{ artifactory_home }}/app" + owner: "{{ artifactory_user }}" + group: "{{ artifactory_group }}" 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 +- name: Ensure permissions are correct file: - path: "{{ artifactory_untar_home }}" - state: absent + path: "{{ jfrog_home_directory }}" + group: "{{ artifactory_group }}" + owner: "{{ artifactory_user }}" + recurse: yes become: yes - name: start and enable the primary node diff --git a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/templates/system.yaml.j2 b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/templates/system.yaml.j2 index 419a0c3..a7fede0 100644 --- a/Ansible/ansible_collections/jfrog/installers/roles/artifactory/templates/system.yaml.j2 +++ b/Ansible/ansible_collections/jfrog/installers/roles/artifactory/templates/system.yaml.j2 @@ -32,7 +32,13 @@ shared: ## Example for mysql/postgresql type: "{{ db_type }}" - driver: "{{ db_driver }}" - url: "{{ db_url }}" - username: "{{ db_user }}" +{%+ if db_type == 'derby' -%} +# driver: "{{ db_driver }}" +# url: "{{ db_url }}" +# username: "{{ db_user }}" +{%+ else -%} + driver: "{{ db_driver }}" + url: "{{ db_url }}" + username: "{{ db_user }}" +{%+ endif -%} password: "{{ db_password }}" \ No newline at end of file diff --git a/Openshift4/helm/openshift-xray/LICENSE b/Openshift4/helm/openshift-xray/LICENSE old mode 100755 new mode 100644 diff --git a/Openshift4/operator/xray-operator/helm-charts/openshift-xray/README.md b/Openshift4/operator/xray-operator/helm-charts/openshift-xray/README.md old mode 100755 new mode 100644