summaryrefslogtreecommitdiff
path: root/plugins/modules/vyos_config.py
diff options
context:
space:
mode:
authorBradley A. Thornton <bthornto@thethorntons.net>2019-08-09 10:42:04 -0700
committerBradley A. Thornton <bthornto@thethorntons.net>2019-08-09 10:42:04 -0700
commit7b9a33a29007ed302c3001566061e22c514cde64 (patch)
tree7c4e4b0b740538d7e3953c377cba432d58805022 /plugins/modules/vyos_config.py
parent8a50be4b9309387624e92a154366b34fa512cd8b (diff)
downloadvyos.vyos-7b9a33a29007ed302c3001566061e22c514cde64.tar.gz
vyos.vyos-7b9a33a29007ed302c3001566061e22c514cde64.zip
bt_yapfed
Diffstat (limited to 'plugins/modules/vyos_config.py')
-rw-r--r--plugins/modules/vyos_config.py32
1 files changed, 12 insertions, 20 deletions
diff --git a/plugins/modules/vyos_config.py b/plugins/modules/vyos_config.py
index 7987e14..7f8e71b 100644
--- a/plugins/modules/vyos_config.py
+++ b/plugins/modules/vyos_config.py
@@ -16,10 +16,11 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
-ANSIBLE_METADATA = {'metadata_version': '1.1',
- 'status': ['preview'],
- 'supported_by': 'network'}
-
+ANSIBLE_METADATA = {
+ 'metadata_version': '1.1',
+ 'status': ['preview'],
+ 'supported_by': 'network'
+}
DOCUMENTATION = """
---
@@ -193,8 +194,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network. \
from ansible_collections.vyos.vyos.plugins.module_utils.network. \
vyos.vyos import vyos_argument_spec, get_connection
-
-
DEFAULT_COMMENT = 'configured by vyos_config'
CONFIG_FILTERS = [
@@ -268,7 +267,9 @@ def run(module, result):
# create loadable config that includes only the configuration updates
connection = get_connection(module)
try:
- response = connection.get_diff(candidate=candidate, running=config, diff_match=module.params['match'])
+ response = connection.get_diff(candidate=candidate,
+ running=config,
+ diff_match=module.params['match'])
except ConnectionError as exc:
module.fail_json(msg=to_text(exc, errors='surrogate_then_replace'))
@@ -295,20 +296,13 @@ def run(module, result):
def main():
- backup_spec = dict(
- filename=dict(),
- dir_path=dict(type='path')
- )
+ backup_spec = dict(filename=dict(), dir_path=dict(type='path'))
argument_spec = dict(
src=dict(type='path'),
lines=dict(type='list'),
-
match=dict(default='line', choices=['line', 'none']),
-
comment=dict(default=DEFAULT_COMMENT),
-
config=dict(),
-
backup=dict(type='bool', default=False),
backup_options=dict(type='dict', options=backup_spec),
save=dict(type='bool', default=False),
@@ -318,11 +312,9 @@ def main():
mutually_exclusive = [('lines', 'src')]
- module = AnsibleModule(
- argument_spec=argument_spec,
- mutually_exclusive=mutually_exclusive,
- supports_check_mode=True
- )
+ module = AnsibleModule(argument_spec=argument_spec,
+ mutually_exclusive=mutually_exclusive,
+ supports_check_mode=True)
warnings = list()