Fixes documentation related bugs (#31730)

New conventions for ansible warrant fixes to accomodate those
in bigip_partition.

This patch also includes an import fix that can raise an error when
Ansible unit tests run
This commit is contained in:
Tim Rupp 2017-10-13 22:06:19 -07:00 committed by GitHub
parent a969a529ab
commit 53445ded84
2 changed files with 44 additions and 38 deletions

View file

@ -4,14 +4,18 @@
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: bigip_partition
short_description: Manage BIG-IP partitions.
short_description: Manage BIG-IP partitions
description:
- Manage BIG-IP partitions.
version_added: "2.5"
@ -42,70 +46,70 @@ author:
- Tim Rupp (@caphrim007)
'''
EXAMPLES = '''
EXAMPLES = r'''
- name: Create partition "foo" using the default route domain
bigip_partition:
name: "foo"
password: "secret"
server: "lb.mydomain.com"
user: "admin"
name: foo
password: secret
server: lb.mydomain.com
user: admin
delegate_to: localhost
- name: Create partition "bar" using a custom route domain
bigip_partition:
name: "bar"
route_domain: 3
password: "secret"
server: "lb.mydomain.com"
user: "admin"
name: bar
route_domain: 3
password: secret
server: lb.mydomain.com
user: admin
delegate_to: localhost
- name: Change route domain of partition "foo"
bigip_partition:
name: "foo"
route_domain: 8
password: "secret"
server: "lb.mydomain.com"
user: "admin"
name: foo
route_domain: 8
password: secret
server: lb.mydomain.com
user: admin
delegate_to: localhost
- name: Set a description for partition "foo"
bigip_partition:
name: "foo"
description: "Tenant CompanyA"
password: "secret"
server: "lb.mydomain.com"
user: "admin"
name: foo
description: Tenant CompanyA
password: secret
server: lb.mydomain.com
user: admin
delegate_to: localhost
- name: Delete the "foo" partition
bigip_partition:
name: "foo"
password: "secret"
server: "lb.mydomain.com"
user: "admin"
state: "absent"
name: foo
password: secret
server: lb.mydomain.com
user: admin
state: absent
delegate_to: localhost
'''
RETURN = '''
RETURN = r'''
route_domain:
description: Name of the route domain associated with the partition.
returned: changed and success
type: int
sample: 0
description: Name of the route domain associated with the partition.
returned: changed and success
type: int
sample: 0
description:
description: The description of the partition.
returned: changed and success
type: string
sample: "Example partition"
description: The description of the partition.
returned: changed and success
type: string
sample: Example partition
'''
from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import AnsibleF5Parameters
from ansible.module_utils.f5_utils import F5ModuleError
from ansible.module_utils.f5_utils import iteritems
from ansible.module_utils.f5_utils import defaultdict
from ansible.module_utils.six import iteritems
from collections import defaultdict
try:
from ansible.module_utils.f5_utils import HAS_F5SDK

View file

@ -38,11 +38,13 @@ try:
from library.bigip_partition import Parameters
from library.bigip_partition import ModuleManager
from library.bigip_partition import ArgumentSpec
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError:
try:
from ansible.modules.network.f5.bigip_partition import Parameters
from ansible.modules.network.f5.bigip_partition import ModuleManager
from ansible.modules.network.f5.bigip_partition import ArgumentSpec
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError:
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")