You've already forked ansible-role-unix-users
							
							
		
			
				
	
	
		
			15 lines
		
	
	
		
			619 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			619 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
---
 | 
						|
 | 
						|
- name: "Create unix group with random gid: {{ unix_group.key }}"
 | 
						|
  ansible.builtin.group:
 | 
						|
    name: "{{ unix_group.key }}"
 | 
						|
    state: "{{ unix_group.value.state | default('present') }}"
 | 
						|
  when: unix_group.value.gid is not defined or unix_group.value.gid is defined and unix_group.value.gid | length <= 0
 | 
						|
 | 
						|
- name: "Create unix group with pre-defined gid: {{ unix_group.key }}"
 | 
						|
  ansible.builtin.group:
 | 
						|
    name: "{{ unix_group.key }}"
 | 
						|
    gid: "{{ unix_group.value.gid }}"
 | 
						|
    state: "{{ unix_group.value.state | default('present') }}"
 | 
						|
  when: unix_group.value.gid is defined and unix_group.value.gid | length > 0
 |