ansible_playbook_windows_ob.../README.md

94 lines
2.8 KiB
Markdown
Raw Normal View History

2021-12-13 22:14:34 +01:00
Ansible Playbook WINDOWS OBS Setup
=====================================
Ansible Playbook to Setup a Windows 10 Enterprise Host to Stream with OBS.
2022-12-27 22:38:10 +01:00
**WINTERCONGRESS 2023 Edition** -> *This version of the ansible playbook is designed deploy the winkekatze.tv setup for Winterkongress 2023!*
2021-12-13 22:30:10 +01:00
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
2022-12-27 21:36:35 +01:00
### How to get the Version Numbers
2021-12-13 22:30:10 +01:00
#### 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
2021-12-13 23:10:38 +01:00
(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ProductName
2021-12-13 22:30:10 +01:00
```
2021-12-13 23:10:38 +01:00
2022-12-27 21:36:35 +01:00
Set up this git Repository
----------------------------
+ Clone this git repo
+ Check out all [Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) e.G. with ``git submodule update --init --recursive``
+ Configure git to always update submodules on pull: ``git config submodule.recurse true``
Set up Ansible
----------------
2022-12-29 00:41:49 +01:00
Ansible Requirements
```bash
ansible-galaxy install -r requirements.yml
2022-12-29 00:41:49 +01:00
```
And PyWinRM Python mdule
```bash
pip3 install pywinrm
```
2021-12-13 23:10:38 +01:00
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.
2022-12-29 00:41:49 +01:00
### configure ansible setup for new hosts
2021-12-13 23:10:38 +01:00
+ add your host to the ``hosts.ini`` file.
+ add the following variables in the ``host_vars``:
2022-12-29 00:41:49 +01:00
2021-12-13 23:10:38 +01:00
```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
```
2022-12-29 00:41:49 +01:00
Gopass Passwords
------------------
- Make sure you have [gopass](https://gopass.pw) installed
- Checkout the gopass repo and mount in to ``chvoc``.
### 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
2021-12-13 23:10:38 +01:00
```
2021-12-21 16:30:39 +01:00
Ad-hoc copy file example:
----------------------------
```bash
2021-12-22 14:07:45 +01:00
# create C:\media\
ansible -m ansible.windows.win_file -a "path='C:\media' state=directory" all
2021-12-21 16:30:39 +01:00
2021-12-22 14:07:45 +01:00
# copy file
ansible -m ansible.windows.win_copy -a "src=/tmp/copy.txt dest='C:\media\copy.txt'" all
```