Page:
Playbook for Windows Domain User
Pages
Ansible Configuration
Configure Linux Nodes
Configure Window Nodes
Configuring an AD Sudo Group
DFS01 DFS02 Basic Config
DHCPD Configuration
Docker Configuration
Final
GPO DFS Based Profiles & Home Directories
GPO Remote Desktop
GPO Wallpaper
Home
Mgmt02 sparkle configuration
Milestone 1
Milestone 2
Network Diagrams
Playbook for Linux Users
Playbook for Windows Domain User
RVTM
Redundant ADDS Config
Redundant DFS Setup
System Infrastructure and Assignments
System Infrastructure
Util Configuration
W1 Milestone 1
W2 Milestone 1
Who did what
dhcp1 razzle configuration
dhcp2 dazzle configuration
No results
12
Playbook for Windows Domain User
Hannelore Sanokklis edited this page 2024-04-27 18:56:51 -04:00
Ping windows hosts
- Before you make your playbook, make sure you can successfully your windows hosts with win_ping. I find that before you put a lot of work into creating a playbook and running it, it's always good to make sure you can reach your hosts via ssh.
Troubleshooting tip for Windows SSH:
- If you are getting an error saying that ansible cannot create a temporary directory, then add the code below into your host file.
[windows:vars] remote_tmp = C:\Users\ans_user\Tmp become_method = runas ansible_shell_type = powershell shell_type = powershellLink: https://devops.stackexchange.com/questions/16532/ansible-playbook-fails-on-windows-server
Install microsoft.ad module
- Check to see if you have the
microsoft.admodule installedansible-galaxy collection list
- If not, then install it via:
ansible-galaxy collection install microsoft.ad
Reference Link: https://docs.ansible.com/ansible/latest/collections/microsoft/ad/object_module.html
Make Playbook
- Make
windows_domain_user.ymlfile in theansibledirectory.
---
- name: Create a new domain user
hosts: dc01-sparkle
tasks:
- name: Ensure user is created
microsoft.ad.user:
identity: sparkle-daemon
firstname: sparkle-daemon
surname: feet
password: user_password
enabled: yes
state: present
#For verificaiton of authorized user to create account
domain_username: ansible
domain_password: domain_password
domain_server: dc01-sparkle.sparkle.local
Link Referenced: https://docs.ansible.com/ansible/latest/collections/microsoft/ad/user_module.html#ansible-collections-microsoft-ad-user-module
Run Playbook
ansible-playbook -u sparkle-deployer -i windows_hosts.txt windows_domain_user.yml --ask-pass
Check User by AD
Check User by SSH
ssh sparkle-daemon@mgmt01-sparkle- input the password you configured in your
.ymlfile