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

Fixes skip imports for bigip_configsync_action module #32413

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 32 additions & 24 deletions lib/ansible/modules/network/f5/bigip_configsync_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_configsync_action
short_description: Perform different actions related to config-sync.
short_description: Perform different actions related to config-sync
description:
- Allows one to run different config-sync actions. These actions allow
you to manually sync your configuration across multiple BIG-IPs when
Expand Down Expand Up @@ -60,39 +64,39 @@
- Tim Rupp (@caphrim007)
'''

EXAMPLES = '''
EXAMPLES = r'''
- name: Sync configuration from device to group
bigip_configsync_actions:
device_group: "foo-group"
sync_device_to_group: yes
server: "lb01.mydomain.com"
user: "admin"
password: "secret"
validate_certs: no
device_group: foo-group
sync_device_to_group: yes
server: lb.mydomain.com
user: admin
password: secret
validate_certs: no
delegate_to: localhost

- name: Sync configuration from most recent device to the current host
bigip_configsync_actions:
device_group: "foo-group"
sync_most_recent_to_device: yes
server: "lb01.mydomain.com"
user: "admin"
password: "secret"
validate_certs: no
device_group: foo-group
sync_most_recent_to_device: yes
server: lb.mydomain.com
user: admin
password: secret
validate_certs: no
delegate_to: localhost

- name: Perform an initial sync of a device to a new device group
bigip_configsync_actions:
device_group: "new-device-group"
sync_device_to_group: yes
server: "lb01.mydomain.com"
user: "admin"
password: "secret"
validate_certs: no
device_group: new-device-group
sync_device_to_group: yes
server: lb.mydomain.com
user: admin
password: secret
validate_certs: no
delegate_to: localhost
'''

RETURN = '''
RETURN = r'''
# only common fields returned
'''

Expand Down Expand Up @@ -345,10 +349,14 @@ def __init__(self):

def main():
if not HAS_F5SDK:
raise F5ModuleError("The python f5-sdk module is required")
raise F5ModuleError(
"The python 'f5-sdk' module is required. This can be done with 'pip install f5-sdk'"
)

if not HAS_OBJPATH:
raise F5ModuleError("The python objectpath module is required")
raise F5ModuleError(
"The python 'objectpath' module is required. This can be done with 'pip install objectpath'"
)

spec = ArgumentSpec()

Expand Down
1 change: 0 additions & 1 deletion test/sanity/import/skip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ lib/ansible/modules/cloud/webfaction/webfaction_mailbox.py
lib/ansible/modules/cloud/webfaction/webfaction_site.py
lib/ansible/modules/clustering/consul_acl.py
lib/ansible/modules/network/cloudengine/ce_file_copy.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_wide_ip.py
lib/ansible/modules/network/f5/bigip_hostname.py
Expand Down
18 changes: 2 additions & 16 deletions test/units/modules/network/f5/test_bigip_configsync_action.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# 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/>.
# 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
Expand Down