ansible_playbook_windows_ob.../README.md

92 lines
3.3 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.
2023-09-18 23:12:28 +02:00
**WORK IN PROGRESS** -> *This version of the ansible playbook is not designed to deploy an productive winkekatze.tv setup. For productive Setups please have a look at [our releases](https://git.l3d.ch/voc/ansible_playbook_windows_obs_setup/releases).*
2024-02-21 00:45:21 +01:00
Next Release will be for "Winterkongress 2024"
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
----------------
2023-09-17 22:16:12 +02:00
Make Sure you have the latest version of ansible installed. And all git submodules are checked out and at the latest version.
```bash
2023-09-17 22:16:12 +02:00
python3 -m venv ansible
source ansible/bin/activate
pip install ansible
2022-12-29 00:41:49 +01:00
```
2023-09-17 22:16:12 +02:00
Install sshpass fo SSH with Passwords to windows via ansible
2022-12-29 00:41:49 +01:00
```bash
sudo apt install sshpass
```
Configure Ansible Access (Windows SSH Server Setup)
2021-12-13 23:10:38 +01:00
----------------------------------------
2022-12-29 04:34:53 +01:00
Have a look at the [official Ansible Docs](https://docs.ansible.com/ansible/latest/os_guide/windows_setup.html#windows-ssh-setup) and install [OpenSSH Server](https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=powershell) on Windows or WinRM by running the [ConfigureRemotingForAnsible.ps1](https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1) script.
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
2023-09-17 22:16:12 +02:00
ansible -m ansible.builtin.win_ping all
2021-12-13 23:10:38 +01:00
```
Windows Installation
----------------------
2023-09-17 22:16:12 +02:00
There is a prepared [autounattend.xml](win10_setup/autounattend.xml) to automate the windows installation, that will create an ``setup`` User.
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
```
2023-09-17 22:16:12 +02:00
Questions
-----------
Feel free to aks. For example by writing a message to ``video <at> winkekatze.tv``.