Ansible是否有客户端/代理软件?

2024-04-16 11:56:29 发布

您现在位置:Python中文网/ 问答频道 /正文

Ansible的一个明显优点是无代理体系结构。Ansible使用Python,并且几乎总是预先安装在任何发行版上。因此,在Ansible需要发挥魔力的机器上,不需要客户机或代理。你知道吗

最近的经验使我们怀疑这在实践中是否属实。你知道吗

例如,当前的Ansible提供了生成证书的模块,如Generating self-signed OpenSSL certs with Ansible 2.4's crypto modules | Jeff Geerling一文所述

但是如果您使用这些,您还需要:pip、python-dev。这些依赖项最初将失败,因为您需要为python_versionpython_user提供值。你知道吗

现在事情很快就变得一团糟了。我们正在目标机器上创建一个Python开发环境来创建一个自签名证书。例如,一大堆其他东西被拖进来了

python,python开发,python3,python3开发,make,gcc,python pip,python3 pip,build-essential,libssl开发,zlib1g开发,libbz2开发,libreadline开发,libsqlite0开发,wget,curl,llvm,libncurses5开发,libncursesw5开发,xz-utils,tk开发,git,libffi开发,libxml2开发,libxslt1开发,libyaml开发

现在请注意,我们正在使用Ansible Now的默认部分模块创建自签名证书。但是,这些模块需要的东西不是Linux上任何标准Python发行版的一部分。你知道吗

实际上,为了创建一个自签名证书(这通常是通过几个bash命令完成的),我们正在构建一个一次性的定制Ansible客户端。这很可能会失败,例如

Failed to import the required Python library (setuptools) on myserver's Python /usr/bin/python

因此,我的结论是,Ansible并不是真正的无代理的,事实上需要在目标机器上有某种类型的客户机/代理。这个客户机/代理只是动态下载、编译、链接和配置的。你知道吗

如果我们只是为了使用标准的Ansible模块而需要这样做,那么我们已经有效地证明了需要某种类型的Ansible客户机和/或代理。你知道吗

当然,没有官方的Ansible客户机/代理会出现,因为Ansible被吹捧为无代理,不需要Python以外的任何东西。你知道吗

但也许有人不辞辛劳地创造了这样一个客户?是否有某种安装程序可以安装Ansible声称支持的模块的所有依赖项?你知道吗


Tags: 模块pip机器类型代理目标标准客户机
1条回答
网友
1楼 · 发布于 2024-04-16 11:56:29

Q: " Ansible offers modules for generating certificates ... But if you use these you will additionally need: pip, python-dev. Those dependencies will initially fail because you need to provide values for python_version and python_user. Things get messy quick now ...

We are creating self signed certificates using modules that are default part of Ansible now. Those modules however require stuff that is not part of any standard Python distribution on Linux.

A:openssl_certificate模块要求

  • PyOpenSSL >= 0.15 or cryptography >= 1.6 (if using selfsigned or assertonly provider)

  • acme-tiny (if using the acme provider)

这就是ubuntu18.04、FreeBSD 11.3和12.0所需要的全部。详见certificateAnsible Galaxy role。你知道吗

Debian vars

certificate_packages:
  - python-openssl
  - acme-tiny

FreeBSD vars

certificate_packages:
  - security/py-openssl
  - security/py-acme-tiny

基督教青年会。你知道吗

相关问题 更多 >