【Windows】【DevOps】Windows Server 2022 安装ansible,基于powershell实现远程自动化运维部署 入门到放弃!

目标服务器安装openssh server参考

【Windows】【DevOps】Windows Server 2022 在线/离线 安装openssh实现ssh远程登陆powershell、scp文件拷贝-CSDN博客

注意:Ansible不支持Windows操作系统部署

根据官方说明:

Windows Frequently Asked Questions — Ansible Community Documentation

Can Ansible run on Windows?

No, Ansible can only manage Windows hosts. Ansible cannot run on a Windows host natively, though it can run under the Windows Subsystem for Linux (WSL).

Note

The Windows Subsystem for Linux is not supported by Ansible and should not be used for production systems.

基于Cygwin安装Ansbile

参考以下内容

Install Ansible on Windows Using Cygwin

Cygwin is a POSIX-compatible environment that lets you run tools and code designed for Unix-like operating systems on Microsoft Windows.

To install Ansible on Windows using Cygwin, follow these steps:

1. Download the Cygwin installation file. This file is compatible with both the 32-bit and 64-bit versions of Windows. It automatically installs the right version for your system.

2. Double-click the downloaded file to run it. On the welcome screen, click Next to continue.

Cygwin setup welcome screen.

3. Select Install from Internet as the download source and click Next.

Choose Cygwin download source.

4. In the Root Directory field, specify where you want the application installed, then click Next.

Select the root installation directory for Cygwin.

5. In the Local Package Directory field, select where you want to install your Cygwin packages, then click Next.

Cygwin setup - select the local package directory.

6. Choose the appropriate Internet connection option. If you are not using a proxy, select Direct Connection. Otherwise, select Use System Proxy Settings or enter the proxy settings manually with the Use HTTP/FTP Proxy. Click Next to continue.

Select internet connection type for Cygwin setup.

7. Choose one of the available mirrors to download the installation files, then click Next.

Select download mirror for Cygwin.

8. On the Select Packages screen, type ansible in the search bar and press Enter to perform the search. Expand the Admin and Doc categories and double-click the ansible and ansible-doc files to select them.

Click Next to install the packages.

Select which Ansible packages to install.

9. The next screen lets you review the installation settings. To confirm and begin the installation process, click Next.

Review Cygwin installation.

The install wizard downloads and installs all the selected packages, including Ansible.

10. Once the installation is complete, select whether you want to add a Cygwin desktop and the Start Menu icon. Click Finish to close the wizard.

Finish the installation

验证安装

配置/etc/ansible/hosts

[server]
服务器ip  ansible_ssh_user=服务器用户名 ansible_ssh_pass=服务器用户密码

ansible ping(windows版本openssh 有兼容问题!)

直接拿linux主机测试ansible连接windows server上的openssh(乱码!)

严重怀疑其兼容性!

ansible+winrm

Windows Remote Management — Ansible Community Documentation

先使用linux系统测试验证

yum install ansible python3-pywinrm

各种故障,放弃!

基于WSL安装ansible(失败)

管理员权限启动powershell

安装WSL

wsl --install
PS C:\Windows\system32> wsl -l -o
PS C:\Windows\system32>

wsl指令没有列出可用的镜像!

参考资料

How to Install Ansible on Windows {3 Methods Explained} (phoenixnap.com)

在 Windows Server 上安装 Linux 子系统 | Microsoft Learn

直接安装python3+ansible(失败):

控制节点安装python3

下载页:https://www.python.org/downloads/windows/
文件URL:https://www.python.org/ftp/python/3.13.0/python-3.13.0-amd64.exe

图形界面安装python3

验证安装

打开powershell,验证版本

控制节点安装ansible

提前关闭 病毒和威胁防护的实时保护

pip install -vvv ansible -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com --default-timeout=100

安装过程比较缓慢(相对Linux来说,可能是Hyper-V主机内CPU调度问题)

安装完成

故障

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/890542.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

如何使用IntelliJ IDEA生成UML图

🏝️ 博主介绍 大家好,我是一个搬砖的农民工,很高兴认识大家 😊 ~ 👨‍🎓 个人介绍:本人是一名后端Java开发工程师,坐标北京 ~ 🎉 感谢关注 📖 一起学习 &…

WPF 为button动态设置不同的模板

有时候需要动态的设置一些按钮的状态模板。使一个button显示不同的内容,比如Button未点击安装显示: 安装后显示: 可以通过设置button的content,通过content来设置不同的模板来实现功能,以下是代码: MainWi…

QD1-P5 HTML 段落标签(p)换行标签(br)

本节视频 www.bilibili.com/video/BV1n64y1U7oj?p5 ‍ 本节学习 HTML 标签&#xff1a; p标签 段落br标签 换行 ‍ 一、p 标签-段落 1.1 使用 p 标签划分段落 <p>段落文本</p>示例 <!DOCTYPE html> <html><head><meta charset"…

79 NAT-NAT444端口块静态映射

NAT444&#xff08;Network Address Translation 444&#xff09;是一种网络地址转换技术&#xff0c;用于将私有IP地址转换为公有IP地址&#xff0c;实现私有网络与公有网络之间的通信。 端口块静态映射是NAT444中的一种映射方式&#xff0c;它将一组端口范围映射到一个公有I…

【D3.js in Action 3 精译_034】4.1 D3 中的坐标轴的创建(中一)

当前内容所在位置&#xff08;可进入专栏查看其他译好的章节内容&#xff09; 第一部分 D3.js 基础知识 第一章 D3.js 简介&#xff08;已完结&#xff09; 1.1 何为 D3.js&#xff1f;1.2 D3 生态系统——入门须知1.3 数据可视化最佳实践&#xff08;上&#xff09;1.3 数据可…

MPA-SVM多变量回归预测|海洋捕食者优化算法-支持向量机|Matalb

目录 一、程序及算法内容介绍&#xff1a; 基本内容&#xff1a; 亮点与优势&#xff1a; 二、实际运行效果&#xff1a; 三、算法介绍&#xff1a; 四、完整程序下载&#xff1a; 一、程序及算法内容介绍&#xff1a; 基本内容&#xff1a; 本代码基于Matlab平台编译&am…

Node.js概述

1. Node.js简介 Node.js是一个基于Chrome V8引擎的JavaScript运行环境。 地址&#xff1a;Node.js 中文网 1.1 Node.js中的JavaScript运行环境 &#xff08;1&#xff09;浏览器是JavaScript的前端运行环境 &#xff08;2&#xff09;Node.js是JavaScript的后端运行环境 …

2.使用 Label Studio 标注文本

使用 Label Studio 标注文本 文章目录 使用 Label Studio 标注文本前言Label Studio的简单使用1.创建项目2.添加本地存储3.选择标注模板4.添加数据5.标注6.添加关系 总结 前言 Label Studio是一个开源的功能强大的标注平台&#xff0c;可以标注视频&#xff0c;图片&#xff0…

Ubuntu终端配置

选择shell shell有很多&#xff0c;默认的是bash&#xff0c;一般就够用里&#xff0c;想要花里胡哨点就用zsh&#xff0c;还有最近比较火的fish 如果在刚开始安装完Ubuntu没有改shell&#xff0c;后面就不要改了。 安装的软件会设置环境变量&#xff0c;这些环境变量都是写入…

RocketMq详解:三、RocketMq通用生产和消费方法改造

文章目录 1.背景2.通用方法改造2.1添加maven依赖2.2 RocketMq基础配置2.3 配置类2.5 消息传输的对象和结果2.4 消息生产者2.5 消息消费者2.6 功能测试 1.背景 在第二章&#xff1a;《RocketMq详解&#xff1a;二、SpringBoot集成RocketMq》中我们已经实现了消费基本生产和消费…

动态规划-多状态问题——740.删除获得点数

1.题目解析 题目来源&#xff1a;740.删除并获得点数——力扣 测试用例 2.算法原理 首先将原数组根据每个数映射为下标&#xff0c;相加后存储在以该数本身为下标的新数组中 1.状态表示 这里与路径问题不同的是每个位置都不止一个状态&#xff0c;因此开辟两个dp表&#xff0…

Unity URP shader ———魔系符文宝石是如何练成的

各位同学大家好 我已经很久没有没有写教程了&#xff0c;最近项目比较忙。各种加班各种带小孩儿&#xff0c;不过&#xff0c;老师一有机会也在给尽可能服务大家&#xff0c;今天来一个硬菜&#xff1a;移动端高效魔系符文如何制作&#xff0c;国庆起来&#xff0c;老师抽了点…

六西格玛设计DFSS方法论在消费级无人机设计中的应用——张驰咨询

本文基于六西格玛设计方法论&#xff0c;对消费级无人机的设计流程进行系统化研究&#xff0c;探讨如何通过六西格玛设计的理念、工具和方法提升无人机产品的设计质量和市场竞争力。文章从市场定位、客户需求分析出发&#xff0c;深入到关键KPI指标的制定&#xff0c;并逐步阐述…

vulnhub-Web Developer 1靶机

vulnhub&#xff1a;Web Developer: 1 ~ VulnHub 导入靶机&#xff0c;放在kali同网段&#xff0c;扫描 靶机在192.168.114.129&#xff0c;扫描端口 有网站服务&#xff0c;访问 没什么东西&#xff0c;扫目录 真不少&#xff0c;访问一下&#xff0c;也只是一些普通的Wordpr…

滑雪——记忆化搜索

题目 代码 //#pragma GCC optimize(3)#include <bits/stdc.h> const int N 310; using namespace std; int dx[4] {-1, 0, 1, 0}, dy[4] {0, 1, 0, -1}; int ans; int g[N][N]; int r, c; int f[N][N]; int dfs(int x, int y) {if(~f[x][y]) return f[x][y];f[x][y] …

【JavaSE基础】Java 变量

为什么需要变量 变量是程序的基本组成单位 class Test{public static void main(String[] args){int a 1; //定义一个变量&#xff0c;类型为int&#xff0c;变量名为a&#xff0c;并赋值为1int b 3; //定义另一个变量&#xff0c;类型为int&#xff0c;变量名为b&#xff0…

2-120 基于matlab的滑动平均滤波下通过幅度谱最大值方法估计太阳黑子的周期

基于matlab的滑动平均滤波下通过幅度谱最大值方法估计太阳黑子的周期。具体步骤为&#xff1a;1&#xff09;在Matlab 环境下读取太阳黑子数目序列&#xff0c;并绘制其时域波形&#xff1b; 2&#xff09;采用离散时间卷积计算方法对太阳黑子数据序列进行滑动平均滤波&#xf…

vue后台管理系统从0到1搭建(4)各组件的搭建

文章目录 vue后台管理系统从0到1搭建&#xff08;4&#xff09;各组件的搭建Main.vue 组件的初构 vue后台管理系统从0到1搭建&#xff08;4&#xff09;各组件的搭建 Main.vue 组件的初构 根据我们的效果来看&#xff0c;分析一下&#xff0c;我们把左边的区域分为一个组件&am…

前端的全栈之路:基于 Vue3 + Nest.js 全栈开发的后台应用

☘️ 项目简介 Vue3 Admin 是一个前端基于 Soybean Admin 二次开发&#xff0c;后端基于 Nest.js 的全栈后台应用&#xff0c;适合学习全栈开发的同学参考学习。 &#x1f341; 前端技术栈&#xff1a; Vue3.5、Ant Design Vue、UnoCSS、Pinia &#x1f341; 后端技术栈&…

【浏览器】如何正确使用Microsoft Edge

1、清理主页广告 如今的Microsoft Edge 浏览器 主页太乱了&#xff0c;各种广告推送&#xff0c;点右上角⚙️设置&#xff0c;把快速链接、网站导航、信息提要、背景等全部关闭。这样你就能得到一个超级清爽的主页。 网站导航       关闭 …