Removes bigip_ucs from skip file (#32462)

pull/32470/head
Tim Rupp 7 years ago committed by GitHub
parent d43985aa46
commit e3f1198a67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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_ucs module: bigip_ucs
short_description: Manage upload, installation and removal of UCS files. short_description: Manage upload, installation and removal of UCS files
description: description:
- Manage upload, installation and removal of UCS files. - Manage upload, installation and removal of UCS files.
version_added: "2.4" version_added: "2.4"
@ -112,84 +116,91 @@ author:
- Tim Rupp (@caphrim007) - Tim Rupp (@caphrim007)
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Upload UCS - name: Upload UCS
bigip_ucs: bigip_ucs:
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
ucs: "/root/bigip.localhost.localdomain.ucs" ucs: /root/bigip.localhost.localdomain.ucs
state: "present" state: present
delegate_to: localhost delegate_to: localhost
- name: Install (upload, install) UCS. - name: Install (upload, install) UCS.
bigip_ucs: bigip_ucs:
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
ucs: "/root/bigip.localhost.localdomain.ucs" ucs: /root/bigip.localhost.localdomain.ucs
state: "installed" state: installed
delegate_to: localhost delegate_to: localhost
- name: Install (upload, install) UCS without installing the license portion - name: Install (upload, install) UCS without installing the license portion
bigip_ucs: bigip_ucs:
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
ucs: "/root/bigip.localhost.localdomain.ucs" ucs: /root/bigip.localhost.localdomain.ucs
state: "installed" state: installed
no_license: "yes" no_license: yes
delegate_to: localhost delegate_to: localhost
- name: Install (upload, install) UCS except the license, and bypassing the platform check - name: Install (upload, install) UCS except the license, and bypassing the platform check
bigip_ucs: bigip_ucs:
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
ucs: "/root/bigip.localhost.localdomain.ucs" ucs: /root/bigip.localhost.localdomain.ucs
state: "installed" state: installed
no_license: "yes" no_license: yes
no_platform_check: "yes" no_platform_check: yes
delegate_to: localhost delegate_to: localhost
- name: Install (upload, install) UCS using a passphrase necessary to load the UCS - name: Install (upload, install) UCS using a passphrase necessary to load the UCS
bigip_ucs: bigip_ucs:
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
ucs: "/root/bigip.localhost.localdomain.ucs" ucs: /root/bigip.localhost.localdomain.ucs
state: "installed" state: installed
passphrase: "MyPassphrase1234" passphrase: MyPassphrase1234
delegate_to: localhost delegate_to: localhost
- name: Remove uploaded UCS file - name: Remove uploaded UCS file
bigip_ucs: bigip_ucs:
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
ucs: "bigip.localhost.localdomain.ucs" ucs: bigip.localhost.localdomain.ucs
state: "absent" state: absent
delegate_to: localhost delegate_to: localhost
''' '''
RETURN = ''' RETURN = r'''
# only common fields returned # only common fields returned
''' '''
import os import os
import re import re
import sys
import time import time
from collections import OrderedDict
from distutils.version import LooseVersion from distutils.version import LooseVersion
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,
iteritems try:
) from collections import OrderedDict
except ImportError:
pass
try:
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError:
HAS_F5SDK = False
class Parameters(AnsibleF5Parameters): class Parameters(AnsibleF5Parameters):
@ -250,7 +261,6 @@ class Parameters(AnsibleF5Parameters):
cmd = 'tmsh load sys ucs /var/local/ucs/{0}'.format(self.basename) cmd = 'tmsh load sys ucs /var/local/ucs/{0}'.format(self.basename)
# Append any options that might be specified # Append any options that might be specified
options = OrderedDict(sorted(self.options.items(), key=lambda t: t[0])) options = OrderedDict(sorted(self.options.items(), key=lambda t: t[0]))
print(options)
for k, v in iteritems(options): for k, v in iteritems(options):
if v is False or v is None: if v is False or v is None:
continue continue
@ -578,6 +588,9 @@ def main():
if not HAS_F5SDK: if not HAS_F5SDK:
raise F5ModuleError("The python f5-sdk module is required") raise F5ModuleError("The python f5-sdk module is required")
if sys.version_info < (2, 7):
raise F5ModuleError("F5 Ansible modules require Python >= 2.7")
spec = ArgumentSpec() spec = ArgumentSpec()
client = AnsibleF5Client( client = AnsibleF5Client(

@ -23,7 +23,6 @@ lib/ansible/modules/network/f5/bigip_provision.py
lib/ansible/modules/network/f5/bigip_qkview.py lib/ansible/modules/network/f5/bigip_qkview.py
lib/ansible/modules/network/f5/bigip_snmp.py lib/ansible/modules/network/f5/bigip_snmp.py
lib/ansible/modules/network/f5/bigip_snmp_trap.py lib/ansible/modules/network/f5/bigip_snmp_trap.py
lib/ansible/modules/network/f5/bigip_ucs.py
lib/ansible/modules/network/ios/ios_static_route.py lib/ansible/modules/network/ios/ios_static_route.py
lib/ansible/modules/network/lenovo/cnos_backup.py lib/ansible/modules/network/lenovo/cnos_backup.py
lib/ansible/modules/network/lenovo/cnos_bgp.py lib/ansible/modules/network/lenovo/cnos_bgp.py

@ -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
@ -42,6 +28,7 @@ try:
from library.bigip_ucs import ArgumentSpec from library.bigip_ucs import ArgumentSpec
from library.bigip_ucs import V1Manager from library.bigip_ucs import V1Manager
from library.bigip_ucs import V2Manager from library.bigip_ucs import V2Manager
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError: except ImportError:
try: try:
from ansible.modules.network.f5.bigip_ucs import Parameters from ansible.modules.network.f5.bigip_ucs import Parameters
@ -49,6 +36,7 @@ except ImportError:
from ansible.modules.network.f5.bigip_ucs import ArgumentSpec from ansible.modules.network.f5.bigip_ucs import ArgumentSpec
from ansible.modules.network.f5.bigip_ucs import V1Manager from ansible.modules.network.f5.bigip_ucs import V1Manager
from ansible.modules.network.f5.bigip_ucs import V2Manager from ansible.modules.network.f5.bigip_ucs import V2Manager
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")

Loading…
Cancel
Save