mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
tests service: Fixes evaluation of 'Keytab = True'
In ansible-core 2.19 there's no automatic coercion from None or empty strings to the boolean value "false", so we need to compare the result of the filter 'regex_search' to 'None' and the empty string to evaluate if any match occurred. In fixing this issue, it was found that the tests were incorrectly evaluating the results, and the comparisons were fixed. Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
This commit is contained in:
@@ -48,7 +48,8 @@
|
||||
- name: Verify keytab
|
||||
ansible.builtin.shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}"
|
||||
register: result
|
||||
failed_when: result.failed or result.stdout | regex_search(" Keytab. true")
|
||||
changed_when: false
|
||||
failed_when: result.failed or (result.stdout | regex_search(" Keytab. [Tt]rue")) in [None, ""]
|
||||
|
||||
- name: Ensure service is disabled
|
||||
ipaservice:
|
||||
@@ -61,7 +62,8 @@
|
||||
- name: Verify keytab
|
||||
ansible.builtin.shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}"
|
||||
register: result
|
||||
failed_when: result.failed or result.stdout | regex_search(" Keytab. true")
|
||||
changed_when: false
|
||||
failed_when: result.failed or (result.stdout | regex_search(" Keytab. [Ff]alse")) in [None, ""]
|
||||
|
||||
- name: Obtain keytab
|
||||
ansible.builtin.shell: ipa-getkeytab -s "{{ ansible_facts['fqdn'] }}" -p "mysvc1/{{ ansible_facts['fqdn'] }}" -k mysvc1.keytab
|
||||
@@ -69,7 +71,8 @@
|
||||
- name: Verify keytab
|
||||
ansible.builtin.shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}"
|
||||
register: result
|
||||
failed_when: result.failed or result.stdout | regex_search(" Keytab. true")
|
||||
changed_when: false
|
||||
failed_when: result.failed or (result.stdout | regex_search(" Keytab. [Tt]rue")) in [None, ""]
|
||||
|
||||
- name: Ensure service is disabled
|
||||
ipaservice:
|
||||
@@ -82,7 +85,8 @@
|
||||
- name: Verify keytab
|
||||
ansible.builtin.shell: ipa service-find "mysvc1/{{ ansible_facts['fqdn'] }}"
|
||||
register: result
|
||||
failed_when: result.failed or result.stdout | regex_search(" Keytab. true")
|
||||
changed_when: false
|
||||
failed_when: result.failed or (result.stdout | regex_search(" Keytab. [Ff]alse")) in [None, ""]
|
||||
|
||||
- name: Ensure service is disabled, with no keytab.
|
||||
ipaservice:
|
||||
|
||||
Reference in New Issue
Block a user