79717627

Date: 2025-07-28 16:30:50
Score: 3
Natty:
Report link
---
- name: List Local Users
  hosts: all
  gather_facts: false
  tasks:
    - name: Get local user information
      getent:
        database: passwd
      register: passwd_entries

    - name: Display local users
      debug:
        msg: "Local user: {{ item.key }}"
      loop: "{{ passwd_entries.ansible_facts.getent_passwd | dict2items }}"
      when: item.value[6] != '/usr/sbin/nologin' and item.value[6] != '/bin/false'

Can you test it this way?

Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Can you
  • Low reputation (1):
Posted by: bob