-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_script.yml
More file actions
24 lines (18 loc) · 979 Bytes
/
run_script.yml
File metadata and controls
24 lines (18 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
- fail:
msg: "Script type is invalid for {{ script_param.file }}."
when: script_param.type != "sql" and script_param.type != "shell" and script_param.type != "yml"
#- name: "Debug"
# debug: msg="Processing {{ script_param }}"
- name: "Check if {{ shared_folder }}/{{ script_param.folder | default('user_scripts') }}/{{ script_param.file }} exists"
stat:
path: "{{ shared_folder }}/{{ script_param.folder | default('user_scripts') }}/{{ script_param.file }}"
register: file_stat_result
- fail:
msg: "Could not find {{ script_param.file }} file in {{ script_param.folder | default('user_scripts') }}."
when: file_stat_result.stat.exists == false
- include: run_sql.yml sql_param="{{ script_param }}"
when: script_param.type == "sql"
- include: run_shell.yml shell_param="{{ script_param }}"
when: script_param.type == "shell"
- include: "{{ script_param.folder | default('user_scripts') }}/{{ script_param.file }}"
when: script_param.type == "yml"