Introduce a blank template for roles.
This commit is contained in:
parent
322c5bc711
commit
8e5e91bbce
1
ansible/roles/blank/defaults/main.yaml
Normal file
1
ansible/roles/blank/defaults/main.yaml
Normal file
@ -0,0 +1 @@
|
||||
# foo: []
|
0
ansible/roles/blank/files/foo
Normal file
0
ansible/roles/blank/files/foo
Normal file
4
ansible/roles/blank/handlers/main.yaml
Normal file
4
ansible/roles/blank/handlers/main.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
# - name: restart foo
|
||||
# service:
|
||||
# name: foo
|
||||
# state: restarted
|
2
ansible/roles/blank/meta/main.yaml
Normal file
2
ansible/roles/blank/meta/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
# dependencies:
|
||||
# - users
|
14
ansible/roles/blank/tasks/common.yaml
Normal file
14
ansible/roles/blank/tasks/common.yaml
Normal 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
|
0
ansible/roles/blank/tasks/freebsd.yaml
Normal file
0
ansible/roles/blank/tasks/freebsd.yaml
Normal file
0
ansible/roles/blank/tasks/linux.yaml
Normal file
0
ansible/roles/blank/tasks/linux.yaml
Normal file
2
ansible/roles/blank/tasks/main.yaml
Normal file
2
ansible/roles/blank/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
- import_tasks: tasks/common.yaml
|
||||
when: foo is defined
|
8
ansible/roles/blank/tasks/peruser.yaml
Normal file
8
ansible/roles/blank/tasks/peruser.yaml
Normal 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"
|
0
ansible/roles/blank/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/blank/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/blank/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/blank/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/blank/templates/foo.yaml.j2
Normal file
0
ansible/roles/blank/templates/foo.yaml.j2
Normal file
@ -1,4 +0,0 @@
|
||||
- name: restart zrepl
|
||||
service:
|
||||
name: zrepl
|
||||
state: restarted
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user