Skip to content

Instantly share code, notes, and snippets.

View jonathanmedd's full-sized avatar

Jonathan Medd jonathanmedd

View GitHub Profile
@jonathanmedd
jonathanmedd / _12_environment_variables.yml
Created December 6, 2019 11:24
_12_environment_variables
---
- 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
@jonathanmedd
jonathanmedd / _11_timezone.yml
Created December 5, 2019 16:13
_11_timezone
---
- hosts: all
tasks:
- name: Set TimeZone to GMT
win_timezone:
timezone: GMT Standard Time
@jonathanmedd
jonathanmedd / local_pwsh.yml
Created December 5, 2019 14:22
local_pwsh
---
- hosts: all
tasks:
- name: Get-Processes via command module
command: pwsh -Command "Get-Process | ConvertTo-Json"
register: processData
- name: Process output
set_fact:
@jonathanmedd
jonathanmedd / _10_local_groups.yml
Created December 2, 2019 16:23
_10_local_groups
---
- hosts: all
tasks:
- name: Create new local group
win_group:
name: test_users
description: Test Users
state: present
@jonathanmedd
jonathanmedd / _9_local_users.yml
Created December 2, 2019 15:27
_9_local_users
---
- hosts: all
tasks:
- name: Create new local account
win_user:
name: "{{ local_account_username }}"
fullname: "{{ local_account_fullname }}"
password: "{{ local_account_password }}"
state: present
@jonathanmedd
jonathanmedd / local_account_credential_type.yml
Created December 2, 2019 15:18
local_account_credential_type
# 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
@jonathanmedd
jonathanmedd / win_user_hardcoded_password.yml
Created December 2, 2019 15:06
win_user_hardcoded_password
- name: Ensure user bob is present
win_user:
name: bob
password: B0bP4ssw0rd
state: present
groups:
- Users
@jonathanmedd
jonathanmedd / _8_initialize-partition-format-disk.yml
Created November 28, 2019 17:17
_8_initialize-partition-format-disk.yml
---
- 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
@jonathanmedd
jonathanmedd / _7_reboot_and_wait.yml
Created November 8, 2019 19:44
_7_reboot_and_wait.yml
---
- 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
@jonathanmedd
jonathanmedd / _6_invoke-dsc.yml
Created October 23, 2019 16:19
_6_invoke-dsc.yml
---
- hosts: all
tasks:
- name: Powershell | Install Required Powershell Modules
win_psmodule:
name: xActiveDirectory
state: present
- name: Create Test Account