在已经安装了Docker Desktop的环境中,尝试使用Ansible的最快方式2 (ansible-community/toolset)

我之前写了一个关于包含Ansible的Docker镜像的内容。

社群工具箱

除此之外,还有一个名为ansible-community/toolset的Docker镜像,其中包括以下内容。

    • ansible

 

    • ansible-lint

 

    • molecule and most of its plugins

 

    • pytest and several of its plugins

 

    yamllint which is used by ansible-lint itself.

尝试运行后,发现是Ansible [核心版本2.11.1]。

$ docker run -it quay.io/ansible/toolset
Unable to find image 'quay.io/ansible/toolset:latest' locally
latest: Pulling from ansible/toolset
69692152171a: Pull complete 
66a3c154490a: Pull complete 
3e35bdfb65b2: Pull complete 
f2c4c4355073: Pull complete 
65d67526c337: Pull complete 
aaa871bca267: Pull complete 
45eac7aceccd: Pull complete 
Digest: sha256:04fa83f0a165d80f1d26b881920c95641bc596493ab0ac0c9e8475f00776a5b6
Status: Downloaded newer image for quay.io/ansible/toolset:latest
root@b66287a341e7:/# 
root@b66287a341e7:/# ansible --version
ansible [core 2.11.1] 
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/toolset/lib/python3.8/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/toolset/bin/ansible
  python version = 3.8.10 (default, May 12 2021, 15:56:47) [GCC 8.3.0]
  jinja version = 3.0.1
  libyaml = True
root@b66287a341e7:/# 
root@b66287a341e7:/# molecule --version
molecule 3.3.4 using python 3.8 
    ansible:2.11.1
    azure:0.5.0 from molecule_azure
    containers:0.2.1 from molecule_containers
    delegated:3.3.4 from molecule
    docker:0.2.4 from molecule_docker
    ec2:0.3 from molecule_ec2
    gce:0.2 from molecule_gce
    hetznercloud:1.2.1 from molecule_hetznercloud
    libvirt:0.0.4 from molecule_libvirt
    lxd:0.2 from molecule_lxd
    openstack:0.3 from molecule_openstack
    podman:0.3.0 from molecule_podman
    vagrant:0.6.3 from molecule_vagrant
root@b66287a341e7:/# 
root@b66287a341e7:/# ansible-lint --version
ansible-lint 5.0.12 using ansible 2.11.1
root@b66287a341e7:/# 
root@b66287a341e7:/# pip list | grep molecule
molecule              3.3.4
molecule-azure        0.5.0
molecule-containers   0.2.1
molecule-digitalocean 0.1
molecule-docker       0.2.4
molecule-ec2          0.3
molecule-gce          0.2
molecule-goss         1.1
molecule-hetznercloud 1.2.1
molecule-inspec       1.1
molecule-libvirt      0.0.4
molecule-lxd          0.2
molecule-openstack    0.3
molecule-podman       0.3.0
molecule-vagrant      0.6.3
WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available.
You should consider upgrading via the '/opt/toolset/bin/python -m pip install --upgrade pip' command.
root@b66287a341e7:/# 
root@b66287a341e7:/# exit 
$ docker images
REPOSITORY                                   TAG       IMAGE ID       CREATED         SIZE
quay.io/ansible/toolset                      latest    f6d98c2f57f5   6 days ago      1.04GB

在考虑从Docker容器内部使用时,Molecule的驱动器可能使用效果一般,但据我观察,它包含了相当多的功能。云计算方面的影响似乎较小。

只需要一个选择:请将以下内容进行汉语本地化改写:

Toolset项目将Molecule集成到Docker镜像中。

广告
将在 10 秒后关闭
bannerAds