You've already forked ansible-role-unix-users
							
							
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
---
 | 
						|
 | 
						|
- name: Remove unix user
 | 
						|
  ansible.builtin.include_tasks: remove_unix_user.yaml
 | 
						|
  with_dict: "{{ unix_users }}"
 | 
						|
  loop_control:
 | 
						|
    loop_var: unix_user
 | 
						|
  when: unix_users is defined and
 | 
						|
        unix_users | length > 0 and
 | 
						|
        unix_user.value.state is defined and
 | 
						|
        unix_user.value.state == 'absent'
 | 
						|
 | 
						|
- name: Remove unix groups
 | 
						|
  ansible.builtin.include_tasks: remove_unix_group.yaml
 | 
						|
  with_dict: "{{ unix_groups }}"
 | 
						|
  loop_control:
 | 
						|
    loop_var: unix_group
 | 
						|
  when: unix_groups is defined and
 | 
						|
        unix_groups | length > 0 and
 | 
						|
        unix_group.value.state is defined and
 | 
						|
        unix_group.value.state == 'absent'
 | 
						|
 | 
						|
- name: Create unix groups
 | 
						|
  ansible.builtin.include_tasks: create_unix_group.yaml
 | 
						|
  with_dict: "{{ unix_groups }}"
 | 
						|
  loop_control:
 | 
						|
    loop_var: unix_group
 | 
						|
  when: unix_groups is defined and
 | 
						|
        unix_groups | length > 0 and
 | 
						|
        (
 | 
						|
          (unix_group.value.state is defined and unix_group.value.state == 'present') or
 | 
						|
          unix_group.value.state is not defined
 | 
						|
        )
 | 
						|
 | 
						|
- name: Create unix users
 | 
						|
  ansible.builtin.include_tasks: create_unix_user.yaml
 | 
						|
  no_log: true
 | 
						|
  with_dict: "{{ unix_users }}"
 | 
						|
  loop_control:
 | 
						|
    loop_var: unix_user
 | 
						|
  when: unix_users is defined and
 | 
						|
        unix_users | length > 0 and
 | 
						|
        (
 | 
						|
          (unix_user.value.state is defined and unix_user.value.state == 'present') or
 | 
						|
          unix_user.value.state is not defined
 | 
						|
        )
 |