websoft9/apps/application.yml

40 lines
1.3 KiB
YAML
Raw Normal View History

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 : |
2022-10-26 10:10:44 +08:00
echo "{{appname}}" > applist
2022-12-09 10:59:18 +08:00
cat ./roles/{{appname}}/meta/main.yml | sed -n '/dependencies/,/galaxy_info/{//!p}'|grep -|awk -F'- ' '{print $2}' >> applist
2022-10-26 10:10:44 +08:00
cat applist
2022-07-11 12:04:10 +08:00
register: applist
2022-10-26 09:12:24 +08:00
delegate_to: 127.0.0.1
2022-09-07 12:05:35 +08:00
2022-08-23 17:01:51 +08:00
- name: Check if nginx is necessary
shell : |
2022-10-22 09:17:14 +08:00
wget -N https://raw.githubusercontent.com/Websoft9/docker-library/main/apps/{{appname}}/.env
2022-08-23 17:14:08 +08:00
cat .env
register: env_content
2022-09-07 10:13:19 +08:00
failed_when: False
2022-10-26 09:12:24 +08:00
delegate_to: 127.0.0.1
2022-12-09 09:24:37 +08:00
- name: copy test
2022-12-09 10:53:53 +08:00
shell: pwd >> /tmp/test
2022-12-09 09:45:06 +08:00
delegate_to: 127.0.0.1
2022-05-10 17:35:30 +08:00
roles:
2022-09-07 12:56:34 +08:00
- { role: role_common, tags: "role_common" }
- { role: role_cloud, tags: "role_cloud" }
- { role: "{{appname}}", tags: "{{appname}}" }
2022-08-23 17:14:08 +08:00
- { role: role_nginx, tags: "role_nginx", when: env_content.stdout.find('APP_HTTP_PORT') != -1 }
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" }