ansible-edda/playbooks/roles/services/deploy/cloud/tasks/main.yml

45 lines
1.3 KiB
YAML

---
- name: "set the user variables"
ansible.builtin.import_role:
name: "services/include"
vars_from: "user"
- block:
- name: "{{ services_service_name }} : configure hosts file"
ansible.builtin.template:
src: "hosts"
dest: "{{ services_service_user_home }}/.config/service/hosts"
mode: 0644
register: services_deploy_cloud_hosts_file
- name: "configure nginx"
ansible.builtin.copy:
src: "./config/nginx.conf"
dest: "{{ services_service_user_home }}/.config/service/nginx.conf"
mode: 0644
register: services_deploy_cloud_config_files
- name: "configure nextcloud secrets"
ansible.builtin.template:
src: "./nextcloud/{{ item }}"
dest: "{{ services_service_user_home }}/.config/service/{{ item }}"
mode: 0600
loop:
- "database.name"
- "database.password"
- "database.user"
register: services_deploy_cloud_nextcloud_files
become_user: "{{ services_service_user_name }}"
- name: "{{ services_service_name }} : configure systemd service"
ansible.builtin.include_role:
name: "services/deploy/pod"
vars:
services_deploy_pod_needs_restart: "{{
services_deploy_cloud_hosts_file.changed or
services_deploy_cloud_config_files.changed or
services_deploy_cloud_nextcloud_files.changed
}}"