Skip to content

Commit

Permalink
update when conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant Brown committed Nov 4, 2019
1 parent 26e8c58 commit 7d7ad98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions tasks/hmac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

- name: generate hmac {{ hmac_key_algorithm|upper }} key
raw: "head -c {{ hmac_key_algorithm_lengths[hmac_key_algorithm|upper] }} /dev/urandom | base64 -w 0 > {{ hmac_key_directory}}/{{ hmac_key_file }}"
when:
- not stat_hmac_key.stat.exists
- hmac_key_state in ['present', 'regenerated']
when: (hmac_key_state == 'regenerated') or (hmac_key_state == 'present' and not stat_hmac_key.stat.exists)
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

- name: create hmac key
include_tasks: hmac.yml
when: hmac_key_state in [ 'present', 'recreate' ]
when: hmac_key_state in [ 'present', 'regenerated' ]

- name: remove hmac key
file:
Expand Down

0 comments on commit 7d7ad98

Please sign in to comment.