ansible初识

ansible: 运维自动化的工具, 基本功能, 基于ssh远程连接, 连接验证(ssh-keygen ssh-copy-id  ip)

下载:

  1. 安装epel源 wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

  2. yum install -y ansible

语法格式:

  ansible <host-pattern>  [options]

    -a 模块参数

    -C 不做任何改变, 但是会执行操作命令

    -f FORKS --forks=FORKS 用于指定并发

    --list-hosts 列举管理客户主机列表

    -k --ask-pass 输入密码

HOST-PATTERN

  单个主机 ip

  多个主机 ip1, ip2,ip3

  选择所有主机 all

  分组  groupname

  多个组:  交集 'web: &db'

       并集 web, db  or  'db:web'

         差集 'web:!db'

 

My ansible  the first command

  ansible all -m ping

  

 

posted @ 2019-03-18 19:11  python传言  阅读(144)  评论(0编辑  收藏  举报