|
|
@ -57,20 +57,20 @@ EXAMPLES = '''
|
|
|
|
database: passwd
|
|
|
|
database: passwd
|
|
|
|
key: root
|
|
|
|
key: root
|
|
|
|
- debug:
|
|
|
|
- debug:
|
|
|
|
var: getent_passwd
|
|
|
|
var: ansible_facts.getent_passwd
|
|
|
|
|
|
|
|
|
|
|
|
- name: Get all groups
|
|
|
|
- name: Get all groups
|
|
|
|
getent:
|
|
|
|
getent:
|
|
|
|
database: group
|
|
|
|
database: group
|
|
|
|
split: ':'
|
|
|
|
split: ':'
|
|
|
|
- debug:
|
|
|
|
- debug:
|
|
|
|
var: getent_group
|
|
|
|
var: ansible_facts.getent_group
|
|
|
|
|
|
|
|
|
|
|
|
- name: Get all hosts, split by tab
|
|
|
|
- name: Get all hosts, split by tab
|
|
|
|
getent:
|
|
|
|
getent:
|
|
|
|
database: hosts
|
|
|
|
database: hosts
|
|
|
|
- debug:
|
|
|
|
- debug:
|
|
|
|
var: getent_hosts
|
|
|
|
var: ansible_facts.getent_hosts
|
|
|
|
|
|
|
|
|
|
|
|
- name: Get http service info, no error if missing
|
|
|
|
- name: Get http service info, no error if missing
|
|
|
|
getent:
|
|
|
|
getent:
|
|
|
@ -78,7 +78,7 @@ EXAMPLES = '''
|
|
|
|
key: http
|
|
|
|
key: http
|
|
|
|
fail_key: False
|
|
|
|
fail_key: False
|
|
|
|
- debug:
|
|
|
|
- debug:
|
|
|
|
var: getent_services
|
|
|
|
var: ansible_facts.getent_services
|
|
|
|
|
|
|
|
|
|
|
|
- name: Get user password hash (requires sudo/root)
|
|
|
|
- name: Get user password hash (requires sudo/root)
|
|
|
|
getent:
|
|
|
|
getent:
|
|
|
@ -86,7 +86,7 @@ EXAMPLES = '''
|
|
|
|
key: www-data
|
|
|
|
key: www-data
|
|
|
|
split: ':'
|
|
|
|
split: ':'
|
|
|
|
- debug:
|
|
|
|
- debug:
|
|
|
|
var: getent_shadow
|
|
|
|
var: ansible_facts.getent_shadow
|
|
|
|
|
|
|
|
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
import traceback
|
|
|
|
import traceback
|
|
|
|