websoft9/apps/roles/role_init/tasks/main.yml
2022-07-11 15:19:42 +08:00

29 lines
629 B
YAML

- block:
- name: Create credentials Folder
file:
path: /credentials
state: directory
- name: Create a symbolic link of app
file:
src: "{{installpath}}/{{item}}/.env"
dest: "/credentials/{{item}}_password.txt"
state: link
loop: "{{applist.stdout_lines}}"
- name: Copy Init Script
template:
src: init.sh.jinja2
dest: /credentials/init.sh
mode: 0750
- 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