Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update authentication arguments #347

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions plugins/doc_fragments/eda_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,43 @@ class ModuleDocFragment:
controller_host:
description:
- The URL of the EDA controller.
- If not set, the value of the C(CONTROLLER_HOST) environment variable will be used.
- If not set, the value of C(CONTROLLER_HOST), or E(AAP_HOSTNAME) environment variables will be used.
required: true
type: str
version_added: '2.0.0'
aliases: [ aap_hostname ]
controller_username:
description:
- Username used for authentication.
- If not set, the value of the C(CONTROLLER_USERNAME) environment variable will be used.
- If not set, the value of C(CONTROLLER_USERNAME), or E(AAP_USERNAME) environment variables will be used.
type: str
version_added: '2.0.0'
aliases: [ aap_username ]
controller_password:
description:
- Password used for authentication.
- If not set, the value of the C(CONTROLLER_PASSWORD) environment variable will be used.
- If not set, the value of C(CONTROLLER_PASSWORD), or E(AAP_PASSWORD) environment variables will be used.
type: str
version_added: '2.0.0'
aliases: [ aap_password ]
request_timeout:
description:
- Timeout in seconds for the connection with the EDA controller.
- If not set, the value of the C(CONTROLLER_TIMEOUT) environment variable will be used.
- If not set, the value of C(CONTROLLER_TIMEOUT), E(AAP_REQUEST_TIMEOUT) environment variables
- will be used.
type: float
default: 10
version_added: '2.0.0'
aliases: [ aap_request_timeout ]
validate_certs:
description:
- Whether to allow insecure connections to Ansible Automation Platform EDA
Controller instance.
- If C(no), SSL certificates will not be validated.
- This should only be used on personally controlled sites using self-signed certificates.
- If value not set, will try environment variable C(CONTROLLER_VERIFY_SSL)
- If value not set, will try environment variable C(CONTROLLER_VERIFY_SSL), or E(AAP_VALIDATE_CERTS)
default: True
type: bool
version_added: '2.0.0'
aliases: [ aap_validate_certs ]
"""
22 changes: 17 additions & 5 deletions plugins/module_utils/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,36 @@

AUTH_ARGSPEC: dict[str, dict[str, object]] = {
"controller_host": {
"fallback": (env_fallback, ["CONTROLLER_HOST"]),
"fallback": (env_fallback, ["CONTROLLER_HOST", "AAP_HOSTNAME"]),
"required": True,
"aliases": ["aap_hostname"],
},
"controller_username": {
"fallback": (env_fallback, ["CONTROLLER_USERNAME"]),
"required": False,
"fallback": (env_fallback, ["CONTROLLER_USERNAME", "AAP_USERNAME"]),
"aliases": ["AAP_USERNAME"],
},
"controller_password": {
"fallback": (env_fallback, ["CONTROLLER_PASSWORD"]),
"required": False,
"fallback": (env_fallback, ["CONTROLLER_PASSWORD", "AAP_PASSWORD"]),
"no_log": True,
"aliases": ["aap_password"],
},
"validate_certs": {
"type": "bool",
"default": True,
"fallback": (env_fallback, ["CONTROLLER_VERIFY_SSL"]),
"required": False,
"fallback": (env_fallback, ["CONTROLLER_VERIFY_SSL", "AAP_VALIDATE_CERTS"]),
"aliases": ["AAP_VALIDATE_CERTS"],
},
"request_timeout": {
"type": "float",
"default": 10.0,
"fallback": (env_fallback, ["CONTROLLER_REQUEST_TIMEOUT"]),
"required": False,
"fallback": (
env_fallback,
["CONTROLLER_REQUEST_TIMEOUT", "AAP_REQUEST_TIMEOUT"],
),
"aliases": ["aap_request_timeout"],
},
}
Loading