mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
remove wildcards and add boilerplate
* cloud/centurylink * source_control * cloud/google * notification * cloud/rackspace * cloud/vmware
This commit is contained in:
parent
21564cdb98
commit
4109a82d0a
135 changed files with 1343 additions and 2631 deletions
|
@ -3,21 +3,12 @@
|
|||
|
||||
# Copyright IBM Corp. 2016
|
||||
# Author(s): Andreas Nafpliotis <nafpliot@de.ibm.com>
|
||||
#
|
||||
# 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
|
||||
|
||||
# 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/
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.0',
|
||||
'status': ['preview'],
|
||||
|
@ -78,6 +69,9 @@ try:
|
|||
except ImportError:
|
||||
HAS_PYVMOMI = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.vmware import HAS_PYVMOMI, connect_to_api, vmware_argument_spec
|
||||
|
||||
|
||||
class VMwareLocalUserManager(object):
|
||||
def __init__(self, module):
|
||||
|
@ -139,7 +133,7 @@ class VMwareLocalUserManager(object):
|
|||
account_spec = self.create_account_spec()
|
||||
|
||||
try:
|
||||
task = self.content.accountManager.CreateUser(account_spec)
|
||||
self.content.accountManager.CreateUser(account_spec)
|
||||
self.module.exit_json(changed=True)
|
||||
except vmodl.RuntimeFault as runtime_fault:
|
||||
self.module.fail_json(msg=runtime_fault.msg)
|
||||
|
@ -150,7 +144,7 @@ class VMwareLocalUserManager(object):
|
|||
account_spec = self.create_account_spec()
|
||||
|
||||
try:
|
||||
task = self.content.accountManager.UpdateUser(account_spec)
|
||||
self.content.accountManager.UpdateUser(account_spec)
|
||||
self.module.exit_json(changed=True)
|
||||
except vmodl.RuntimeFault as runtime_fault:
|
||||
self.module.fail_json(msg=runtime_fault.msg)
|
||||
|
@ -160,7 +154,7 @@ class VMwareLocalUserManager(object):
|
|||
|
||||
def state_remove_user(self):
|
||||
try:
|
||||
task = self.content.accountManager.RemoveUser(self.local_user_name)
|
||||
self.content.accountManager.RemoveUser(self.local_user_name)
|
||||
self.module.exit_json(changed=True)
|
||||
except vmodl.RuntimeFault as runtime_fault:
|
||||
self.module.fail_json(msg=runtime_fault.msg)
|
||||
|
@ -189,8 +183,6 @@ def main():
|
|||
vmware_local_user_manager = VMwareLocalUserManager(module)
|
||||
vmware_local_user_manager.process_state()
|
||||
|
||||
from ansible.module_utils.vmware import *
|
||||
from ansible.module_utils.basic import *
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue