websoft9/apps/roles/role_init/tasks/main.yml

29 lines
629 B
YAML
Raw Normal View History

2022-07-11 14:03:55 +08:00
- block:
2022-07-11 14:40:24 +08:00
- name: Create credentials Folder
file:
path: /credentials
state: directory
2022-07-11 14:03:55 +08:00
2022-07-11 15:13:23 +08:00
- name: Create a symbolic link of app
2022-07-11 14:40:24 +08:00
file:
2022-07-11 15:11:22 +08:00
src: "{{installpath}}/{{item}}/.env"
2022-07-11 14:40:24 +08:00
dest: "/credentials/{{item}}_password.txt"
state: link
loop: "{{applist.stdout_lines}}"
2022-07-11 14:03:55 +08:00
- name: Copy Init Script
template:
src: init.sh.jinja2
dest: /credentials/init.sh
mode: 0750
2022-07-11 14:40:24 +08:00
2022-07-11 14:03:55 +08:00
- name: Upload init-apps.service
template:
src: init-apps.service.jinja2
dest: /lib/systemd/system/init-apps.service
- name: Enable service
service:
name: init-apps
enabled: yes