ansible——ansible的安装

配置yum的epel源

bash 复制代码
[root@control ~]# yum -y install epel-release.noarch 
[root@control ~]# yum repolist
repo id                               repo name
appstream                             Rocky Linux 9 - AppStream
baseos                                Rocky Linux 9 - BaseOS
epel                                  Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264                   Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
extras                                Rocky Linux 9 - Extras

安装ansible

bash 复制代码
[root@control ~]# yum -y install ansible
[root@control ~]# ansible --version
ansible [core 2.14.9]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.18 (main, Sep  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

配置hosts文件

bash 复制代码
[root@control ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
 192.168.100.136 control
192.168.100.137 manage1
192.168.100.138 manage2
192.168.100.139 manage3

配置免密登录

bash 复制代码
[root@control ~]# ssh-keygen 
[root@control ~]# ssh-copy-id manage1
[root@control ~]# ssh-copy-id manage2
[root@control ~]# ssh-copy-id manage3
相关推荐
Avan_菜菜5 小时前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
Sokach101513 小时前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
SelectDB1 天前
Litefuse 开源并推出单进程轻量模式,25 秒就能跑起来的 Agent 可观测与评估平台
运维·后端·自动化运维
AlfredZhao1 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3103 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode3 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220703 天前
如何搭建本地yum源(上)
运维
A小辣椒4 天前
TShark:Wireshark CLI 功能
linux
A小辣椒5 天前
TShark:基础知识
linux
AlfredZhao5 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci