Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Use Ansible to Manage Windows Servers (SSH | port 22) - Step by Step Guide

Автор: LondonIAC / Dennis McCarthy / Automation Engineer

Загружено: 2022-06-10

Просмотров: 12039

Описание:

** To manage Windows Servers using winrm:    • Learn How to Use Ansible to Manage Windows...   ""

* Issue - During the OpenSSH install, the original command was failing. I've added the updated command below so it the command fails, try the new command. - **

For this demo, we’re going to complete the following steps:

• Install SSH
• Configure Ansible to connect on port 22 to our Windows 2022 server
• Test the Ansible CLI works
• Create a playbook and test that work.

Chapters:
Build a Windows 2022 server in AWS:    • Use Ansible to Manage Windows Servers (SSH...  
Add port 22/SSH to the security group:    • Use Ansible to Manage Windows Servers (SSH...  
RDP onto the remote Windows 2022 server:    • Use Ansible to Manage Windows Servers (SSH...  
Install OpenSSH on our Windows 2022 server:    • Use Ansible to Manage Windows Servers (SSH...  
SSH onto the Windows 2022 server from Linux:    • Use Ansible to Manage Windows Servers (SSH...  
Setup Ansible to connect to our Windows 2022 server:    • Use Ansible to Manage Windows Servers (SSH...  
Check Ansible connectivity using win_ping:    • Use Ansible to Manage Windows Servers (SSH...  
Setup a playbook to run on our Windows 2022 server:    • Use Ansible to Manage Windows Servers (SSH...  
Use Ansible to install Apache:    • Use Ansible to Manage Windows Servers (SSH...  

#######################
Windows server commands:
Below are the commands I ran in this turorial:

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

**--------------
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Alternatively use this command to install:
dism /Online /Add-Capability /CapabilityName:OpenSSH.Server~~~~0.0.1.0
**------------

Start-Service sshd

Set-Service -Name sshd -StartupType 'Automatic'

if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
} else {
Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
}
############################
Create the hosts.ini file:

[ec2-user@ip-172-31-16-55 windows]$ cat hosts.ini
[win]
IP_ADDRESS

[win:vars]
ansible_user=Administrator
ansible_password=
ansible_connection=ssh
ansible_shell_type=cmd
ansible_ssh_common_args=-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
ansible_ssh_retries=3
ansible_become_method=runas

Run win_ping:

$ ansible win -m win_ping

Now Setup the Playbook:

---
hosts: win
gather_facts: no
tasks:
name: test powershell
win_shell: |
get-host
register: result_get_host

name: display result_get_host
debug:
var: result_get_host

Run the playbook:

$ ansible-playbook -i hosts.ini win_ssh.yml

Next Add the installation of Apache to your playbook:

name: add directory
win_file:
path: C:\ansible_examples
state: directory

name: Download the Apache installer
win_get_url:
url: https://archive.apache.org/dist/httpd...
dest: C:\ansible_examples\httpd-2.2.25-win32-x86-no_ssl.msi
force: true

name: Install MSI
win_package:
path: C:\ansible_examples\httpd-2.2.25-win32-x86-no_ssl.msi
state: present

Now run the playbook again and check Apache is installed

Thanks for watching. I hope this helps some of you to get this working!

A subscribe and a like are always appreciated.

#ansible #windows #ssh

Use Ansible to Manage Windows Servers (SSH | port 22) - Step by Step Guide

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Hashicorp Packer: Build a Windows server in AWS and manage with Ansible

Hashicorp Packer: Build a Windows server in AWS and manage with Ansible

Encrypting Files with Ansible Vault

Encrypting Files with Ansible Vault

SSH для Windows с использованием открытого ключа

SSH для Windows с использованием открытого ключа

WinRM vs. OpenSSH: A Showdown for PowerShell Remoting by Paul Broadwith

WinRM vs. OpenSSH: A Showdown for PowerShell Remoting by Paul Broadwith

Live Stream - Use Ansible to manage Windows server

Live Stream - Use Ansible to manage Windows server

Что такое TCP/IP: Объясняем на пальцах

Что такое TCP/IP: Объясняем на пальцах

Чем ОПАСЕН МАХ? Разбор приложения специалистом по кибер безопасности

Чем ОПАСЕН МАХ? Разбор приложения специалистом по кибер безопасности

Step-by-Step Ansible Tutorial for Windows Server 2022: Optimizing WinRM

Step-by-Step Ansible Tutorial for Windows Server 2022: Optimizing WinRM

Ansible 101: For the Windows SysAdmin by Josh King

Ansible 101: For the Windows SysAdmin by Josh King

Getting started with Ansible 14 - Roles

Getting started with Ansible 14 - Roles

РОУТЕР С VPN за 1200₽ | OpenWRT + Podkop + Amnezia | Полный Гайд на Xiaomi 4С

РОУТЕР С VPN за 1200₽ | OpenWRT + Podkop + Amnezia | Полный Гайд на Xiaomi 4С

The FASTEST Way to Manage Windows Server 2025 Using SSH and Ansible

The FASTEST Way to Manage Windows Server 2025 Using SSH and Ansible

Автоматизируйте ВСЁ с помощью Ansible! (Ansible для начинающих)

Автоматизируйте ВСЁ с помощью Ansible! (Ansible для начинающих)

Освойте Ansible Playbooks в Unix и Windows! Пошаговое руководство по автоматизации

Освойте Ansible Playbooks в Unix и Windows! Пошаговое руководство по автоматизации

Kubernetes — Простым Языком на Понятном Примере

Kubernetes — Простым Языком на Понятном Примере

⚡️ЛИПСИЦ & ШЕЙТЕЛЬМАН: ГОЛОДНЫЕ БУНТЫ накрыли РФ! ДАЛЬШЕ – ХУЖЕ. КИТАЙ ЭКСТРЕННО ОБРАТИЛСЯ по войне

⚡️ЛИПСИЦ & ШЕЙТЕЛЬМАН: ГОЛОДНЫЕ БУНТЫ накрыли РФ! ДАЛЬШЕ – ХУЖЕ. КИТАЙ ЭКСТРЕННО ОБРАТИЛСЯ по войне

Настройте Windows Host для Ansible - ansible WinRM

Настройте Windows Host для Ansible - ansible WinRM

КАК УСТРОЕН TCP/IP?

КАК УСТРОЕН TCP/IP?

😳Раскопали ТАКОЕ о ТРАМПЕ, что никто не ждал! ЖУТКИЙ СЛИВ поднял ВАШИНГТОН. Послушайте! ФЕЙГИН

😳Раскопали ТАКОЕ о ТРАМПЕ, что никто не ждал! ЖУТКИЙ СЛИВ поднял ВАШИНГТОН. Послушайте! ФЕЙГИН

Ansible для Windows — простая настройка!

Ansible для Windows — простая настройка!

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]