Fixes bigip_config to remove from skip file (#32409)

This commit is contained in:
Tim Rupp 2017-10-31 15:48:23 -07:00 committed by GitHub
parent 3e80f9caf4
commit 8f2b243a3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 50 deletions

View file

@ -4,14 +4,18 @@
# Copyright (c) 2017 F5 Networks Inc. # Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
'supported_by': 'community'} 'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: bigip_config module: bigip_config
short_description: Manage BIG-IP configuration sections. short_description: Manage BIG-IP configuration sections
description: description:
- Manages a BIG-IP configuration by allowing TMSH commands that - Manages a BIG-IP configuration by allowing TMSH commands that
modify running configuration, or merge SCF formatted files into modify running configuration, or merge SCF formatted files into
@ -69,48 +73,48 @@ author:
- Tim Rupp (@caphrim007) - Tim Rupp (@caphrim007)
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Save the running configuration of the BIG-IP - name: Save the running configuration of the BIG-IP
bigip_config: bigip_config:
save: yes save: yes
server: "lb.mydomain.com" server: lb.mydomain.com
password: "secret" password: secret
user: "admin" user: admin
validate_certs: "no" validate_certs: no
delegate_to: localhost delegate_to: localhost
- name: Reset the BIG-IP configuration, for example, to RMA the device - name: Reset the BIG-IP configuration, for example, to RMA the device
bigip_config: bigip_config:
reset: yes reset: yes
save: yes save: yes
server: "lb.mydomain.com" server: lb.mydomain.com
password: "secret" password: secret
user: "admin" user: admin
validate_certs: "no" validate_certs: no
delegate_to: localhost delegate_to: localhost
- name: Load an SCF configuration - name: Load an SCF configuration
bigip_config: bigip_config:
merge_content: "{{ lookup('file', '/path/to/config.scf') }}" merge_content: "{{ lookup('file', '/path/to/config.scf') }}"
server: "lb.mydomain.com" server: lb.mydomain.com
password: "secret" password: secret
user: "admin" user: admin
validate_certs: "no" validate_certs: no
delegate_to: localhost delegate_to: localhost
''' '''
RETURN = ''' RETURN = r'''
stdout: stdout:
description: The set of responses from the options description: The set of responses from the options
returned: always returned: always
type: list type: list
sample: ['...', '...'] sample: ['...', '...']
stdout_lines: stdout_lines:
description: The value of stdout split into a list description: The value of stdout split into a list
returned: always returned: always
type: list type: list
sample: [['...', '...'], ['...'], ['...']] sample: [['...', '...'], ['...'], ['...']]
''' '''
import os import os
@ -121,15 +125,17 @@ try:
except ImportError: except ImportError:
from io import StringIO from io import StringIO
from ansible.module_utils.f5_utils import ( from ansible.module_utils.f5_utils import AnsibleF5Client
AnsibleF5Client, from ansible.module_utils.f5_utils import AnsibleF5Parameters
AnsibleF5Parameters, from ansible.module_utils.f5_utils import HAS_F5SDK
HAS_F5SDK, from ansible.module_utils.f5_utils import F5ModuleError
F5ModuleError, from ansible.module_utils.six import iteritems
iControlUnexpectedHTTPError, from collections import defaultdict
iteritems,
defaultdict try:
) from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError:
HAS_F5SDK = False
class Parameters(AnsibleF5Parameters): class Parameters(AnsibleF5Parameters):

View file

@ -14,7 +14,6 @@ lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py
lib/ansible/modules/cloud/webfaction/webfaction_site.py lib/ansible/modules/cloud/webfaction/webfaction_site.py
lib/ansible/modules/clustering/consul_acl.py lib/ansible/modules/clustering/consul_acl.py
lib/ansible/modules/network/cloudengine/ce_file_copy.py lib/ansible/modules/network/cloudengine/ce_file_copy.py
lib/ansible/modules/network/f5/bigip_config.py
lib/ansible/modules/network/f5/bigip_configsync_actions.py lib/ansible/modules/network/f5/bigip_configsync_actions.py
lib/ansible/modules/network/f5/bigip_gtm_pool.py lib/ansible/modules/network/f5/bigip_gtm_pool.py
lib/ansible/modules/network/f5/bigip_gtm_wide_ip.py lib/ansible/modules/network/f5/bigip_gtm_wide_ip.py

View file

@ -1,21 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright 2017 F5 Networks Inc. # Copyright (c) 2017 F5 Networks Inc.
# # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
#
# 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/>.
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
@ -38,11 +24,13 @@ try:
from library.bigip_config import Parameters from library.bigip_config import Parameters
from library.bigip_config import ModuleManager from library.bigip_config import ModuleManager
from library.bigip_config import ArgumentSpec from library.bigip_config import ArgumentSpec
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError: except ImportError:
try: try:
from ansible.modules.network.f5.bigip_config import Parameters from ansible.modules.network.f5.bigip_config import Parameters
from ansible.modules.network.f5.bigip_config import ModuleManager from ansible.modules.network.f5.bigip_config import ModuleManager
from ansible.modules.network.f5.bigip_config import ArgumentSpec from ansible.modules.network.f5.bigip_config import ArgumentSpec
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError: except ImportError:
raise SkipTest("F5 Ansible modules require the f5-sdk Python library") raise SkipTest("F5 Ansible modules require the f5-sdk Python library")