websoft9/apps/application.yml
2022-07-11 15:59:25 +08:00

27 lines
922 B
YAML

- name: Deploy Application
hosts: all
become: yes
become_method: sudo
vars_files:
- vars/main.yml
pre_tasks:
- name: Get applist
block:
- 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
roles:
- { role: role_common, tags: "role_common" }
- { role: role_cloud, tags: "role_cloud" }
- { role: "{{appname}}", tags: "{{appname}}" }
- { role: role_nginx, tags: "role_nginx" }
- { role: role_init, tags: "role_init" }
- { role: role_preend, tags: "preend" }
- { role: role_end, tags: "role_end" }