websoft9/apps/application.yml
2022-09-07 12:56:10 +08:00

32 lines
1 KiB
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
- name: Check if nginx is necessary
shell : |
wget -N https://raw.githubusercontent.com/Websoft9/docker-{{appname}}/main/.env
cat .env
register: env_content
failed_when: False
roles:
- { role: role_nginx, tags: "role_nginx", when: env_content.stdout.find('APP_HTTP_PORT') != -1 }
- { role: role_init, tags: "role_init" }
- { role: role_preend, tags: "preend" }
- { role: role_end, tags: "role_end" }