-
Notifications
You must be signed in to change notification settings - Fork 3
/
engines_start.yml
66 lines (55 loc) · 2.26 KB
/
engines_start.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
- name: Start an engine
hosts: engines
tasks:
# --------------------------------------------------------------------------------
# Prerequisites
- name: Ensure docker is installed if this is a DOCKER installation
pip:
name:
- docker>=1.8.0
executable: pip3
when: INSTALL_TYPE == 'DOCKER'
- name: Add the current user to docker group
user:
name: '{{ item }}'
groups: 'docker'
append: 'yes'
with_items:
- "{{ ansible_user_id }}"
when: INSTALL_TYPE == 'DOCKER'
ignore_errors: yes
- name: If docker is needed, check whether it's installed
ansible.builtin.shell:
cmd: "docker --version"
when: INSTALL_TYPE == 'DOCKER'
- name: If java is needed, check whether it's installed
ansible.builtin.shell:
cmd: "java -version"
when: INSTALL_TYPE == 'TARBALL'
- name: Create directories
ansible.builtin.file:
path: "{{ STREAMSETS_DOWNLOAD_DIR }}"
state: directory
- name: Create directories
ansible.builtin.file:
path: "{{ STREAMSETS_INSTALL_DIR }}"
state: directory
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
- name: SECTION 9 - RUN THE INSTALLATION COMMAND - STEP 9.1 Extract the command that was saved as a 'host'
set_fact:
installCommand: "{{ hostvars['INSTALL_COMMAND_HOST']['INSTALL_COMMAND_VAR'] }}"
- name: STEP 9.2 - Run retrieved install command for TARBALL installations
ansible.builtin.shell: "{{ installCommand }} --no-prompt --download-dir={{ STREAMSETS_DOWNLOAD_DIR }} --install-dir={{ STREAMSETS_INSTALL_DIR }} --background"
when: "INSTALL_TYPE=='TARBALL'"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin"
register: scriptResult
- name: STEP 9.3 - Run retrieved install command for DOCKER installations
ansible.builtin.shell: "{{ installCommand }}"
when: "INSTALL_TYPE=='DOCKER'"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin"
register: scriptResult
# --------------------------------------------------------------------------------