Debian Codegraph @

ansible_collections/microsoft/ad/plugins/modules/offline_join.yml

raw
1 # Copyright: (c) 2023, Ansible Project
2 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3
4 DOCUMENTATION:
5 module: offline_join
6 short_description: Get the Offline Domain Join BLOB
7 description:
8 - Used to get the Offline Domain Join BLOB.
9 - This BLOB is used to join computers to a domain without any network
10 access.
11 requirements:
12 - C(ActiveDirectory) PowerShell module
13 options:
14 blob_path:
15 description:
16 - If set, will store the blob bytes into a file at this path.
17 - This will not create the parent directory specified if it does not
18 exist.
19 - The existence of this file is also used as an idempotency check, if
20 the file already exists the blob will not be regenerated.
21 - If specified the module return value I(blob) will be null.
22 type: str
23 domain_server:
24 description:
25 - Specified the Active Directory Domain Services instance to connect to.
26 - Can be in the form of an FQDN or NetBIOS name.
27 - If not specified then the value is based on the default domain of the
28 computer running PowerShell.
29 type: str
30 identity:
31 description:
32 - The identity of the computer object used to generate the offline join
33 blob for.
34 - This is mutually exclusive with I(name) and (path).
35 - The identity can be in the form of a GUID representing the
36 C(objectGUID) value, C(sAMAccountName), C(objectSid), or
37 C(distinguishedName).
38 - This option or I(name) must be specified.
39 type: str
40 name:
41 description:
42 - The name of the computer object used to generate the offline join blob
43 for.
44 - This is mutually exclusive with I(identity).
45 - The name is combined with I(path) to find the AD computer object that
46 matches the DistinguishedName C(CN={{ name}},{{ path }}).
47 - This option or I(identity) must be specified.
48 type: str
49 path:
50 description:
51 - The path where the computer object specified by C(name) is stored.
52 - By default the default computer path defined in AD is used, for
53 example C(CN=Computers,DC=domain,DC=com).
54 type: str
55 provision_root_ca_certs:
56 description:
57 - Adds all the root Certificate Authority certificates on the local
58 machine and adds them to the blob.
59 type: bool
60 default: false
61 extends_documentation_fragment:
62 - ansible.builtin.action_common_attributes
63 attributes:
64 check_mode:
65 support: full
66 diff_mode:
67 support: none
68 platform:
69 platforms:
70 - windows
71 notes:
72 - For more information on Offline Domain Join see
73 L(the step-by-step guide,https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd392267%28v=ws.10%29).
74 - There is no way to specify specific credentials to communicate with the
75 domain controller when creating the blob. Use C(become) with net
76 credentials if the current user cannot authenticate itself and bypass the
77 double hop problem.
78 - The data returned by this module is very sensitive. If not using
79 I(blob_path) then C(no_log=True) should be used on the task to avoid the
80 data being leaked.
81 - This module will always report a change unless I(blob_path) is specified.
82 If the path is specified then then the existence of that path will act as
83 the idempotency check.
84 - Generating a new blob will reset the password of the computer object, take
85 care that this isn't called under a computer account that has already been
86 joined.
87 - This module must be run on a Windows target host with the
88 C(ActiveDirectory) module installed.
89 seealso:
90 - module: microsoft.ad.domain
91 - module: microsoft.ad.membership
92 - module: microsoft.ad.computer
93 author:
94 - Jordan Borean (@jborean93)
95
96 EXAMPLES: |
97 - name: create computer object
98 microsoft.ad.computer:
99 name: MyComputer
100 state: present
101 register: computer_obj
102
103 - name: create offline blob
104 microsoft.ad.offline_join:
105 identity: '{{ computer_obj.object_guid }}'
106 when: computer_obj is changed
107 register: offline_blob
108 no_log: true
109
110 - name: join host by offline blob
111 microsoft.ad.membership:
112 offline_join_blob: '{{ offline_blob.blob }}'
113 state: domain
114 reboot: true
115 delegate_to: member-host
116
117 - name: create blob and store it in a file on the target host
118 microsoft.ad.offline_join:
119 name: MyComputer
120 path: OU=Production,DC=domain,DC=com
121 blob_path: C:\Windows\TEMP\offline_blob
122
123 RETURN:
124 blob:
125 description:
126 - The blob as a base64 string.
127 - This value is empty when running in check mode.
128 - This value is null when I(blob_path) is specified.
129 - This value is highly sensitive as it contains the credentials and other
130 authentication data needed for an offline join.
131 returned: always
132 type: str
133 sample: ARAIAMzMzMygCAAAAAAAAAAAAgABAAAA