auxilliary common tasks as their own roles

This commit is contained in:
ben 2021-01-24 17:28:05 +01:00
parent dc19cd8bb2
commit 29503aba1f
7 changed files with 23 additions and 11 deletions
roles
common
handlers
tasks
tunnel
users/tasks

View File

@ -13,11 +13,5 @@
name: systemd-timesyncd
state: restarted
- name: restart autossh
service:
name: autossh-{{ item.hostname }}
state: restarted
with_items: "{{ ssh_tunnels }}"
- name: run reboot_required.py
command: /usr/local/bin/reboot_required.py

View File

@ -4,10 +4,13 @@
tags:
- common
- include: users.yml
tags: users
- include_role:
name: users
tags:
- users
- include: tunnel.yml
- include_role:
name: tunnel
when: ssh_tunnels|length > 0
tags:
- tunnel

View File

@ -0,0 +1,8 @@
---
- name: restart autossh
service:
name: autossh-{{ item.hostname }}
state: restarted
with_items: "{{ ssh_tunnels }}"
when: not ansible_check_mode

View File

@ -0,0 +1,3 @@
---
- include: tunnel.yml
tags: tunnel

View File

@ -8,8 +8,8 @@
- autossh
- packages
- name: copy tunnel keys
copy:
- name: template tunnel keys
template:
src: "private/sshkeys/{{ item }}"
dest: /home/.system/tunnel/.ssh/{{ item }}
owner: tunnel
@ -34,3 +34,4 @@
enabled: yes
state: started
with_items: "{{ ssh_tunnels }}"
when: not ansible_check_mode

View File

@ -0,0 +1,3 @@
---
- include: users.yml
tags: users