infra/roles/vpn/tasks/main.yml

45 lines
1001 B
YAML
Raw Normal View History

2024-01-02 15:42:42 -05:00
---
- name: ensure headscale docker/compose exist
2024-01-02 15:42:42 -05:00
file:
path: /etc/docker/compose/headscale
2024-01-02 15:42:42 -05:00
state: directory
owner: root
group: root
mode: 0700
2024-01-02 15:42:42 -05:00
- name: copy headscale docker-compose.yml
copy:
src: ../files/docker-compose.yml
dest: /etc/docker/compose/headscale/docker-compose.yml
owner: root
group: root
mode: u=rw,g=r,o=r
2024-01-02 15:42:42 -05:00
- name: copy headscale config volume
2024-01-02 15:42:42 -05:00
copy:
src: ../files/config
dest: /etc/docker/compose/headscale/
owner: root
group: root
mode: u=rw,g=r,o=r
- name: ensure headscale data volume exist
file:
path: /etc/docker/compose/headscale/data
state: directory
owner: root
group: root
mode: 0700
2024-01-02 15:42:42 -05:00
- name: ensure headscale users
shell: |
docker exec headscale headscale user create "{{ item }}"
with_items:
- "{{ headscale_users }}"
2024-01-02 19:05:01 -05:00
- name: daemon-reload and enable headscale
ansible.builtin.systemd_service:
state: restarted
enabled: true
name: docker-compose@headscale