summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/unity/playbooks/modules/cifsserver.yml
blob: ee2f980f83a813d9cd9a8d85c724177d8e51f3fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
- name: CIFS Server Operations
  hosts: localhost
  connection: local
  gather_facts: false
  vars:
    unispherehost: '10.*.*.*'
    validate_certs: false
    username: 'user'
    password: '***'
    domain_username: 'domain_user'
    domain_password: '**'

  tasks:
    - name: Create standalone CIFS server with check mode
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        netbios_name: "ansible_cifs"
        workgroup: "ansible"
        local_password: "**"
        nas_server_name: "Ansible_server_1"
        state: "present"
      check_mode: true

    - name: Create standalone CIFS server
      register: result
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        netbios_name: "ansible_cifs"
        workgroup: "ansible"
        local_password: "**"
        nas_server_name: "Ansible_server_1"
        state: "present"

    - name: Create standalone CIFS server - Idempotency
      register: result
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        netbios_name: "ansible_cifs"
        workgroup: "ansible"
        local_password: "**"
        nas_server_name: "Ansible_server_1"
        state: "present"

    - name: Get CIFS server details
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        cifs_server_id: "{{ result.cifs_server_details.id }}"
        state: "present"

    - name: Get CIFS server details using NAS server name
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        nas_server_name: "Ansible_server_1"
        state: "present"

    - name: Get CIFS server details using NAS server ID
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        nas_server_id: "{{ result.cifs_server_details.nas_server.UnityNasServer.id }}"
        state: "present"

    - name: Delete CIFS server
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        cifs_server_id: "{{ result.cifs_server_details.id }}"
        state: "absent"

    - name: Create CIFS server belonging to Active Directory
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        nas_server_id: "nas_52"
        cifs_server_name: "test_cifs_server"
        domain: "test.lab.domain.com"
        domain_username: "{{ domain_username }}"
        domain_password: "{{ domain_password }}"
        state: "present"

    - name: Create CIFS server belonging to Active Directory - Idempotency
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        nas_server_id: "nas_52"
        cifs_server_name: "test_cifs_server"
        domain: "test.lab.domain.com"
        domain_username: "{{ domain_username }}"
        domain_password: "{{ domain_password }}"
        state: "present"

    - name: Delete CIFS server with check mode
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        cifs_server_name: "test_cifs_server"
        unjoin_cifs_server_account: true
        domain_username: "{{ domain_username }}"
        domain_password: "{{ domain_password }}"
        state: "absent"
      check_mode: true

    - name: Delete CIFS server
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        cifs_server_name: "test_cifs_server"
        unjoin_cifs_server_account: true
        domain_username: "{{ domain_username }}"
        domain_password: "{{ domain_password }}"
        state: "absent"

    - name: Delete CIFS server - Idempotency
      dellemc.unity.cifsserver:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        cifs_server_name: "test_cifs_server"
        unjoin_cifs_server_account: true
        domain_username: "{{ domain_username }}"
        domain_password: "{{ domain_password }}"
        state: "absent"