mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-14 13:32:10 +00:00
For failed_when result.failed should be used to make sure that the task fails if there was an error.
59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
---
|
|
- name: Test hbacsvc
|
|
hosts: ipaserver
|
|
become: true
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
- name: Ensure HBAC Service for http is absent
|
|
ipahbacsvc:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: http,tftp
|
|
state: absent
|
|
|
|
- name: Ensure HBAC Service for http is present
|
|
ipahbacsvc:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: http
|
|
register: result
|
|
failed_when: not result.changed or result.failed
|
|
|
|
- name: Ensure HBAC Service for http is present again
|
|
ipahbacsvc:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: http
|
|
register: result
|
|
failed_when: result.changed or result.failed
|
|
|
|
- name: Ensure HBAC Service for tftp is present
|
|
ipahbacsvc:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: tftp
|
|
description: TFTP service
|
|
register: result
|
|
failed_when: not result.changed or result.failed
|
|
|
|
- name: Ensure HBAC Service for tftp is present again
|
|
ipahbacsvc:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: tftp
|
|
description: TFTP service
|
|
register: result
|
|
failed_when: result.changed or result.failed
|
|
|
|
- name: Ensure HBAC Services for http and tftp are absent
|
|
ipahbacsvc:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: http,tftp
|
|
state: absent
|
|
register: result
|
|
failed_when: not result.changed or result.failed
|
|
|
|
- name: Ensure HBAC Services for http and tftp are absent again
|
|
ipahbacsvc:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: http,tftp
|
|
state: absent
|
|
register: result
|
|
failed_when: result.changed or result.failed
|