Skip to content
Snippets Groups Projects
Commit 39d5558b authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

Add IPA version verification for ipaconfig's maxhostname tests.

The config attributte maxhostname is only available after IPA
version 4.8.0. The tests for this attribute are now protected to
not run if a previous IPA version is found.
parent c2f68a34
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,8 @@ ...@@ -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 @@ ...@@ -45,15 +47,17 @@
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
pac_type: "" pac_type: ""
- name: set maxusername to 255 - name: set maxhostname to 255
ipaconfig: block:
- ipaconfig:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
maxusername: 255 maxhostname: 255
when: ipa_version is version('4.8.0', '>=')
- name: set maxhostname to 255 - name: set maxusername to 45
ipaconfig: ipaconfig:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
maxhostname: 255 maxusername: 45
- name: set pwdexpnotify to 0 - name: set pwdexpnotify to 0
ipaconfig: ipaconfig:
...@@ -186,18 +190,19 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment