ansible文档:Installing Ansible — Ansible Community Documentation
Kubernetes(K8S)简介和安装部署详细教程_kubernetes安装部署-CSDN博客
- 主控端安装
sudo apt update
sudo apt install ansible -y
ansible --version
输出类似这样的说明安装成功了:
ansible [core 2.x.x]
config file = /etc/ansible/ansible.cfg
...
添加被控节点:vi /etc/ansible/hosts
[web_servers]
192.168.2.111
192.168.2.112
测试连接
使用 ping
模块测试与被管理节点的连通性(需提前配置 SSH 免密登录):
ansible all -m ping
root@k8s111:/home/k8s# apt update -y
Ign:1 cdrom://[Debian GNU/Linux 12.11.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250517-09:52] bookworm InRelease
Err:2 cdrom://[Debian GNU/Linux 12.11.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250517-09:52] bookworm Release
Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Reading package lists... Done
E: The repository 'cdrom://[Debian GNU/Linux 12.11.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250517-09:52] bookworm Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
换成腾讯源之后,还是报:
E: The repository 'http://mirrors.cloud.tencent.com/debian-security bookworm/updates Release' does not have a Release file.
正文完
发表至: 分享
六天前