安装和配置 Ansible

安装和配置 Ansible

按照下方所述,在控制节点 control.area12.example.com 上安装和配置 Ansible:

安装所需的软件包

创建名为 /home/curtis/ansible/inventory 的静态清单文件,以满足以下要求:

node1 是 dev 主机组的成员

node2 是 test 主机组的成员

node3 和 node4 是 prod 主机组的成员

node5 是 balancers 主机组的成员

prod 组是 webservers 主机组的成员

创建名为 /home/curtis/ansible/ansible.cfg 的配置文件,以满足以下要求:

主机清单文件为 /home/curtis/ansible/inventory

playbook 中使用的角色的位置包括 /home/curtis/ansible/roles

mkdir ansible
cd ansible

vim inventory
[dev]
node1
[test]
node2
[prod]
node3
node4
[balancers]
node5
[webservers:children]
prod

vim ansible.cfg
[defaults]
inventory=inventory
remote_user=curtis
roles_path=/home/curtis/ansible/roles
ask_pass=False
[privilege_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=False
ansible all -m ping
相关推荐
一切皆文件linux1 天前
网站集群批量管理-密钥认证与Ansible模块
ansible
让美好继续发生2 天前
ansible学习
学习·ansible
有谁看见我的剑了?3 天前
ansible学习之 Facts
ansible
peanutfish3 天前
Chapter 4 RH294 RHEL Automation with Ansible
linux·ansible·yaml
henan程序媛3 天前
jenkins项目发布基础
运维·gitlab·ansible·jenkins
pyliumy5 天前
ansible 配置
大数据·ansible
运维小白。。5 天前
自动化运维工具 Ansible
运维·自动化·ansible
weixin_438197385 天前
ansible之playbook\shell\script模块远程自动安装nginx
linux·服务器·ansible
peanutfish5 天前
Chapter 5 RH294 RHEL Automation with Ansible
linux·ansible·yaml
人类群星闪耀时6 天前
自动化运维的利器:Ansible、Puppet和Chef详解
运维·自动化·ansible