Debian Codegraph @

test/integration/targets/user/files/userlist.sh

raw
1 #!/usr/bin/env bash
2
3 #- name: make a list of groups
4 # shell: |
5 # cat /etc/group | cut -d: -f1
6 # register: group_names
7 # when: 'ansible_distribution != "MacOSX"'
8
9 #- name: make a list of groups [mac]
10 # shell: dscl localhost -list /Local/Default/Groups
11 # register: group_names
12 # when: 'ansible_distribution == "MacOSX"'
13
14 DISTRO="$*"
15
16 if [[ "$DISTRO" == "MacOSX" ]]; then
17 dscl localhost -list /Local/Default/Users
18 else
19 grep -E -v ^\# /etc/passwd | cut -d: -f1
20 fi