mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
ipaservice: Allow execution of plugin in client host.
Update service README file and add tests for executing plugin with
`ipaapi_context` set to `client`.
A new test playbook can be found at:
tests/service/test_service_client_context.yml
The new test file can be executed in a FreeIPA client host that is
not a server. In this case, it should be defined in the `ipaclients`
group, in the inventory file.
This commit is contained in:
@@ -291,6 +291,7 @@ Variable | Description | Required
|
|||||||
-------- | ----------- | --------
|
-------- | ----------- | --------
|
||||||
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
|
`ipaadmin_principal` | The admin principal is a string and defaults to `admin` | no
|
||||||
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
`ipaadmin_password` | The admin password is a string and is required if there is no admin ticket available on the node | no
|
||||||
|
`ipaapi_context` | The context in which the module will execute. Executing in a server context is preferred. If not provided context will be determined by the execution environment. Valid values are `server` and `client`. | no
|
||||||
`name` \| `service` | The list of service name strings. | yes
|
`name` \| `service` | The list of service name strings. | yes
|
||||||
`certificate` \| `usercertificate` | Base-64 encoded service certificate. | no
|
`certificate` \| `usercertificate` | Base-64 encoded service certificate. | no
|
||||||
`pac_type` \| `ipakrbauthzdata` | Supported PAC type. It can be one of `MS-PAC`, `PAD`, or `NONE`. | no
|
`pac_type` \| `ipakrbauthzdata` | Supported PAC type. It can be one of `MS-PAC`, `PAD`, or `NONE`. | no
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
- name: Ensure services are absent.
|
- name: Ensure services are absent.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name:
|
name:
|
||||||
- "HTTP/{{ svc_fqdn }}"
|
- "HTTP/{{ svc_fqdn }}"
|
||||||
- "HTTP/{{ nohost_fqdn }}"
|
- "HTTP/{{ nohost_fqdn }}"
|
||||||
@@ -16,6 +17,7 @@
|
|||||||
- name: Ensure host "{{ svc_fqdn }}" is absent
|
- name: Ensure host "{{ svc_fqdn }}" is absent
|
||||||
ipahost:
|
ipahost:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "{{ svc_fqdn }}"
|
name: "{{ svc_fqdn }}"
|
||||||
update_dns: yes
|
update_dns: yes
|
||||||
state: absent
|
state: absent
|
||||||
@@ -23,6 +25,7 @@
|
|||||||
- name: Ensure host is absent
|
- name: Ensure host is absent
|
||||||
ipahost:
|
ipahost:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name:
|
name:
|
||||||
- "{{ host1_fqdn }}"
|
- "{{ host1_fqdn }}"
|
||||||
- "{{ host2_fqdn }}"
|
- "{{ host2_fqdn }}"
|
||||||
@@ -34,6 +37,7 @@
|
|||||||
- name: Ensure testing users are absent.
|
- name: Ensure testing users are absent.
|
||||||
ipauser:
|
ipauser:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name:
|
name:
|
||||||
- user01
|
- user01
|
||||||
- user02
|
- user02
|
||||||
@@ -42,6 +46,7 @@
|
|||||||
- name: Ensure testing groups are absent.
|
- name: Ensure testing groups are absent.
|
||||||
ipagroup:
|
ipagroup:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name:
|
name:
|
||||||
- group01
|
- group01
|
||||||
- group02
|
- group02
|
||||||
@@ -50,6 +55,7 @@
|
|||||||
- name: Ensure testing hostgroup hostgroup01 is absent.
|
- name: Ensure testing hostgroup hostgroup01 is absent.
|
||||||
ipagroup:
|
ipagroup:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name:
|
name:
|
||||||
- hostgroup01
|
- hostgroup01
|
||||||
state: absent
|
state: absent
|
||||||
@@ -57,6 +63,7 @@
|
|||||||
- name: Ensure testing hostgroup hostgroup02 is absent.
|
- name: Ensure testing hostgroup hostgroup02 is absent.
|
||||||
ipagroup:
|
ipagroup:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name:
|
name:
|
||||||
- hostgroup02
|
- hostgroup02
|
||||||
state: absent
|
state: absent
|
||||||
@@ -64,6 +71,7 @@
|
|||||||
- name: Remove IP address for "nohost" host.
|
- name: Remove IP address for "nohost" host.
|
||||||
ipadnsrecord:
|
ipadnsrecord:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
zone_name: "{{ test_domain }}."
|
zone_name: "{{ test_domain }}."
|
||||||
name: nohost
|
name: nohost
|
||||||
del_all: yes
|
del_all: yes
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
- name: Add IP address for "nohost" host.
|
- name: Add IP address for "nohost" host.
|
||||||
ipadnsrecord:
|
ipadnsrecord:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
zone_name: "{{ test_domain }}."
|
zone_name: "{{ test_domain }}."
|
||||||
name: nohost
|
name: nohost
|
||||||
a_ip_address: "{{ ipv4_prefix + '.100' }}"
|
a_ip_address: "{{ ipv4_prefix + '.100' }}"
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
- name: Add hosts for tests.
|
- name: Add hosts for tests.
|
||||||
ipahost:
|
ipahost:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
hosts:
|
hosts:
|
||||||
- name: "{{ host1_fqdn }}"
|
- name: "{{ host1_fqdn }}"
|
||||||
ip_address: "{{ ipv4_prefix + '.101' }}"
|
ip_address: "{{ ipv4_prefix + '.101' }}"
|
||||||
@@ -31,6 +33,7 @@
|
|||||||
- name: Ensure testing user user01 is present.
|
- name: Ensure testing user user01 is present.
|
||||||
ipauser:
|
ipauser:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: user01
|
name: user01
|
||||||
first: user01
|
first: user01
|
||||||
last: last
|
last: last
|
||||||
@@ -38,6 +41,7 @@
|
|||||||
- name: Ensure testing user user02 is present.
|
- name: Ensure testing user user02 is present.
|
||||||
ipauser:
|
ipauser:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: user02
|
name: user02
|
||||||
first: user02
|
first: user02
|
||||||
last: last
|
last: last
|
||||||
@@ -45,19 +49,23 @@
|
|||||||
- name: Ensure testing group group01 is present.
|
- name: Ensure testing group group01 is present.
|
||||||
ipagroup:
|
ipagroup:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: group01
|
name: group01
|
||||||
|
|
||||||
- name: Ensure testing group group02 is present.
|
- name: Ensure testing group group02 is present.
|
||||||
ipagroup:
|
ipagroup:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: group02
|
name: group02
|
||||||
|
|
||||||
- name: Ensure testing hostgroup hostgroup01 is present.
|
- name: Ensure testing hostgroup hostgroup01 is present.
|
||||||
ipahostgroup:
|
ipahostgroup:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: hostgroup01
|
name: hostgroup01
|
||||||
|
|
||||||
- name: Ensure testing hostgroup hostgroup02 is present.
|
- name: Ensure testing hostgroup hostgroup02 is present.
|
||||||
ipahostgroup:
|
ipahostgroup:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: hostgroup02
|
name: hostgroup02
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#
|
#
|
||||||
---
|
---
|
||||||
- name: Test service
|
- name: Test service
|
||||||
hosts: ipaserver
|
hosts: "{{ ipa_test_host | default('ipaserver') }}"
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
- name: Ensure service is present
|
- name: Ensure service is present
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
pac_type:
|
pac_type:
|
||||||
- MS-PAC
|
- MS-PAC
|
||||||
@@ -44,6 +45,7 @@
|
|||||||
- name: Ensure service is present, again
|
- name: Ensure service is present, again
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
pac_type:
|
pac_type:
|
||||||
- MS-PAC
|
- MS-PAC
|
||||||
@@ -60,6 +62,7 @@
|
|||||||
- name: Modify service.
|
- name: Modify service.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
pac_type: NONE
|
pac_type: NONE
|
||||||
ok_as_delegate: yes
|
ok_as_delegate: yes
|
||||||
@@ -70,6 +73,7 @@
|
|||||||
- name: Modify service, again.
|
- name: Modify service, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
pac_type: NONE
|
pac_type: NONE
|
||||||
ok_as_delegate: yes
|
ok_as_delegate: yes
|
||||||
@@ -80,6 +84,7 @@
|
|||||||
- name: Ensure service is present, without host object.
|
- name: Ensure service is present, without host object.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ nohost_fqdn }}"
|
name: "HTTP/{{ nohost_fqdn }}"
|
||||||
skip_host_check: yes
|
skip_host_check: yes
|
||||||
register: result
|
register: result
|
||||||
@@ -88,6 +93,7 @@
|
|||||||
- name: Ensure service is present, without host object, again.
|
- name: Ensure service is present, without host object, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ nohost_fqdn }}"
|
name: "HTTP/{{ nohost_fqdn }}"
|
||||||
skip_host_check: yes
|
skip_host_check: yes
|
||||||
register: result
|
register: result
|
||||||
@@ -96,6 +102,7 @@
|
|||||||
- name: Ensure service is present, with host not in DNS.
|
- name: Ensure service is present, with host not in DNS.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: HTTP/svc.ihavenodns.info
|
name: HTTP/svc.ihavenodns.info
|
||||||
skip_host_check: no
|
skip_host_check: no
|
||||||
force: yes
|
force: yes
|
||||||
@@ -105,6 +112,7 @@
|
|||||||
- name: Ensure service is present, with host not in DNS, again.
|
- name: Ensure service is present, with host not in DNS, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: HTTP/svc.ihavenodns.info
|
name: HTTP/svc.ihavenodns.info
|
||||||
skip_host_check: no
|
skip_host_check: no
|
||||||
force: yes
|
force: yes
|
||||||
@@ -114,6 +122,7 @@
|
|||||||
- name: Ensure service is present, whithout host object and with host not in DNS.
|
- name: Ensure service is present, whithout host object and with host not in DNS.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: HTTP/no.idontexist.info
|
name: HTTP/no.idontexist.info
|
||||||
skip_host_check: yes
|
skip_host_check: yes
|
||||||
force: yes
|
force: yes
|
||||||
@@ -123,6 +132,7 @@
|
|||||||
- name: Ensure service is present, whithout host object and with host not in DNS, again.
|
- name: Ensure service is present, whithout host object and with host not in DNS, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: HTTP/no.idontexist.info
|
name: HTTP/no.idontexist.info
|
||||||
skip_host_check: yes
|
skip_host_check: yes
|
||||||
force: yes
|
force: yes
|
||||||
@@ -132,6 +142,7 @@
|
|||||||
- name: Principal host/test.example.com present in service.
|
- name: Principal host/test.example.com present in service.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
principal:
|
principal:
|
||||||
- host/test.example.com
|
- host/test.example.com
|
||||||
@@ -142,6 +153,7 @@
|
|||||||
- name: Principal host/test.example.com present in service, again.
|
- name: Principal host/test.example.com present in service, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
principal:
|
principal:
|
||||||
- host/test.example.com
|
- host/test.example.com
|
||||||
@@ -153,6 +165,7 @@
|
|||||||
- name: Principal host/test.example.com absent in service.
|
- name: Principal host/test.example.com absent in service.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
principal:
|
principal:
|
||||||
- host/test.example.com
|
- host/test.example.com
|
||||||
@@ -164,6 +177,7 @@
|
|||||||
- name: Principal host/test.example.com absent in service, again.
|
- name: Principal host/test.example.com absent in service, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
principal:
|
principal:
|
||||||
- host/test.example.com
|
- host/test.example.com
|
||||||
@@ -176,6 +190,7 @@
|
|||||||
- name: Ensure host can manage service.
|
- name: Ensure host can manage service.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
host:
|
host:
|
||||||
- "{{ host1_fqdn }}"
|
- "{{ host1_fqdn }}"
|
||||||
@@ -187,6 +202,7 @@
|
|||||||
- name: Ensure host can manage service, again.
|
- name: Ensure host can manage service, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
host: "{{ host1_fqdn }}"
|
host: "{{ host1_fqdn }}"
|
||||||
action: member
|
action: member
|
||||||
@@ -196,6 +212,7 @@
|
|||||||
- name: Ensure host cannot manage service.
|
- name: Ensure host cannot manage service.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
host:
|
host:
|
||||||
- "{{ host1_fqdn }}"
|
- "{{ host1_fqdn }}"
|
||||||
@@ -208,6 +225,7 @@
|
|||||||
- name: Ensure host cannot manage service, again.
|
- name: Ensure host cannot manage service, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
host:
|
host:
|
||||||
- "{{ host1_fqdn }}"
|
- "{{ host1_fqdn }}"
|
||||||
@@ -220,6 +238,7 @@
|
|||||||
- name: Service "HTTP/{{ svc_fqdn }}" members allow_create_keytab present for users, groups, hosts and hostgroups.
|
- name: Service "HTTP/{{ svc_fqdn }}" members allow_create_keytab present for users, groups, hosts and hostgroups.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
allow_create_keytab_user:
|
allow_create_keytab_user:
|
||||||
- user01
|
- user01
|
||||||
@@ -240,6 +259,7 @@
|
|||||||
- name: Service "HTTP/{{ svc_fqdn }}" members allow_create_keytab present for users, groups, hosts and hostgroups, again.
|
- name: Service "HTTP/{{ svc_fqdn }}" members allow_create_keytab present for users, groups, hosts and hostgroups, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
allow_create_keytab_user:
|
allow_create_keytab_user:
|
||||||
- user01
|
- user01
|
||||||
@@ -260,6 +280,7 @@
|
|||||||
- name: Service "HTTP/{{ svc_fqdn }}" members allow_create_keytab absent for users, groups, hosts and hostgroups.
|
- name: Service "HTTP/{{ svc_fqdn }}" members allow_create_keytab absent for users, groups, hosts and hostgroups.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
allow_create_keytab_user:
|
allow_create_keytab_user:
|
||||||
- user01
|
- user01
|
||||||
@@ -281,6 +302,7 @@
|
|||||||
- name: Service "HTTP/{{ svc_fqdn }}" members allow_create_keytab absent for users, groups, hosts and hostgroups, again.
|
- name: Service "HTTP/{{ svc_fqdn }}" members allow_create_keytab absent for users, groups, hosts and hostgroups, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
allow_create_keytab_user:
|
allow_create_keytab_user:
|
||||||
- user01
|
- user01
|
||||||
@@ -302,6 +324,7 @@
|
|||||||
- name: Service "HTTP/{{ svc_fqdn }}" members allow_retrieve_keytab present for users, groups, hosts and hostgroups
|
- name: Service "HTTP/{{ svc_fqdn }}" members allow_retrieve_keytab present for users, groups, hosts and hostgroups
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
allow_retrieve_keytab_user:
|
allow_retrieve_keytab_user:
|
||||||
- user01
|
- user01
|
||||||
@@ -322,6 +345,7 @@
|
|||||||
- name: Service "HTTP/{{ svc_fqdn }}" members allow_retrieve_keytab present for users, groups, hosts and hostgroups, again.
|
- name: Service "HTTP/{{ svc_fqdn }}" members allow_retrieve_keytab present for users, groups, hosts and hostgroups, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
allow_retrieve_keytab_user:
|
allow_retrieve_keytab_user:
|
||||||
- user01
|
- user01
|
||||||
@@ -342,6 +366,7 @@
|
|||||||
- name: Service "HTTP/{{ svc_fqdn }}" members allow_retrieve_keytab absent for users, groups, hosts and hostgroups.
|
- name: Service "HTTP/{{ svc_fqdn }}" members allow_retrieve_keytab absent for users, groups, hosts and hostgroups.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
allow_retrieve_keytab_user:
|
allow_retrieve_keytab_user:
|
||||||
- user01
|
- user01
|
||||||
@@ -363,6 +388,7 @@
|
|||||||
- name: Service "HTTP/{{ svc_fqdn }}" members allow_retrieve_keytab absent for users, groups, hosts and hostgroups, again.
|
- name: Service "HTTP/{{ svc_fqdn }}" members allow_retrieve_keytab absent for users, groups, hosts and hostgroups, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
allow_retrieve_keytab_user:
|
allow_retrieve_keytab_user:
|
||||||
- user01
|
- user01
|
||||||
@@ -384,6 +410,7 @@
|
|||||||
- name: Ensure service is absent
|
- name: Ensure service is absent
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
continue: yes
|
continue: yes
|
||||||
state: absent
|
state: absent
|
||||||
@@ -393,6 +420,7 @@
|
|||||||
- name: Ensure service is absent, again
|
- name: Ensure service is absent, again
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
continue: yes
|
continue: yes
|
||||||
state: absent
|
state: absent
|
||||||
@@ -402,6 +430,7 @@
|
|||||||
- name: Ensure service is present, with multiple auth_ind values.
|
- name: Ensure service is present, with multiple auth_ind values.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
auth_ind: otp,radius
|
auth_ind: otp,radius
|
||||||
skip_host_check: no
|
skip_host_check: no
|
||||||
@@ -412,6 +441,7 @@
|
|||||||
- name: Ensure service is present, with multiple auth_ind values, again.
|
- name: Ensure service is present, with multiple auth_ind values, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
auth_ind: otp,radius
|
auth_ind: otp,radius
|
||||||
skip_host_check: no
|
skip_host_check: no
|
||||||
@@ -422,6 +452,7 @@
|
|||||||
- name: Clear auth_ind.
|
- name: Clear auth_ind.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
auth_ind: ""
|
auth_ind: ""
|
||||||
skip_host_check: no
|
skip_host_check: no
|
||||||
@@ -432,6 +463,7 @@
|
|||||||
- name: Clear auth_ind, again.
|
- name: Clear auth_ind, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "HTTP/{{ svc_fqdn }}"
|
name: "HTTP/{{ svc_fqdn }}"
|
||||||
auth_ind: ""
|
auth_ind: ""
|
||||||
skip_host_check: no
|
skip_host_check: no
|
||||||
@@ -442,6 +474,7 @@
|
|||||||
- name: Ensure services are absent.
|
- name: Ensure services are absent.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name:
|
name:
|
||||||
- "HTTP/{{ svc_fqdn }}"
|
- "HTTP/{{ svc_fqdn }}"
|
||||||
- "HTTP/{{ nohost_fqdn }}"
|
- "HTTP/{{ nohost_fqdn }}"
|
||||||
@@ -455,6 +488,7 @@
|
|||||||
- name: Ensure services are absent.
|
- name: Ensure services are absent.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name:
|
name:
|
||||||
- "HTTP/{{ svc_fqdn }}"
|
- "HTTP/{{ svc_fqdn }}"
|
||||||
- "HTTP/{{ nohost_fqdn }}"
|
- "HTTP/{{ nohost_fqdn }}"
|
||||||
@@ -468,6 +502,7 @@
|
|||||||
- name: Ensure SMB service is present.
|
- name: Ensure SMB service is present.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "{{ host1_fqdn }}"
|
name: "{{ host1_fqdn }}"
|
||||||
pac_type: NONE
|
pac_type: NONE
|
||||||
smb: yes
|
smb: yes
|
||||||
@@ -478,6 +513,7 @@
|
|||||||
- name: Ensure SMB service is again.
|
- name: Ensure SMB service is again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "{{ host1_fqdn }}"
|
name: "{{ host1_fqdn }}"
|
||||||
pac_type: NONE
|
pac_type: NONE
|
||||||
smb: yes
|
smb: yes
|
||||||
@@ -488,6 +524,7 @@
|
|||||||
- name: Modify SMB service.
|
- name: Modify SMB service.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "{{ host1_fqdn }}"
|
name: "{{ host1_fqdn }}"
|
||||||
smb: yes
|
smb: yes
|
||||||
netbiosname: SAMBASVC
|
netbiosname: SAMBASVC
|
||||||
@@ -503,6 +540,7 @@
|
|||||||
- name: Modify SMB service, again.
|
- name: Modify SMB service, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "{{ host1_fqdn }}"
|
name: "{{ host1_fqdn }}"
|
||||||
smb: yes
|
smb: yes
|
||||||
netbiosname: SAMBASVC
|
netbiosname: SAMBASVC
|
||||||
@@ -518,6 +556,7 @@
|
|||||||
- name: Ensure SMB service is absent.
|
- name: Ensure SMB service is absent.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "cifs/{{ host1_fqdn }}"
|
name: "cifs/{{ host1_fqdn }}"
|
||||||
continue: yes
|
continue: yes
|
||||||
state: absent
|
state: absent
|
||||||
@@ -527,6 +566,7 @@
|
|||||||
- name: Ensure SMB service is absent, again.
|
- name: Ensure SMB service is absent, again.
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
name: "cifs/{{ host1_fqdn }}"
|
name: "cifs/{{ host1_fqdn }}"
|
||||||
continue: yes
|
continue: yes
|
||||||
state: absent
|
state: absent
|
||||||
|
|||||||
37
tests/service/test_service_client_context.yml
Normal file
37
tests/service/test_service_client_context.yml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
- name: Test service
|
||||||
|
hosts: ipaclients, ipaserver
|
||||||
|
become: no
|
||||||
|
gather_facts: no
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Include FreeIPA facts.
|
||||||
|
include_tasks: ../env_freeipa_facts.yml
|
||||||
|
|
||||||
|
# Test will only be executed if host is not a server.
|
||||||
|
- name: Execute with server context in the client.
|
||||||
|
ipaservice:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: server
|
||||||
|
name: ThisShouldNotWork
|
||||||
|
register: result
|
||||||
|
failed_when: not (result.failed and result.msg is regex("No module named '*ipaserver'*"))
|
||||||
|
when: ipa_host_is_client
|
||||||
|
|
||||||
|
# Import basic module tests, and execute with ipa_context set to 'client'.
|
||||||
|
# If ipaclients is set, it will be executed using the client, if not,
|
||||||
|
# ipaserver will be used.
|
||||||
|
#
|
||||||
|
# With this setup, tests can be executed against an IPA client, against
|
||||||
|
# an IPA server using "client" context, and ensure that tests are executed
|
||||||
|
# in upstream CI.
|
||||||
|
|
||||||
|
- name: Test service using client context, in client host.
|
||||||
|
import_playbook: test_service.yml
|
||||||
|
when: groups['ipaclients']
|
||||||
|
vars:
|
||||||
|
ipa_test_host: ipaclients
|
||||||
|
|
||||||
|
- name: Test service using client context, in server host.
|
||||||
|
import_playbook: test_service.yml
|
||||||
|
when: groups['ipaclients'] is not defined or not groups['ipaclients']
|
||||||
Reference in New Issue
Block a user