• Ansible 安装


    系统环境:Centos7

    这里使用源码包安装,因为centos7默认已经安装了python2.7,所以这里就不用安装了,否则需要安装python2.7或者以上版本。当然,最简单的还是yum安装:yum install ansible -y

    1、下载ansible源码包

    #cd /data
    # wget https://releases.ansible.com/ansible/ansible-2.7.5.tar.gz
    或者进入到下面这个网页自行下载需要的软件包版本
    https://releases.ansible.com/ansible/

    2、解压

    # tar zxvf ansible-2.7.5.tar.gz

    3、安装

    # cd ansible-2.7.5/
    # python2.7 setup.py install

    安装过程中报错如下:

    (1)、ext/_yaml.c:4:20: fatal error: Python.h: No such file or directory   提示缺少文件,所以需要安装python-devel库

    # yum install python-devel -y

    (2)、error: Installed distribution cffi 0.8.6 conflicts with requirement cffi>=1.4.1 提示cffi版本太低,下载cffi

    # wget https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz
    或者进入下面的网页自行下载需要的软件包版本
    https://pypi.python.org/pypi/cffi/
    # tar zxvf cffi-1.11.5.tar.gz
    # cd cffi-1.11.5/
    # python2 setup.py  build 执行这一步的时候为了检查是否报错,当然,这里报错了。提示错误 fatal error: ffi.h: No such file or directory,所以安装依赖的库
    # yum install libffi-devel -y

    4、继续安装

    # python2.7 setup.py install

    如果安装过程中缺少什么就安装什么就行了

    5、安装完检查版本

    [root@runstone ansible-2.7.5]# ansible --version
    ansible 2.7.5
      config file = None
      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-2.7.5-py2.7.egg/ansible
      executable location = /usr/bin/ansible
      python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

    ansible配置文件详解借鉴:https://www.cnblogs.com/LuisYang/p/5960660.html

  • 相关阅读:
    【UWP】仅在TextBlock文本溢出时显示Tooltip
    Vue CSS引用背景图片问题
    使用C#与CefSharp相互调用所踩过的坑
    使用JS在网页上查看显示PDF文件
    VS 代码提示默认不选中 解决办法
    Windows Server 2012 R2更新(KB2919355)
    在ASP.NET Core 3.1中使用Swagger
    SQL SERVER 数据库授权指定用户
    第一篇博客
    观察者模式
  • 原文地址:https://www.cnblogs.com/yjt1993/p/10131066.html
Copyright © 2020-2023  润新知