2025年5月10日

ansible实例

摘要: 示例: 单个模块使用 ansible all -a ‘ifconfig’ ansible all -m shell -a "echo qwer1234|passwd --stdin root" ansible all -m shell -a 'cat /etc/fstab|grep -Ev "^#| 阅读全文

posted @ 2025-05-10 17:55 赛博狗尾草 阅读(20) 评论(0) 推荐(0)

ansible剧本知识

摘要: playbook的基础组件: Hosts:运行指定任务的目标主机; remoute_user:在远程主机上执行任务的用户; sudo_user: tasks:任务列表 模块,模块参数; 格式: (1)action: module arguments (2)module: arguments 注意:s 阅读全文

posted @ 2025-05-10 17:53 赛博狗尾草 阅读(22) 评论(0) 推荐(0)

ansible基础

摘要: 特点: 模块化:调用特定的模块,完成特定任务; 基于Python语言实现,由Paramiko,PyYAML和Jinja2三个关键模块; 部署简单:agentless; 支持自定义模块; 支持playbook; 安装: 需要epel源 一个可用的epel源 cat /etc/yum.repos.d/c 阅读全文

posted @ 2025-05-10 17:51 赛博狗尾草 阅读(18) 评论(0) 推荐(0)

导航