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

Add CML_LAB env var fallback to cml_lab_facts module #1

Merged
merged 2 commits into from
Dec 9, 2024
Merged
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
4 changes: 2 additions & 2 deletions plugins/modules/cml_lab_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@
var: results
"""

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.basic import AnsibleModule, env_fallback
from ansible_collections.cisco.cml.plugins.module_utils.cml_utils import cmlModule, cml_argument_spec


def run_module():
# define available arguments/parameters a user can pass to the module
argument_spec = cml_argument_spec()
argument_spec.update(lab=dict(type='str', required=True), )
argument_spec.update(lab=dict(type='str', required=True, fallback=(env_fallback, ['CML_LAB'])), )

# the AnsibleModule object will be our abstraction working with Ansible
# this includes instantiation, a couple of common attr would be the
Expand Down