ansible-development-environ.../roles/users/tasks/main.yml

46 lines
979 B
YAML

---
# tasks file for users
- name: include assert.yml
import_tasks: assert.yml
run_once: yes
delegate_to: localhost
- name: install required software
ansible.builtin.package:
name: "{{ users_requirements }}"
state: present
- name: loop over users_group_list
ansible.builtin.include: group.yml
loop: "{{ users_group_list }}"
loop_control:
label: "{{ group.name }}"
loop_var: group
when:
- users_group_list is defined
- name: loop over users_user_list
ansible.builtin.include: user.yml
loop: "{{ users_user_list }}"
loop_control:
label: "{{ user.name }}"
loop_var: user
when:
- users_user_list is defined
- name: manage cron permission
ansible.builtin.template:
src: cron.allow.j2
dest: /etc/cron.allow
mode: "0640"
when:
- users_cron_allow | bool
- name: check existence of /etc/cron.allow
ansible.builtin.file:
path: /etc/cron.allow
state: absent
when:
- not users_cron_allow|bool