zoukankan      html  css  js  c++  java
  • ansible学习01

    一、Ansible是什么

    Ansible是一个基于Python开发的轻量级自动化运维工具,有着其他自动化运维工具如puppet、cfengine、chef、func、fabric的优点,并且不需要单独安装客户端以及启动服务,只需要通过SSH就可以快速的对大量客户端实现批量系统配置、程序部署、批量运行命令等。

    二、安装Ansible

    [root@localhost yum.repos.d]# yum search ansible
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
    * base: mirrors.aliyun.com
    * extras: mirrors.aliyun.com
    * updates: mirrors.aliyun.com
    =================================================================================== N/S matched: ansible ===================================================================================
    centos-release-ansible-27.noarch : Ansible 2.7 packages from the CentOS ConfigManagement SIG repository
    centos-release-ansible-28.noarch : Ansible 2.8 packages from the CentOS ConfigManagement SIG repository
    centos-release-ansible-29.noarch : Ansible 2.9 packages from the CentOS ConfigManagement SIG repository
    centos-release-ansible26.noarch : Ansible 2.6 packages from the CentOS ConfigManagement SIG repository

    Name and summary matches only, use "search all" for everything.

    [root@localhost yum.repos.d]# yum install centos-release-ansible-29.noarch

    安装ansible的源:CentOS-SIG-ansible-29.repo

    [root@localhost yum.repos.d]# ll
    total 8
    drwxr-xr-x. 2 root root 220 Jul 12 23:05 bak
    -rw-r--r--. 1 root root 2523 Dec 26 2020 Centos-7.repo
    -rw-r--r--. 1 root root 1192 Mar 31 2020 CentOS-SIG-ansible-29.repo

    [root@localhost yum.repos.d]# yum install ansible

    安装完成后,查看ansible配置文件,将注释#和空行去掉

    [root@localhost yum.repos.d]# egrep -v "^$|^#" /etc/ansible/ansible.cfg
    [defaults]
    [inventory]
    [privilege_escalation]
    [paramiko_connection]
    [ssh_connection]
    [persistent_connection]
    [accelerate]
    [selinux]
    [colors]
    [diff]

    三、Ansible版本查看

    [root@localhost ~]# ansible --version
    ansible 2.9.23
    config file = /etc/ansible/ansible.cfg
    configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/lib/python2.7/site-packages/ansible
    executable location = /usr/bin/ansible
    python version = 2.7.5 (default, Oct 14 2020, 14:45:30) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

  • 相关阅读:
    网路连接出现意外错误
    linux install oracle jdk
    Chrome开发者工具详解(一)之使用断点来调试代码上
    jQuery对象与DOM对象的相互转换
    Velocity学习(二)之语法
    vscode学习(一)之vscode开发中绝对让你惊艳的插件!!!(个人在用) 持续更新。。。。
    css3新属性box-orient
    使用css控制文字显示几行并且剩余部分隐藏(移动端和PC端同样适用)
    移动端实现横滑
    移动端实1px细线方法
  • 原文地址:https://www.cnblogs.com/vzhangxk/p/15004568.html
Copyright © 2011-2022 走看看