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
--- | |
- hosts: all | |
tasks: | |
- name: Create JAVA_HOME Environment Variable for all users | |
win_environment: | |
state: present | |
name: JAVA_HOME | |
value: 'C:\_jdk12.0' | |
level: machine |
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
--- | |
- hosts: all | |
tasks: | |
- name: Set TimeZone to GMT | |
win_timezone: | |
timezone: GMT Standard Time |
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
--- | |
- hosts: all | |
tasks: | |
- name: Get-Processes via command module | |
command: pwsh -Command "Get-Process | ConvertTo-Json" | |
register: processData | |
- name: Process output | |
set_fact: |
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
--- | |
- hosts: all | |
tasks: | |
- name: Create new local group | |
win_group: | |
name: test_users | |
description: Test Users | |
state: present |
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
--- | |
- hosts: all | |
tasks: | |
- name: Create new local account | |
win_user: | |
name: "{{ local_account_username }}" | |
fullname: "{{ local_account_fullname }}" | |
password: "{{ local_account_password }}" | |
state: present |
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
# Input Configuration | |
fields: | |
- id: local_account_username | |
type: string | |
label: local_account_username | |
- id: local_account_fullname | |
type: string | |
label: local_account_fullname | |
- id: local_account_password | |
type: string |
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
- name: Ensure user bob is present | |
win_user: | |
name: bob | |
password: B0bP4ssw0rd | |
state: present | |
groups: | |
- Users |
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
--- | |
- hosts: all | |
tasks: | |
- name: Get disk facts | |
win_disk_facts: | |
- name: Initialize Disk | |
win_shell: "Initialize-Disk -Number {{ disk_number }}" | |
when: ansible_disks[disk_number].guid is none |
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
--- | |
- hosts: all | |
tasks: | |
- name: Reboot VM | |
win_reboot: | |
- name: Wait default 300 seconds for port 3389 to become open, don't start checking for 15 seconds | |
win_wait_for: | |
port: 3389 |
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
--- | |
- hosts: all | |
tasks: | |
- name: Powershell | Install Required Powershell Modules | |
win_psmodule: | |
name: xActiveDirectory | |
state: present | |
- name: Create Test Account |