-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
110 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -270,34 +270,37 @@ <h2><a class="toc-backref" href="#id5" role="doc-backlink">Examples</a><a class= | |
<span class="c1"># and will use the passed credentials to join domain if necessary.</span> | ||
<span class="c1"># Ansible connection should use local credentials if possible.</span> | ||
<span class="c1"># If a reboot is required, the second task will trigger one and wait until the host is available.</span> | ||
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">hosts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">winclient</span> | ||
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Play to join the hsots to a domain</span> | ||
<span class="w"> </span><span class="nt">hosts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">winclient</span> | ||
<span class="w"> </span><span class="nt">gather_facts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">false</span> | ||
<span class="w"> </span><span class="nt">tasks</span><span class="p">:</span> | ||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">ansible.windows.win_domain_membership</span><span class="p">:</span> | ||
<span class="w"> </span><span class="nt">dns_domain_name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ansible.vagrant</span> | ||
<span class="w"> </span><span class="nt">hostname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mydomainclient</span> | ||
<span class="w"> </span><span class="nt">domain_admin_user</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">[email protected]</span> | ||
<span class="w"> </span><span class="nt">domain_admin_password</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">password123!</span> | ||
<span class="w"> </span><span class="nt">domain_ou_path</span><span class="p">:</span><span class="w"> </span><span class="s">"OU=Windows,OU=Servers,DC=ansible,DC=vagrant"</span> | ||
<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">domain</span> | ||
<span class="w"> </span><span class="nt">register</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">domain_state</span> | ||
|
||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">ansible.windows.win_reboot</span><span class="p">:</span> | ||
<span class="w"> </span><span class="nt">when</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">domain_state.reboot_required</span> | ||
|
||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Join host to the ansible.vagrant domain</span> | ||
<span class="w"> </span><span class="nt">ansible.windows.win_domain_membership</span><span class="p">:</span> | ||
<span class="w"> </span><span class="nt">dns_domain_name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ansible.vagrant</span> | ||
<span class="w"> </span><span class="nt">hostname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mydomainclient</span> | ||
<span class="w"> </span><span class="nt">domain_admin_user</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">[email protected]</span> | ||
<span class="w"> </span><span class="nt">domain_admin_password</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">password123!</span> | ||
<span class="w"> </span><span class="nt">domain_ou_path</span><span class="p">:</span><span class="w"> </span><span class="s">"OU=Windows,OU=Servers,DC=ansible,DC=vagrant"</span> | ||
<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">domain</span> | ||
<span class="w"> </span><span class="nt">register</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">domain_state</span> | ||
|
||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Reboot host after domain join</span> | ||
<span class="w"> </span><span class="nt">ansible.windows.win_reboot</span><span class="p">:</span> | ||
<span class="w"> </span><span class="nt">when</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">domain_state.reboot_required</span> | ||
|
||
<span class="c1"># Host should be in workgroup mywg- module will use the passed credentials to clean-unjoin domain if possible.</span> | ||
<span class="c1"># Ansible connection should use local credentials if possible.</span> | ||
<span class="c1"># The domain admin credentials can be sourced from a vault-encrypted variable</span> | ||
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">hosts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">winclient</span> | ||
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Play to set the hosts workgroup</span> | ||
<span class="w"> </span><span class="nt">hosts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">winclient</span> | ||
<span class="w"> </span><span class="nt">gather_facts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">false</span> | ||
<span class="w"> </span><span class="nt">tasks</span><span class="p">:</span> | ||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">ansible.windows.win_domain_membership</span><span class="p">:</span> | ||
<span class="w"> </span><span class="nt">workgroup_name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mywg</span> | ||
<span class="w"> </span><span class="nt">domain_admin_user</span><span class="p">:</span><span class="w"> </span><span class="s">'</span><span class="cp">{{</span> <span class="nv">win_domain_admin_user</span> <span class="cp">}}</span><span class="s">'</span> | ||
<span class="w"> </span><span class="nt">domain_admin_password</span><span class="p">:</span><span class="w"> </span><span class="s">'</span><span class="cp">{{</span> <span class="nv">win_domain_admin_password</span> <span class="cp">}}</span><span class="s">'</span> | ||
<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">workgroup</span> | ||
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Set workgroup to mywg</span> | ||
<span class="w"> </span><span class="nt">ansible.windows.win_domain_membership</span><span class="p">:</span> | ||
<span class="w"> </span><span class="nt">workgroup_name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">mywg</span> | ||
<span class="w"> </span><span class="nt">domain_admin_user</span><span class="p">:</span><span class="w"> </span><span class="s">'</span><span class="cp">{{</span> <span class="nv">win_domain_admin_user</span> <span class="cp">}}</span><span class="s">'</span> | ||
<span class="w"> </span><span class="nt">domain_admin_password</span><span class="p">:</span><span class="w"> </span><span class="s">'</span><span class="cp">{{</span> <span class="nv">win_domain_admin_password</span> <span class="cp">}}</span><span class="s">'</span> | ||
<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">workgroup</span> | ||
</pre></div> | ||
</div> | ||
</section> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.