mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-08 22:34:26 +00:00
ipaclient_get_otp: Remove ansible_python_interpreter handling
With the deactivation of the Python2/3 test the handling of ansible_python_interpreter needs to be removed as the setting might not exist and is not changed in with the Python2/3 test any more.
This commit is contained in:
@@ -155,8 +155,6 @@ class ActionModule(ActionBase):
|
|||||||
keytab = self._task.args.get('keytab', None)
|
keytab = self._task.args.get('keytab', None)
|
||||||
password = self._task.args.get('password', None)
|
password = self._task.args.get('password', None)
|
||||||
lifetime = self._task.args.get('lifetime', '1h')
|
lifetime = self._task.args.get('lifetime', '1h')
|
||||||
ansible_python_interpreter = self._task.args.get('ansible_python_interpreter', None)
|
|
||||||
task_vars["ansible_python_interpreter"] = ansible_python_interpreter
|
|
||||||
|
|
||||||
if (not keytab and not password):
|
if (not keytab and not password):
|
||||||
result['failed'] = True
|
result['failed'] = True
|
||||||
@@ -169,7 +167,7 @@ class ActionModule(ActionBase):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
data = self._execute_module(module_name='ipaclient_get_facts', module_args=dict(),
|
data = self._execute_module(module_name='ipaclient_get_facts', module_args=dict(),
|
||||||
task_vars={ "ansible_python_interpreter": ansible_python_interpreter })
|
task_vars=None)
|
||||||
try:
|
try:
|
||||||
domain = data['ansible_facts']['ipa']['domain']
|
domain = data['ansible_facts']['ipa']['domain']
|
||||||
realm = data['ansible_facts']['ipa']['realm']
|
realm = data['ansible_facts']['ipa']['realm']
|
||||||
|
|||||||
@@ -71,9 +71,6 @@ options:
|
|||||||
ipaddress:
|
ipaddress:
|
||||||
description: the IP address for the host
|
description: the IP address for the host
|
||||||
required: false
|
required: false
|
||||||
ansible_python_interpreter:
|
|
||||||
desciption: The ansible python interpreter used in the action plugin part, ignored here
|
|
||||||
required: false
|
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
- gssapi on the Ansible controller
|
- gssapi on the Ansible controller
|
||||||
@@ -318,7 +315,6 @@ def main():
|
|||||||
ipaddress = dict(required=False),
|
ipaddress = dict(required=False),
|
||||||
random = dict(default=False, type='bool'),
|
random = dict(default=False, type='bool'),
|
||||||
state = dict(default='present', choices=[ 'present', 'absent' ]),
|
state = dict(default='present', choices=[ 'present', 'absent' ]),
|
||||||
ansible_python_interpreter = dict(required=False),
|
|
||||||
),
|
),
|
||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -107,10 +107,6 @@
|
|||||||
fail: msg="Keytab or password is required for otp"
|
fail: msg="Keytab or password is required for otp"
|
||||||
when: ipaadmin_keytab is undefined and ipaadmin_password is undefined
|
when: ipaadmin_keytab is undefined and ipaadmin_password is undefined
|
||||||
|
|
||||||
- name: Install - Save client ansible_python_interpreter setting
|
|
||||||
set_fact:
|
|
||||||
ipaclient_ansible_python_interpreter: "{{ ansible_python_interpreter }}"
|
|
||||||
|
|
||||||
#- name: Install - Include Python2/3 import test
|
#- name: Install - Include Python2/3 import test
|
||||||
# import_tasks: "{{ role_path }}/tasks/python_2_3_test.yml"
|
# import_tasks: "{{ role_path }}/tasks/python_2_3_test.yml"
|
||||||
# delegate_to: "{{ result_ipaclient_test.servers[0] }}"
|
# delegate_to: "{{ result_ipaclient_test.servers[0] }}"
|
||||||
@@ -125,7 +121,6 @@
|
|||||||
fqdn: "{{ result_ipaclient_test.hostname }}"
|
fqdn: "{{ result_ipaclient_test.hostname }}"
|
||||||
lifetime: "{{ ipaclient_lifetime | default(omit) }}"
|
lifetime: "{{ ipaclient_lifetime | default(omit) }}"
|
||||||
random: True
|
random: True
|
||||||
ansible_python_interpreter: "{{ ansible_python_interpreter }}"
|
|
||||||
register: result_ipaclient_get_otp
|
register: result_ipaclient_get_otp
|
||||||
# If the host is already enrolled, this command will exit on error
|
# If the host is already enrolled, this command will exit on error
|
||||||
# The error can be ignored
|
# The error can be ignored
|
||||||
@@ -142,10 +137,6 @@
|
|||||||
ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword
|
ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword
|
||||||
if result_ipaclient_get_otp.host is defined }}"
|
if result_ipaclient_get_otp.host is defined }}"
|
||||||
|
|
||||||
- name: Install - Restore client ansible_python_interpreter setting
|
|
||||||
set_fact:
|
|
||||||
ansible_python_interpreter: "{{ ipaclient_ansible_python_interpreter }}"
|
|
||||||
|
|
||||||
when: ipaclient_use_otp | bool
|
when: ipaclient_use_otp | bool
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
|||||||
Reference in New Issue
Block a user