Ansible安装配置

一、前提

服务器操作系统均为centos7.9

|--------------------|---------------|
| 主机 | ip |
| master(Ansible管理端) | 172.25.192.2 |
| node1 | 172.25.192.10 |
| node2 | 172.25.192.3 |

更新/etc/hosts文件

二、安装

master节点:

  1. 安装epel源

    yum install -y epel-release

  2. 安装Ansible

    yum install -y ansible

Ansible目录结构

/etc/ansible/

├── ansible.cfg # Ansible的主配置文件

├── hosts # Ansible的主机清单文件,包含要管理的远程主机信息

└── roles/ # 存放Ansible的角色(Role)的目录,用于组织Playbook

  1. 配置

(1)配置主机清单hosts

或者写ip地址

(2)配置ssh免密登录

  1. 测试配置
相关推荐
ghostwritten6 小时前
RHEL 9.5 离线安装 Ansible 完整教程
ansible·redhat
IT成长日记13 小时前
【自动化运维神器Ansible】Ansible常用模块之user模块详解
运维·自动化·ansible·user·常用模块
求知若渴,虚心若愚。13 小时前
ansible简单playbook剧本例子3-安装nginx
服务器·nginx·ansible
菜萝卜子1 天前
【Zabbix】Ansible批量部署ZabbixAgent
ansible·zabbix
Asuicao1 天前
ansible巡检脚本
linux·运维·ansible
求知若渴,虚心若愚。2 天前
ansible 使用更高版本的python版本
ansible
IT成长日记2 天前
【自动化运维神器Ansible】Ansible常用模块之hostname模块详解
运维·自动化·ansible·hostname·常用模块
IT成长日记2 天前
【自动化运维神器Ansible】Ansible常用模块之cron模块详解
运维·自动化·ansible·cron·cron模块·常用模块
Insist7532 天前
linux系统----Ansible中的playbook简单应用
ansible
求知若渴,虚心若愚。4 天前
Error reading config file (/home/ansible.cfg): ‘ACTION_WARNINGS(default) = True
linux·前端·ansible