In this blog post, I will show you how to create a local group and two local users with Ansible on a Windows server host.
Before you start
To get this playbook working, you will need to add you Windows host to Ansible and setup a Linux control host.
You can you the following post which explains everything.
Below is the playbook that makes everything happen; I am creating a local group called DBA_USERS and two local users called dba01 and dba02.
– hosts: windows
– name: Create local group
description: DBA user group
– name: dba01
– name: dba02
To run the playbook, I will run the following command and wait for the results.
You can see the final result below, Ansible created two users and placed them inside the DBA_USERS group we created.