mirror of
https://github.com/ZwareBear/JFrog-Cloud-Installers.git
synced 2026-01-22 02:06:58 -06:00
[Ansible] JFrog Platform 7.23.3 (#148)
This commit is contained in:
committed by
GitHub
parent
60b0620387
commit
1976ab309c
@@ -7,7 +7,7 @@
|
||||
yum:
|
||||
name: expect
|
||||
state: present
|
||||
when: ansible_os_family == 'Redhat'
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Install expect dependency
|
||||
become: yes
|
||||
@@ -35,18 +35,33 @@
|
||||
shell: /bin/bash
|
||||
state: present
|
||||
|
||||
- name: Check if mc tar exists
|
||||
become: yes
|
||||
stat:
|
||||
path: "{{ jfrog_home_directory }}/{{ mc_tar_file_name }}"
|
||||
register: mc_tar_check
|
||||
|
||||
- name: Download mc
|
||||
become: yes
|
||||
unarchive:
|
||||
src: "{{ mc_tar }}"
|
||||
get_url:
|
||||
url: "{{ mc_tar }}"
|
||||
timeout: "{{ mc_download_timeout }}"
|
||||
dest: "{{ jfrog_home_directory }}"
|
||||
remote_src: yes
|
||||
register: download_mc
|
||||
until: download_mc is succeeded
|
||||
retries: 3
|
||||
when: not mc_tar_check.stat.exists
|
||||
|
||||
- name: Extract mc tar
|
||||
become: yes
|
||||
unarchive:
|
||||
src: "{{ jfrog_home_directory }}/{{ mc_tar_file_name }}"
|
||||
dest: "{{ jfrog_home_directory }}"
|
||||
remote_src: true
|
||||
owner: "{{ mc_user }}"
|
||||
group: "{{ mc_group }}"
|
||||
creates: "{{ mc_untar_home }}"
|
||||
register: downloadmc
|
||||
until: downloadmc is succeeded
|
||||
retries: 3
|
||||
when: download_mc is succeeded
|
||||
|
||||
- name: Check if app directory exists
|
||||
become: yes
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
- name: perform installation
|
||||
include_tasks: "install.yml"
|
||||
when: not mc_upgrade_only
|
||||
when:
|
||||
- mc_enabled
|
||||
- not mc_upgrade_only
|
||||
- name: perform upgrade
|
||||
include_tasks: "upgrade.yml"
|
||||
when: mc_upgrade_only
|
||||
when:
|
||||
- mc_enabled
|
||||
- mc_upgrade_only
|
||||
@@ -87,7 +87,7 @@
|
||||
- --strip-components=1
|
||||
owner: elasticsearch
|
||||
group: elasticsearch
|
||||
creates: "{{ mc_es_java_home }}"
|
||||
creates: "{{ mc_es_script_path }}"
|
||||
register: unarchive_result
|
||||
when: check_elasticsearch_package_result.matched > 0
|
||||
|
||||
@@ -159,12 +159,20 @@
|
||||
environment:
|
||||
ES_JAVA_HOME: "{{ mc_es_java_home }}"
|
||||
ES_PATH_CONF: "{{ mc_es_conf_base }}/"
|
||||
register: start_elasticsearch_result
|
||||
register: start_elasticsearch
|
||||
when: unarchive_result.extract_results.rc | default(128) == 0
|
||||
|
||||
- name: Wait for elasticsearch to start
|
||||
pause:
|
||||
seconds: 15
|
||||
seconds: 30
|
||||
when: start_elasticsearch.changed
|
||||
|
||||
- name: Check if elasticsearch is running
|
||||
wait_for:
|
||||
host: localhost
|
||||
port: "{{ mc_es_transport_port }}"
|
||||
delay: 5
|
||||
connect_timeout: 1
|
||||
|
||||
- name: Init searchguard plugin
|
||||
become: yes
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
- name: Install searchguard plugin
|
||||
become: yes
|
||||
become_user: elasticsearch
|
||||
ignore_errors: yes
|
||||
shell: |
|
||||
{{ mc_es_script_path }}/elasticsearch-plugin install \
|
||||
@@ -57,6 +56,7 @@
|
||||
loop:
|
||||
- "sg_roles.yml"
|
||||
- "sg_roles_mapping.yml"
|
||||
- "sg_config.yml"
|
||||
|
||||
- name: Check execution bit
|
||||
become: yes
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
shell: |
|
||||
{{ mc_es_script_path }}/elasticsearch-plugin remove {{ check_searchguard_bundle_result.files[0].path }}
|
||||
environment:
|
||||
JAVA_HOME: "{{ mc_es_java_home }}"
|
||||
ES_JAVA_HOME: "{{ mc_es_java_home }}"
|
||||
ES_PATH_CONF: "{{ mc_es_conf_base }}/config"
|
||||
register: remove_searchguard_result
|
||||
when: check_searchguard_bundle_result.matched == 1
|
||||
@@ -75,6 +75,7 @@
|
||||
- --exclude=config
|
||||
owner: elasticsearch
|
||||
group: elasticsearch
|
||||
creates: "{{ mc_es_script_path }}"
|
||||
register: unarchive_result
|
||||
when: check_elasticsearch_package_result.matched > 0
|
||||
|
||||
@@ -107,4 +108,16 @@
|
||||
ES_JAVA_HOME: "{{ mc_es_java_home }}"
|
||||
ES_PATH_CONF: "{{ mc_es_conf_base }}/"
|
||||
when: unarchive_result.extract_results.rc | default(128) == 0
|
||||
register: start_elastcsearch_upgraded
|
||||
register: start_elastcsearch
|
||||
|
||||
- name: Wait for elasticsearch to start
|
||||
pause:
|
||||
seconds: 30
|
||||
when: start_elasticsearch.changed
|
||||
|
||||
- name: Check if elasticsearch is running
|
||||
wait_for:
|
||||
host: localhost
|
||||
port: "{{ mc_es_transport_port }}"
|
||||
delay: 5
|
||||
connect_timeout: 1
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
- name: Install searchguard plugin
|
||||
become: yes
|
||||
become_user: elasticsearch
|
||||
ignore_errors: yes
|
||||
shell: |
|
||||
{{ mc_es_script_path }}/elasticsearch-plugin install \
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
url: "{{ mc_tar }}"
|
||||
timeout: "{{ mc_download_timeout }}"
|
||||
dest: "{{ jfrog_home_directory }}"
|
||||
register: downloadmc
|
||||
until: downloadmc is succeeded
|
||||
register: download_mc
|
||||
until: download_mc is succeeded
|
||||
retries: 3
|
||||
when: not mc_tar_check.stat.exists
|
||||
|
||||
@@ -28,68 +28,37 @@
|
||||
owner: "{{ mc_user }}"
|
||||
group: "{{ mc_group }}"
|
||||
creates: "{{ mc_untar_home }}"
|
||||
when: downloadmc is succeeded
|
||||
when: download_mc is succeeded
|
||||
|
||||
- name: Stop mc service
|
||||
become: yes
|
||||
systemd:
|
||||
name: "{{ mc_daemon }}"
|
||||
state: stopped
|
||||
when: downloadmc.changed
|
||||
when: download_mc.changed
|
||||
|
||||
- name: Delete current app folder
|
||||
become: yes
|
||||
file:
|
||||
path: "{{ mc_home }}/app"
|
||||
state: absent
|
||||
when: downloadmc.changed
|
||||
when: download_mc.changed
|
||||
|
||||
- name: Copy new app to mc app
|
||||
command: "cp -r {{ mc_untar_home }}/app/. {{ mc_home }}/app"
|
||||
become: yes
|
||||
when: downloadmc.changed
|
||||
when: download_mc.changed
|
||||
|
||||
- name: Delete untar directory
|
||||
file:
|
||||
path: "{{ mc_untar_home }}"
|
||||
state: absent
|
||||
become: yes
|
||||
when: downloadmc.changed
|
||||
when: download_mc.changed
|
||||
|
||||
- name: Upgrade elasticsearch
|
||||
import_tasks: upgrade-elasticsearch.yml
|
||||
when: downloadmc.changed
|
||||
|
||||
- name: Check if install.sh wrapper script exist
|
||||
become: yes
|
||||
stat:
|
||||
path: "{{ mc_install_script_path }}/install.sh"
|
||||
register: upgrade_wrapper_script
|
||||
when: downloadmc.changed
|
||||
|
||||
- name: Include interactive installer scripts
|
||||
include_vars: script/archive.yml
|
||||
|
||||
- name: Upgrade JFMC
|
||||
include_tasks: expect.yml
|
||||
vars:
|
||||
exp_executable_cmd: "./install.sh -u {{ mc_user }} -g {{ mc_group }}"
|
||||
exp_dir: "{{ mc_install_script_path }}"
|
||||
exp_scenarios: "{{ mc_installer_scenario['main'] }}"
|
||||
args:
|
||||
apply:
|
||||
environment:
|
||||
YQ_PATH: "{{ mc_thirdparty_path }}/yq"
|
||||
when:
|
||||
- upgrade_wrapper_script.stat.exists
|
||||
- downloadmc.changed
|
||||
|
||||
- name: Configure installer info
|
||||
become: yes
|
||||
template:
|
||||
src: installer-info.json.j2
|
||||
dest: "{{ mc_home }}/var/etc/info/installer-info.json"
|
||||
notify: restart missioncontrol
|
||||
when: download_mc.changed
|
||||
|
||||
- name: Check if systemyaml exists
|
||||
become: yes
|
||||
@@ -108,6 +77,37 @@
|
||||
- mc_systemyaml_override or (not systemyaml.stat.exists)
|
||||
notify: restart missioncontrol
|
||||
|
||||
- name: Check if install.sh wrapper script exist
|
||||
become: yes
|
||||
stat:
|
||||
path: "{{ mc_install_script_path }}/install.sh"
|
||||
register: upgrade_wrapper_script
|
||||
when: download_mc.changed
|
||||
|
||||
- name: Include interactive installer scripts
|
||||
include_vars: script/archive.yml
|
||||
|
||||
- name: Upgrade JFMC
|
||||
include_tasks: expect.yml
|
||||
vars:
|
||||
exp_executable_cmd: "./install.sh -u {{ mc_user }} -g {{ mc_group }}"
|
||||
exp_dir: "{{ mc_install_script_path }}"
|
||||
exp_scenarios: "{{ mc_installer_scenario['main'] }}"
|
||||
args:
|
||||
apply:
|
||||
environment:
|
||||
YQ_PATH: "{{ mc_thirdparty_path }}/yq"
|
||||
when:
|
||||
- upgrade_wrapper_script.stat.exists
|
||||
- download_mc.changed
|
||||
|
||||
- name: Configure installer info
|
||||
become: yes
|
||||
template:
|
||||
src: installer-info.json.j2
|
||||
dest: "{{ mc_home }}/var/etc/info/installer-info.json"
|
||||
notify: restart missioncontrol
|
||||
|
||||
- name: Update correct permissions
|
||||
become: yes
|
||||
file:
|
||||
|
||||
Reference in New Issue
Block a user