From d22d97d420de430539492554c4d1b82dfb2ee3e5 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Thu, 16 Aug 2018 05:36:47 -0700 Subject: [PATCH] Bug fixes for ontap_cifs_server.py (#44185) * Bug fixes for ontap_cifs_server.py * Fix issues --- .../storage/netapp/na_ontap_cifs_server.py | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/storage/netapp/na_ontap_cifs_server.py b/lib/ansible/modules/storage/netapp/na_ontap_cifs_server.py index 46fe88335d6..be15d019f32 100644 --- a/lib/ansible/modules/storage/netapp/na_ontap_cifs_server.py +++ b/lib/ansible/modules/storage/netapp/na_ontap_cifs_server.py @@ -21,7 +21,7 @@ short_description: cifs server configuration extends_documentation_fragment: - netapp.na_ontap version_added: '2.6' -author: chhaya gunawat (chhayag@netapp.com) +author: NetApp Ansible Team (ng-ansibleteam@netapp.com) description: - Creating / deleting and modifying the CIF server . @@ -60,6 +60,19 @@ options: description: - The NetBIOS name of the domain or workgroup this CIFS server belongs to. + ou: + description: + - The Organizational Unit (OU) within the Windows Active Directory + this CIFS server belongs to. + version_added: '2.7' + + force: + type: bool + description: + - If this is set and a machine account with the same name as + specified in 'cifs_server_name' exists in the Active Directory, it + will be overwritten and reused. + version_added: '2.7' vserver: description: @@ -115,7 +128,8 @@ class NetAppOntapcifsServer(object): domain=dict(required=False, type='str'), admin_user_name=dict(required=False, type='str'), admin_password=dict(required=False, type='str'), - + ou=dict(required=False, type='str'), + force=dict(required=False, type='bool'), vserver=dict(required=True, type='str'), )) @@ -135,6 +149,8 @@ class NetAppOntapcifsServer(object): self.service_state = params['service_state'] self.admin_user_name = params['admin_user_name'] self.admin_password = params['admin_password'] + self.ou = params['ou'] + self.force = params['force'] if HAS_NETAPP_LIB is False: self.module.fail_json(msg="the python NetApp-Lib module is required") @@ -185,6 +201,10 @@ class NetAppOntapcifsServer(object): options['admin-username'] = self.admin_user_name if self.admin_password is not None: options['admin-password'] = self.admin_password + if self.ou is not None: + options['organizational-unit'] = self.ou + if self.force is not None: + options['force-account-overwrite'] = str(self.force).lower() cifs_server_create = netapp_utils.zapi.NaElement.create_node_with_children( 'cifs-server-create', **options)