roles/user_mgmt: fix state for ssh_keys

This commit is contained in:
genofire 2020-09-18 11:17:02 +00:00
parent 48541be6dd
commit 1b35ee4de3

View file

@ -15,7 +15,7 @@
user: "{{ item.0.key }}"
key: "{{ item.1 }}"
state: present
when: (_user_mgmt[item.0.key].created | default(user_mgmt_default_state)) == "present"
when: (_user_mgmt[item.0.key].state | default(user_mgmt_default_state)) == "present"
loop: "{{ _user_mgmt |dict2items | subelements('value.ssh_key.present') }}"
- name: Remove ssh-key to user
@ -23,7 +23,7 @@
user: "{{ item.0.key }}"
key: "{{ item.1 }}"
state: absent
when: (_user_mgmt[item.0.key].created | default(user_mgmt_default_state)) == "present"
when: (_user_mgmt[item.0.key].state | default(user_mgmt_default_state)) == "present"
loop: "{{ _user_mgmt |dict2items | subelements('value.ssh_key.absent') }}"
- name: Remove user