Added support for dnos9_config module

This commit is contained in:
Senthil Kumar Ganesan 2016-09-13 10:42:12 -07:00
parent 7450629733
commit c6acf44a7c
3 changed files with 45 additions and 7 deletions

View file

@ -66,6 +66,11 @@ Ansible Changes By Release
- cloudstack
* cs_router
* cs_snapshot_policy
- dnos6
* dnos6_command
- dnos9
* dnos9_command
* dnos9_config
- dnos10
* dnos10_command
* dnos10_config
@ -73,10 +78,6 @@ Ansible Changes By Release
- exoscale:
* exo_dns_domain
* exo_dns_record
- dnos6
* dnos6_command
- dnos9
* dnos9_command
- f5:
* bigip_device_dns
* bigip_device_ntp

View file

@ -63,18 +63,23 @@ class Cli(CliBase):
NET_PASSWD_RE = re.compile(r"[\r\n]?password:\s?$", re.I)
WARNING_PROMPTS_RE = [
re.compile(r"[\r\n]?\[confirm yes/no\]:\s?$"),
re.compile(r"[\r\n]?\[y/n\]:\s?$"),
re.compile(r"[\r\n]?\[yes/no\]:\s?$")
]
CLI_PROMPTS_RE = [
re.compile(r"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"),
re.compile(r"\[\w+\@[\w\-\.]+(?: [^\]])\] ?[>#\$] ?$")
]
CLI_ERRORS_RE = [
re.compile(r"% ?Error"),
re.compile(r"% ?Error: (?:(?!\bdoes not exist\b)(?!\balready exists\b)(?!\bHost not found\b).)*$"),
re.compile(r"% ?Bad secret"),
re.compile(r"invalid input", re.I),
re.compile(r"(?:incomplete|ambiguous) command", re.I),
re.compile(r"connection timed out", re.I),
re.compile(r"[^\r\n]+ not found", re.I),
re.compile(r"'[^']' +returned error code: ?\d+"),
]
@ -92,7 +97,11 @@ class Cli(CliBase):
def configure(self, commands, **kwargs):
cmds = ['configure terminal']
cmds.extend(to_list(commands))
cmdlist = list()
for c in to_list(commands):
cmd = Command(c, prompt=self.WARNING_PROMPTS_RE, response='yes')
cmdlist.append(cmd)
cmds.extend(cmdlist)
cmds.append('end')
responses = self.execute(cmds)

View file

@ -0,0 +1,28 @@
#
# Copyright 2015 Peter Sprygada <psprygada@ansible.com>
#
# 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)
__metaclass__ = type
from ansible.plugins.action import ActionBase
from ansible.plugins.action.net_config import ActionModule as NetActionModule
class ActionModule(NetActionModule, ActionBase):
pass