File tree Expand file tree Collapse file tree 6 files changed +158
-0
lines changed
test/deploy/linux/shell/roles Expand file tree Collapse file tree 6 files changed +158
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ # Parameters:
3
+ # step_configure: A shell command snippet to execute
4
+ # chdir_path: Optional, change into this directory before running the command
5
+
6
+ - set_fact :
7
+ chdir_path : " {{ ansible_env.HOME }}"
8
+ when : chdir_path is not defined
9
+
10
+ - set_fact :
11
+ chdir_path : " {{ chdir_path }}/{{ service_id }}"
12
+ when : service_id is defined
13
+
14
+ - block :
15
+ - name : Run configure step
16
+ ansible.builtin.shell : " {{step_configure}}"
17
+ args :
18
+ chdir : " {{ chdir_path }}"
19
+ async : 600
20
+ register : output
21
+ become : true
22
+ - fail :
23
+ msg : " The command failed to install when it was expected to succeed:{{ output.stdout }}"
24
+ when : output is failed
25
+ when : step_configure is defined
Original file line number Diff line number Diff line change
1
+ ---
2
+ # Parameters:
3
+ # step_onafterstart: A shell command snippet to execute
4
+ # chdir_path: Optional, change into this directory before running the command
5
+
6
+ - set_fact :
7
+ chdir_path : " {{ ansible_env.HOME }}"
8
+ when : chdir_path is not defined
9
+
10
+ - set_fact :
11
+ chdir_path : " {{ chdir_path }}/{{ service_id }}"
12
+ when : service_id is defined
13
+
14
+ - block :
15
+ - name : Run onafterstart step
16
+ ansible.builtin.shell : " {{step_onafterstart}}"
17
+ args :
18
+ chdir : " {{ chdir_path }}"
19
+ async : 600
20
+ register : output
21
+ become : true
22
+ - fail :
23
+ msg : " The command failed to install when it was expected to succeed:{{ output.stdout }}"
24
+ when : output is failed
25
+ when : step_onafterstart is defined
Original file line number Diff line number Diff line change
1
+ ---
2
+ # Parameters:
3
+ # step_onbeforestart: A shell command snippet to execute
4
+ # chdir_path: Optional, change into this directory before running the command
5
+
6
+ - set_fact :
7
+ chdir_path : " {{ ansible_env.HOME }}"
8
+ when : chdir_path is not defined
9
+
10
+ - set_fact :
11
+ chdir_path : " {{ chdir_path }}/{{ service_id }}"
12
+ when : service_id is defined
13
+
14
+ - block :
15
+ - name : Run onbeforestart step
16
+ ansible.builtin.shell : " {{step_onbeforestart}}"
17
+ args :
18
+ chdir : " {{ chdir_path }}"
19
+ async : 600
20
+ register : output
21
+ become : true
22
+ - fail :
23
+ msg : " The command failed to install when it was expected to succeed:{{ output.stdout }}"
24
+ when : output is failed
25
+ when : step_onbeforestart is defined
Original file line number Diff line number Diff line change
1
+ ---
2
+ # Parameters:
3
+ # step_onstart: A shell command snippet to execute
4
+ # chdir_path: Optional, change into this directory before running the command
5
+
6
+ - set_fact :
7
+ chdir_path : " {{ ansible_env.HOME }}"
8
+ when : chdir_path is not defined
9
+
10
+ - set_fact :
11
+ chdir_path : " {{ chdir_path }}/{{ service_id }}"
12
+ when : service_id is defined
13
+
14
+ - block :
15
+ - name : Run onstart step
16
+ ansible.builtin.shell : " {{step_onstart}}"
17
+ args :
18
+ chdir : " {{ chdir_path }}"
19
+ async : 600
20
+ register : output
21
+ become : true
22
+ - fail :
23
+ msg : " The command failed to install when it was expected to succeed:{{ output.stdout }}"
24
+ when : output is failed
25
+ when : step_onstart is defined
Original file line number Diff line number Diff line change
1
+ ---
2
+ # Parameters:
3
+ # step_prepare: A shell command snippet to execute
4
+ # chdir_path: Optional, change into this directory before running the command
5
+
6
+ - set_fact :
7
+ chdir_path : " {{ ansible_env.HOME }}"
8
+ when : chdir_path is not defined
9
+
10
+ - set_fact :
11
+ chdir_path : " {{ chdir_path }}/{{ service_id }}"
12
+ when : service_id is defined
13
+
14
+ - block :
15
+ - name : Run prepare step
16
+ ansible.builtin.shell : " {{step_prepare}}"
17
+ args :
18
+ chdir : " {{ chdir_path }}"
19
+ async : 600
20
+ register : output
21
+ become : true
22
+ - fail :
23
+ msg : " The command failed to install when it was expected to succeed:{{ output.stdout }}"
24
+ when : output is failed
25
+ when : step_prepare is defined
Original file line number Diff line number Diff line change
1
+ ---
2
+ # Parameters:
3
+ # step_upload_file_base64: A base64 encoded file
4
+ # step_upload_file_name: A filename to write the file to
5
+ # chdir_path: Optional, change into this directory before running the command
6
+
7
+ - set_fact :
8
+ chdir_path : " {{ ansible_env.HOME }}"
9
+ when : chdir_path is not defined
10
+
11
+ - set_fact :
12
+ chdir_path : " {{ chdir_path }}/{{ service_id }}"
13
+ when : service_id is defined
14
+
15
+ - block :
16
+ - fail :
17
+ msg : " A step_upload_file_name is required. Create this entry in your user config file"
18
+ when : step_upload_file_name is not defined
19
+ - set_fact :
20
+ step_upload_file_path : " {{ chdir_path }}/{{ step_upload_file_name }}"
21
+ - name : decode base64 file
22
+ set_fact :
23
+ step_upload_file_content : " {{step_upload_file_base64 | b64decode}}"
24
+ - name : Copy file to remove
25
+ ansible.builtin.copy :
26
+ content : " {{ step_upload_file_content }}"
27
+ dest : " {{ step_upload_file_path }}"
28
+ register : output
29
+ become : true
30
+ - fail :
31
+ msg : " The command failed to upload the file {{ step_upload_file_name }} to {{ step_upload_file_path }} details:{{ output.stdout }}"
32
+ when : output is failed
33
+ when : step_upload_file_base64 is defined
You can’t perform that action at this time.
0 commit comments