mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
* aci_rest: New module to access Cisco ACI This PR includes: - Relicense as GPLv3+ - Check-mode support - Cosmetic changes to documentation - Examples in YAML format - Removal of incorrect requirements (for this module) - Do not log passwords - Implement native fetch_url instead of requests - Use standard hostname, username and password parameters - Add alias src for parameter config_file - Add mutual exclusive content option for inline data (and show some inline examples) - Add timeout parameter - Add validate_certs parameter - Handling ACI result output (identical for JSON as XML input) - Parse/expose ACI error output to user * Lower case method, add use_ssl, Use python dicts This commit includes: - Use lowercase method names - Add `use_ssl` parameter (not the `protocol` parameter) - Use a python dict for the request data (not a JSON string) - Documentation improvements * Ensure one of 'content' or 'src' is provided * Fix issue with totalCount being a string in JSON This fixes the problem with JSON output where totalCount is a string and not an integer. This fixes jedelman8/aci-ansible#7 * Improve code documentation * Improve error handling and module response * Small typo * Improve documentation and examples * Keep protocol parameter, but deprecate it * Extrude aci functions from module_utils * aci_rest: Add unit tests
55 lines
1.6 KiB
Python
55 lines
1.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
# Copyright 2017 Dag Wieers <dag@wieers.com>
|
|
|
|
# This file is part of Ansible by Red Hat
|
|
#
|
|
# Ansible is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Ansible is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
class ModuleDocFragment(object):
|
|
# Standard files documentation fragment
|
|
DOCUMENTATION = '''
|
|
options:
|
|
hostname:
|
|
description:
|
|
- IP Address or hostname of APIC resolvable by Ansible control host.
|
|
required: true
|
|
aliases: [ host ]
|
|
username:
|
|
description:
|
|
- The username to use for authentication.
|
|
required: true
|
|
default: admin
|
|
aliases: [ user ]
|
|
password:
|
|
description:
|
|
- The password to use for authentication.
|
|
required: true
|
|
timeout:
|
|
description:
|
|
- The socket level timeout in seconds.
|
|
default: 30
|
|
use_ssl:
|
|
description:
|
|
- If C(no), an HTTP connection will be used instead of the default HTTPS connection.
|
|
type: bool
|
|
default: 'yes'
|
|
validate_certs:
|
|
description:
|
|
- If C(no), SSL certificates will not be validated.
|
|
- This should only set to C(no) used on personally controlled sites using self-signed certificates.
|
|
type: bool
|
|
default: 'yes'
|
|
'''
|