Introduce a blank template for roles.

This commit is contained in:
Tom Alexander 2022-10-11 22:01:06 -04:00
parent 322c5bc711
commit 8e5e91bbce
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
14 changed files with 40 additions and 4 deletions

View File

@ -0,0 +1 @@
# foo: []

View File

View File

@ -0,0 +1,4 @@
# - name: restart foo
# service:
# name: foo
# state: restarted

View File

@ -0,0 +1,2 @@
# dependencies:
# - users

View File

@ -0,0 +1,14 @@
- import_tasks: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/linux.yaml
when: 'os_flavor == "linux"'
- include_tasks:
file: tasks/peruser.yaml
apply:
become: yes
become_user: "{{ initialize_user }}"
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
loop_control:
loop_var: initialize_user

View File

View File

View File

@ -0,0 +1,2 @@
- import_tasks: tasks/common.yaml
when: foo is defined

View File

@ -0,0 +1,8 @@
- include_role:
name: per_user
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/peruser_linux.yaml
when: 'os_flavor == "linux"

View File

@ -1,4 +0,0 @@
- name: restart zrepl
service:
name: zrepl
state: restarted

View File

@ -3,3 +3,12 @@
- import_tasks: tasks/linux.yaml
when: 'os_flavor == "linux"'
- include_tasks:
file: tasks/peruser.yaml
apply:
become: yes
become_user: "{{ initialize_user }}"
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
loop_control:
loop_var: initialize_user