83 lines
2.4 KiB
Markdown
83 lines
2.4 KiB
Markdown
Ansible Playbook WINDOWS OBS Setup
|
|
=====================================
|
|
|
|
Ansible Playbook to Setup a Windows 10 Enterprise Host to Stream with OBS.
|
|
|
|
## WIP
|
|
```
|
|
Obviously this is work in progress. Use at your own risk
|
|
```
|
|
|
|
Requirements
|
|
---------------
|
|
Your Windows 10 Host has the following Software Requirements bevore starting ansible usage *(based on [windows_setup.html#host-requirements](https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html#host-requirements)*:
|
|
+ PowerShell version 3.0 or newer
|
|
+ .NET Framework 4.0 or newer
|
|
|
|
This Playbook is only tested at Windows 10 Enterprise
|
|
|
|
### How to get the Version Number
|
|
|
|
#### Powershell
|
|
```ps1
|
|
# In your Powershell
|
|
Get-Host | Select-Object Version
|
|
```
|
|
|
|
#### .NET Framework
|
|
```ps1
|
|
# In your Powershell
|
|
(Get-ItemProperty "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Version
|
|
```
|
|
|
|
#### Windows Version
|
|
```ps1
|
|
# In your Powershell
|
|
(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ProductName
|
|
```
|
|
|
|
Configure Ansible Access (WinRM Setup)
|
|
----------------------------------------
|
|
|
|
### configure WinRM Access
|
|
Configure WinRM with the ``ConfigureRemotingForAnsible.ps1`` Script as described in [docs.ansible.com/ansible/latest/user_guide/windows_setup.html#winrm-setup](https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html#winrm-setup) in your WINDOWS PowerShell.
|
|
|
|
### configure ansible setup
|
|
+ add your host to the ``hosts.ini`` file.
|
|
+ add the following variables in the ``host_vars``:
|
|
```yaml
|
|
---
|
|
# host_vars/$hostname/vars.yml
|
|
ansible_connection: winrm
|
|
ansible_user: 'Windows_Admin_User'
|
|
ansible_password: 'Your_Windows_Admin_Password'
|
|
ansible_winrm_server_cert_validation: ignore
|
|
```
|
|
|
|
### validate access
|
|
After you installed the required deploy host python packages you can verify that the access is working by running the following ad-hoc command
|
|
|
|
```bash
|
|
ansible -m win_ping all
|
|
```
|
|
|
|
Ansible deploy host requirements
|
|
----------------------------------
|
|
```bash
|
|
pip install pywinrm
|
|
```
|
|
|
|
Name convention
|
|
-----------------
|
|
Use ``obs-$name`` with any name of [My little Pony villans](https://villains.fandom.com/wiki/Category:My_Little_Pony_Villains).
|
|
|
|
Ad-hoc copy file example:
|
|
----------------------------
|
|
```bash
|
|
# create C:\media\
|
|
ansible -m ansible.windows.win_file -a "path='C:\media' state=directory" all
|
|
|
|
# copy file
|
|
ansible -m ansible.windows.win_copy -a "src=/tmp/copy.txt dest='C:\media\copy.txt'" all
|
|
```
|