Skip to content

Instantly share code, notes, and snippets.

@bcoca
Created February 26, 2020 15:51
Show Gist options
  • Save bcoca/2e953308927d8679b67791f6c847d308 to your computer and use it in GitHub Desktop.
Save bcoca/2e953308927d8679b67791f6c847d308 to your computer and use it in GitHub Desktop.
- mytask:
vars:
local_var: '{{(local_var <= 20)|ternary(20, local_var)}}'
@dsglaser
Copy link

dsglaser commented Feb 26, 2020

- name: 1.2.2 - Ensure Account lockout threshold is set to {{ account_lockout_threshold }} or fewer attempts, but not 0
win_security_policy:
section: System Access
key: LockoutBadCount
value: '{{ (account_lockout_threshold < 1 ) | ternary(10, account_lockout_threshold) }}''

$ ansible-playbook -i inventory2019 test.yml -e "account_lockout_threshold=0"
it inserts the 0 without any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment