1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
- name: Set global login attempts (macOS)
command:
pwpolicy
-n /Local/Default
-setglobalpolicy 'maxFailedLoginAttempts={{ user_policies_max_failed_logins }}'
when:
- ansible_system == 'Darwin'
changed_when: true
- name: Set user login attempts (macOS)
vars:
max_failed_logins: "{{ item.policies.max_failed_logins | default(user_policies_max_failed_logins) }}"
command: >
pwpolicy
-u '{{ item.name }}'
-setpolicy 'maxFailedLoginAttempts={{ max_failed_logins }}'
with_items: "{{ user_policies_users }}"
when:
- ansible_system == 'Darwin'
changed_when: true
|