ansible 关键字
摘要:ad-hoc:临时命令 示例:ansible groups -m command -a ' df -h' register: task执行的任务结果存储在某个变量中,便于后续引用。 facts:用来自动采集“被控主机”自身状态信息。 when条件语句:针对task任务判断 tag:指定playboo
阅读全文
ansible 发布服务
摘要:安装git yum install -y git
阅读全文
ansible模块 playbook
摘要:推荐原生模块:大部分幂等性,能重复执行。 常看所有模块:3k个 https://docs.ansible.com/ansible/2.9/modules/list_of_all_modules.html 找关键字 常见重要模块: service selinux hosname file copy c
阅读全文
ansible 入门测试
摘要:所有步骤均在ansible server主机上执行。 一、安装Ansible wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 或者 yum install epel-release -y yu
阅读全文
配置ansible server
摘要:centos7-asible:20.20.43.0 安装nginx yum install -y nginx 配置 upstream demo-dev{ server 20.20.45.177:5000; server 20.20.41.213:5000; } server{ server_name
阅读全文
ansible
摘要:inventory: 逻辑定义被管主机组。默认/etc/ansible/hosts
阅读全文