mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-08-05 22:34:40 +00:00
Merge pull request #364 from rjeffman/fix_tests_after_build_matrix
Fix tests that require specific IPA versions.
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
- include_tasks: ../env_freeipa_facts.yml
|
||||||
|
|
||||||
# Retrieve current configuration.
|
# Retrieve current configuration.
|
||||||
- name: return current values of the global configuration options
|
- name: return current values of the global configuration options
|
||||||
ipaconfig:
|
ipaconfig:
|
||||||
@@ -45,15 +47,17 @@
|
|||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
pac_type: ""
|
pac_type: ""
|
||||||
|
|
||||||
- name: set maxusername to 255
|
|
||||||
ipaconfig:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
maxusername: 255
|
|
||||||
|
|
||||||
- name: set maxhostname to 255
|
- name: set maxhostname to 255
|
||||||
ipaconfig:
|
block:
|
||||||
|
- ipaconfig:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
maxhostname: 255
|
maxhostname: 255
|
||||||
|
when: ipa_version is version('4.8.0', '>=')
|
||||||
|
|
||||||
|
- name: set maxusername to 45
|
||||||
|
ipaconfig:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
maxusername: 45
|
||||||
|
|
||||||
- name: set pwdexpnotify to 0
|
- name: set pwdexpnotify to 0
|
||||||
ipaconfig:
|
ipaconfig:
|
||||||
@@ -186,18 +190,19 @@
|
|||||||
failed_when: result.changed
|
failed_when: result.changed
|
||||||
|
|
||||||
- name: set maxhostname to 77
|
- name: set maxhostname to 77
|
||||||
ipaconfig:
|
block:
|
||||||
|
- ipaconfig:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
maxhostname: 77
|
maxhostname: 77
|
||||||
register: result
|
register: result
|
||||||
failed_when: not result.changed
|
failed_when: not result.changed
|
||||||
|
|
||||||
- name: set maxhostname to 77, again
|
- ipaconfig:
|
||||||
ipaconfig:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
maxhostname: 77
|
maxhostname: 77
|
||||||
register: result
|
register: result
|
||||||
failed_when: result.changed
|
failed_when: result.changed
|
||||||
|
when: ipa_version is version('4.8.0', '>=')
|
||||||
|
|
||||||
- name: set pwdexpnotify to 17
|
- name: set pwdexpnotify to 17
|
||||||
ipaconfig:
|
ipaconfig:
|
||||||
@@ -329,7 +334,6 @@
|
|||||||
ipaconfig:
|
ipaconfig:
|
||||||
ipaadmin_password: 'SomeADMINpassword'
|
ipaadmin_password: 'SomeADMINpassword'
|
||||||
maxusername: '{{previousconfig.config.maxusername | default(omit)}}'
|
maxusername: '{{previousconfig.config.maxusername | default(omit)}}'
|
||||||
maxhostname: '{{previousconfig.config.maxhostname | default(omit)}}'
|
|
||||||
homedirectory: '{{previousconfig.config.homedirectory | default(omit)}}'
|
homedirectory: '{{previousconfig.config.homedirectory | default(omit)}}'
|
||||||
defaultshell: '{{previousconfig.config.defaultshell | default(omit)}}'
|
defaultshell: '{{previousconfig.config.defaultshell | default(omit)}}'
|
||||||
defaultgroup: '{{previousconfig.config.defaultgroup | default(omit)}}'
|
defaultgroup: '{{previousconfig.config.defaultgroup | default(omit)}}'
|
||||||
@@ -352,11 +356,17 @@
|
|||||||
register: result
|
register: result
|
||||||
failed_when: not result.changed
|
failed_when: not result.changed
|
||||||
|
|
||||||
|
- name: reset maxhostname
|
||||||
|
block:
|
||||||
|
- ipaconfig:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
maxhostname: '{{previousconfig.config.maxhostname | default(omit)}}'
|
||||||
|
when: ipa_version is version('4.8.0', '>=')
|
||||||
|
|
||||||
- name: reset changed fields, again
|
- name: reset changed fields, again
|
||||||
ipaconfig:
|
ipaconfig:
|
||||||
ipaadmin_password: 'SomeADMINpassword'
|
ipaadmin_password: 'SomeADMINpassword'
|
||||||
maxusername: '{{previousconfig.config.maxusername | default(omit)}}'
|
maxusername: '{{previousconfig.config.maxusername | default(omit)}}'
|
||||||
maxhostname: '{{previousconfig.config.maxhostname | default(omit)}}'
|
|
||||||
homedirectory: '{{previousconfig.config.homedirectory | default(omit)}}'
|
homedirectory: '{{previousconfig.config.homedirectory | default(omit)}}'
|
||||||
defaultshell: '{{previousconfig.config.defaultshell | default(omit)}}'
|
defaultshell: '{{previousconfig.config.defaultshell | default(omit)}}'
|
||||||
defaultgroup: '{{previousconfig.config.defaultgroup | default(omit)}}'
|
defaultgroup: '{{previousconfig.config.defaultgroup | default(omit)}}'
|
||||||
@@ -379,6 +389,13 @@
|
|||||||
register: result
|
register: result
|
||||||
failed_when: result.changed
|
failed_when: result.changed
|
||||||
|
|
||||||
|
- name: reset maxhostname
|
||||||
|
block:
|
||||||
|
- ipaconfig:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
maxhostname: '{{previousconfig.config.maxhostname | default(omit)}}'
|
||||||
|
when: ipa_version is version('4.8.0', '>=')
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
|
|
||||||
- name: cleanup test group
|
- name: cleanup test group
|
||||||
|
|||||||
@@ -5,6 +5,10 @@
|
|||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
- include_tasks: ../env_freeipa_facts.yml
|
||||||
|
|
||||||
|
- name: Tests requiring IPA version 4.8.4+
|
||||||
|
block:
|
||||||
- name: Ensure user manangeruser1 and manageruser2 is absent
|
- name: Ensure user manangeruser1 and manageruser2 is absent
|
||||||
ipauser:
|
ipauser:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
@@ -201,3 +205,5 @@
|
|||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
failed_when: not result.changed
|
failed_when: not result.changed
|
||||||
|
|
||||||
|
when: ipa_version is version('4.8.4', '>=')
|
||||||
|
|||||||
@@ -17,10 +17,14 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
# setup
|
# setup
|
||||||
|
- include_tasks: ../env_freeipa_facts.yml
|
||||||
|
|
||||||
|
# tests
|
||||||
|
- name: Tests with skip_host_check, require IPA version 4.8.0+.
|
||||||
|
block:
|
||||||
- name: Setup test environment
|
- name: Setup test environment
|
||||||
include_tasks: env_setup.yml
|
include_tasks: env_setup.yml
|
||||||
|
|
||||||
# tests
|
|
||||||
- name: Ensure service is present
|
- name: Ensure service is present
|
||||||
ipaservice:
|
ipaservice:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
@@ -494,3 +498,4 @@
|
|||||||
# cleanup
|
# cleanup
|
||||||
- name: Cleanup test environment
|
- name: Cleanup test environment
|
||||||
include_tasks: env_cleanup.yml
|
include_tasks: env_cleanup.yml
|
||||||
|
when: ipa_version is version('4.7.0', '>=')
|
||||||
|
|||||||
@@ -4,96 +4,11 @@
|
|||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- include_tasks: ../env_freeipa_facts.yml
|
|
||||||
|
|
||||||
- name: Tests requiring IPA version 4.7.0+
|
|
||||||
block:
|
|
||||||
# setup
|
# setup
|
||||||
- name: Get Domain from server name
|
|
||||||
set_fact:
|
|
||||||
ipaserver_domain: "{{ ansible_fqdn.split('.')[1:] | join ('.') }}"
|
|
||||||
when: ipaserver_domain is not defined
|
|
||||||
|
|
||||||
- name: Set host1, host2 and svc hosts fqdn
|
- name: Setup test environment
|
||||||
set_fact:
|
include_tasks: env_setup.yml
|
||||||
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
|
|
||||||
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
|
|
||||||
svc_fqdn: "{{ 'svc.' + ipaserver_domain }}"
|
|
||||||
|
|
||||||
- name: Host absent
|
|
||||||
ipahost:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name:
|
|
||||||
- svc.ihavenodns.info
|
|
||||||
- "{{ host1_fqdn }}"
|
|
||||||
- "{{ host2_fqdn }}"
|
|
||||||
- "{{ svc_fqdn }}"
|
|
||||||
update_dns: yes
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Get IPv4 address prefix from server node
|
|
||||||
set_fact:
|
|
||||||
ipv4_prefix: "{{ ansible_default_ipv4.address.split('.')[:-1] |
|
|
||||||
join('.') }}"
|
|
||||||
|
|
||||||
- name: Add hosts for tests.
|
|
||||||
ipahost:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
hosts:
|
|
||||||
- name: "{{ host1_fqdn }}"
|
|
||||||
ip_address: "{{ ipv4_prefix + '.201' }}"
|
|
||||||
update_dns: yes
|
|
||||||
- name: "{{ host2_fqdn }}"
|
|
||||||
ip_address: "{{ ipv4_prefix + '.202' }}"
|
|
||||||
update_dns: yes
|
|
||||||
- name: "{{ svc_fqdn }}"
|
|
||||||
ip_address: "{{ ipv4_prefix + '.203' }}"
|
|
||||||
update_dns: yes
|
|
||||||
- name: svc.ihavenodns.info
|
|
||||||
update_dns: no
|
|
||||||
force: yes
|
|
||||||
|
|
||||||
- name: Ensure testing user user01 is present.
|
|
||||||
ipauser:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name: user01
|
|
||||||
first: user01
|
|
||||||
last: last
|
|
||||||
|
|
||||||
- name: Ensure testing user user02 is present.
|
|
||||||
ipauser:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name: user02
|
|
||||||
first: user02
|
|
||||||
last: last
|
|
||||||
|
|
||||||
- name: Ensure testing group group01 is present.
|
|
||||||
ipagroup:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name: group01
|
|
||||||
|
|
||||||
- name: Ensure testing group group02 is present.
|
|
||||||
ipagroup:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name: group02
|
|
||||||
|
|
||||||
- name: Ensure testing hostgroup hostgroup01 is present.
|
|
||||||
ipahostgroup:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name: hostgroup01
|
|
||||||
|
|
||||||
- name: Ensure testing hostgroup hostgroup02 is present.
|
|
||||||
ipahostgroup:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name: hostgroup02
|
|
||||||
|
|
||||||
- name: Ensure services are absent.
|
|
||||||
ipaservice:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name:
|
|
||||||
- "HTTP/{{ svc_fqdn }}"
|
|
||||||
- HTTP/svc.ihavenodns.info
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
- name: Ensure service is present
|
- name: Ensure service is present
|
||||||
@@ -430,52 +345,5 @@
|
|||||||
failed_when: result.changed
|
failed_when: result.changed
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
|
- name: Cleanup test environment
|
||||||
- name: Ensure services are absent.
|
include_tasks: env_cleanup.yml
|
||||||
ipaservice:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name:
|
|
||||||
- "HTTP/{{ svc_fqdn }}"
|
|
||||||
- HTTP/svc.ihavenodns.info
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Ensure host is absent
|
|
||||||
ipahost:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name:
|
|
||||||
- "{{ svc_fqdn }}"
|
|
||||||
- "{{ host1_fqdn }}"
|
|
||||||
- "{{ host2_fqdn }}"
|
|
||||||
- svc.ihavenodns.info
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Ensure testing users are absent.
|
|
||||||
ipauser:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name:
|
|
||||||
- user01
|
|
||||||
- user02
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Ensure testing groups are absent.
|
|
||||||
ipagroup:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name:
|
|
||||||
- group01
|
|
||||||
- group02
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Ensure testing hostgroup hostgroup01 is absent.
|
|
||||||
ipagroup:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name:
|
|
||||||
- hostgroup01
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Ensure testing hostgroup hostgroup02 is absent.
|
|
||||||
ipagroup:
|
|
||||||
ipaadmin_password: SomeADMINpassword
|
|
||||||
name:
|
|
||||||
- hostgroup02
|
|
||||||
state: absent
|
|
||||||
when: ipa_version is version('4.7.0', '>=')
|
|
||||||
|
|||||||
Reference in New Issue
Block a user