Reorganize playbooks to modularize Zerotier enrollment

This commit is contained in:
Salt 2022-01-23 16:37:56 -06:00
parent 964d3228e2
commit 53ffaf52c4
3 changed files with 17 additions and 16 deletions

View File

@ -1,15 +0,0 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- hosts: tags_zerotier
roles:
- role: zerotier
tags: [ zerotier ]
- hosts: all
tasks:
- name: disable zerotier when not tagged
systemd: name={{ item }} state=stopped enabled=no
with_items:
- zerotier-one.service
when: "'tags_zerotier' not in group_names and item in services"
tags: [ zerotier ]

15
playbooks/tags_zt-personal.yml Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- hosts: tags_zt-personal
roles:
- role: zerotier
tags: [ zerotier ]
#- hosts: all
# tasks:
# - name: disable zerotier when not tagged
# systemd: name={{ item }} state=stopped enabled=no
# with_items:
# - zerotier-one.service
# when: "'tags_zt-personal' not in group_names and item in services"
# tags: [ zerotier ]

View File

@ -11,8 +11,9 @@
# Manufacturer configuration
- import_playbook: playbooks/manufacturers_raspi.yml
- import_playbook: playbooks/manufacturers_s76.yml
# Zerotier network configuration
- import_playbook: playbooks/tags_zt-personal.yml
# Tags for fundamental services
- import_playbook: playbooks/tags_zerotier.yml
- import_playbook: playbooks/tags_snmp.yml
- import_playbook: playbooks/tags_nagios.yml
# Role (in the Netbox sense) configuration