diff --git a/plugins/modules/templates_import.py b/plugins/modules/templates_import.py index 3d1141e1dc..7c99f4e9bc 100644 --- a/plugins/modules/templates_import.py +++ b/plugins/modules/templates_import.py @@ -90,6 +90,23 @@ - The directory within Git repo containing the templates. required: false type: str + http_proxy_policy: + description: + - HTTP proxy policy for template sync. + - You can choose no HTTP proxy, global HTTP proxy, or a custom HTTP proxy ('selected') + - If you choose 'selected', provide the http_proxy_id parameter. + required: false + type: str + choices: + - none + - global + - selected + http_proxy: + description: + - HTTP proxy to use for template sync. + - Use this parameter together with C(http_proxy_policy=selected) + required: false + type: str attributes: check_mode: support: none @@ -156,9 +173,12 @@ def main(): force=dict(type='bool'), lock=dict(type='bool'), negate=dict(type='bool'), + http_proxy_policy=dict(choices=['global', 'none', 'selected']), + http_proxy=dict(type='entity'), ), supports_check_mode=False, required_plugins=[('templates', ['*'])], + required_if=[('http_proxy_policy', 'selected', ['http_proxy'])], ) with module.api_connection(): diff --git a/tests/test_playbooks/tasks/templates_import.yml b/tests/test_playbooks/tasks/templates_import.yml index a930356b62..83678e82d8 100644 --- a/tests/test_playbooks/tasks/templates_import.yml +++ b/tests/test_playbooks/tasks/templates_import.yml @@ -15,6 +15,8 @@ force: "{{ templates_import_force | default(omit) }}" lock: "{{ templates_import_lock | default(omit) }}" negate: "{{ templates_import_negate | default(omit) }}" + http_proxy_policy: "{{ templates_import_http_proxy_policy | default(omit) }}" + http_proxy: "{{ templates_import_http_proxy | default(omit) }}" locations: "{{ templates_import_locations | default(omit) }}" organizations: "{{ templates_import_organizations | default(omit) }}" register: result