• 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)]

  • 相关阅读:
    vue导入excel表格
    正则表达式:输入六位数或六位数以下的正整数。
    iview下拉框支持多选
    vue通过jquery方式获取元素
    获取对象属性
    原生JS获取元素,添加事件
    打印当前页面,关闭当前页面
    Andrew Ng 机器学习公开课
    机器学习4《朴素贝叶斯》
    机器学习3《数据集与k-近邻算法》
  • 原文地址:https://www.cnblogs.com/vzhangxk/p/15004568.html
Copyright © 2020-2023  润新知