mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Update validate-modules (#20932)
* Update validate-modules * Validates ANSIBLE_METADATA * Ensures imports happen after documentation vars * Some pep8 cleanup * Clean up some left over unneeded code * Update modules for new module guidelines and validate-modules checks * Update imports for ec2_vpc_route_table and ec2_vpc_nat_gateway
This commit is contained in:
parent
1718719d77
commit
829c0b8f62
178 changed files with 1849 additions and 1783 deletions
|
@ -20,11 +20,6 @@
|
|||
#
|
||||
# see examples/playbooks/get_url.yml
|
||||
|
||||
import shutil
|
||||
import datetime
|
||||
import re
|
||||
import tempfile
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['stableinterface'],
|
||||
'supported_by': 'core',
|
||||
'version': '1.0'}
|
||||
|
@ -208,6 +203,10 @@ EXAMPLES='''
|
|||
dest: /tmp/afilecopy.txt
|
||||
'''
|
||||
|
||||
import shutil
|
||||
import datetime
|
||||
import re
|
||||
import tempfile
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlsplit
|
||||
|
||||
# ==============================================================
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: eos_banner_
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: eos_user
|
||||
|
|
|
@ -19,19 +19,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
|
||||
try:
|
||||
import ldap
|
||||
import ldap.sasl
|
||||
|
||||
HAS_LDAP = True
|
||||
except ImportError:
|
||||
HAS_LDAP = False
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {
|
||||
'status': [
|
||||
'preview'
|
||||
|
@ -201,6 +188,17 @@ modlist:
|
|||
sample: '[[2, "olcRootDN", ["cn=root,dc=example,dc=com"]]]'
|
||||
"""
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
|
||||
try:
|
||||
import ldap
|
||||
import ldap.sasl
|
||||
|
||||
HAS_LDAP = True
|
||||
except ImportError:
|
||||
HAS_LDAP = False
|
||||
|
||||
|
||||
class LdapAttr(object):
|
||||
def __init__(self, module):
|
||||
|
|
|
@ -19,19 +19,9 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
|
||||
try:
|
||||
import ldap
|
||||
import ldap.modlist
|
||||
import ldap.sasl
|
||||
|
||||
HAS_LDAP = True
|
||||
except ImportError:
|
||||
HAS_LDAP = False
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
|
@ -157,6 +147,18 @@ RETURN = """
|
|||
# Default return values
|
||||
"""
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
|
||||
try:
|
||||
import ldap
|
||||
import ldap.modlist
|
||||
import ldap.sasl
|
||||
|
||||
HAS_LDAP = True
|
||||
except ImportError:
|
||||
HAS_LDAP = False
|
||||
|
||||
|
||||
class LdapEntry(object):
|
||||
def __init__(self, module):
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import subprocess
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -51,6 +49,9 @@ EXAMPLES = '''
|
|||
|
||||
'''
|
||||
|
||||
import subprocess
|
||||
|
||||
|
||||
def gather_lldp():
|
||||
cmd = ['lldpctl', '-f', 'keyvalue']
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -111,6 +108,8 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
NAME_EXISTS = None
|
||||
NODE1_EXISTS = None
|
||||
NODE2_EXISTS = None
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -99,6 +97,7 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
VROUTER_EXISTS = None
|
||||
NETWORK_EXISTS = None
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -115,6 +112,8 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
|
||||
def get_command_from_state(state):
|
||||
"""
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -96,6 +93,8 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
|
||||
def pn_cli(module):
|
||||
"""
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -161,6 +158,9 @@ changed:
|
|||
returned: always
|
||||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
TRUNK_EXISTS = None
|
||||
|
||||
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -134,6 +131,8 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
VLAG_EXISTS = None
|
||||
|
||||
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -114,6 +111,8 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
VLAN_EXISTS = None
|
||||
MAX_VLAN_ID = 4092
|
||||
MIN_VLAN_ID = 2
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -148,6 +145,8 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
VROUTER_EXISTS = None
|
||||
VROUTER_NAME_EXISTS = None
|
||||
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -161,6 +158,7 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
VROUTER_EXISTS = None
|
||||
NEIGHBOR_EXISTS = None
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -160,6 +157,7 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
VROUTER_EXISTS = None
|
||||
INTERFACE_EXISTS = None
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
import shlex
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -101,6 +98,7 @@ changed:
|
|||
type: bool
|
||||
"""
|
||||
|
||||
import shlex
|
||||
|
||||
VROUTER_EXISTS = None
|
||||
LB_INTERFACE_EXISTS = None
|
||||
|
|
|
@ -22,6 +22,10 @@ You should have received a copy of the GNU General Public License
|
|||
along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: omapi_host
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue