2022-06-27 09:18:46 +08:00
|
|
|
- name: Deploy Application
|
2022-05-10 17:35:30 +08:00
|
|
|
hosts: all
|
|
|
|
become: yes
|
|
|
|
become_method: sudo
|
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- vars/main.yml
|
2022-07-05 16:55:17 +08:00
|
|
|
|
2022-07-11 11:19:15 +08:00
|
|
|
pre_tasks:
|
2022-07-11 12:04:10 +08:00
|
|
|
- name: Get applist
|
2022-07-11 11:19:15 +08:00
|
|
|
block:
|
2022-07-11 12:04:10 +08:00
|
|
|
- name: Get appname and dependencies, combine to a applist
|
|
|
|
shell : |
|
|
|
|
echo "{{appname}}" > /tmp/applist
|
|
|
|
wget -N https://raw.githubusercontent.com/Websoft9/StackHub/main/apps/roles/{{appname}}/meta/main.yml
|
|
|
|
cat main.yml | sed -n '/dependencies/,/galaxy_info/{//!p}'|grep -|awk -F'- ' '{print $2}' >>/tmp/applist
|
|
|
|
cat /tmp/applist
|
|
|
|
register: applist
|
2022-07-11 11:19:15 +08:00
|
|
|
|
2022-07-11 12:04:10 +08:00
|
|
|
- debug:
|
2022-07-11 12:09:30 +08:00
|
|
|
msg: You will install "{{item}}"
|
|
|
|
loop: "{{applist.stdout_lines}}"
|
2022-05-10 17:35:30 +08:00
|
|
|
roles:
|
2022-07-08 16:58:22 +08:00
|
|
|
- { role: role_common, tags: "role_common" }
|
|
|
|
- { role: role_cloud, tags: "role_cloud" }
|
2022-05-11 09:51:13 +08:00
|
|
|
- { role: role_nginx, tags: "role_nginx" }
|
2022-07-05 10:42:12 +08:00
|
|
|
- { role: "{{appname}}", tags: "{{appname}}" }
|
2022-05-11 09:51:13 +08:00
|
|
|
- { role: role_init, tags: "role_init" }
|
|
|
|
- { role: role_preend, tags: "preend" }
|
|
|
|
- { role: role_end, tags: "role_end" }
|