ansible - 在 Ansible + Test Kitchen 中包含依赖项

标签 ansible test-kitchen

我正在尝试让 Ansible + Test Kitchen 工作,我的代码可在 Github 获取。 .

运行厨房测试时出现错误:

   ERROR! the role 'geerlingguy.java' was not found in /tmp/kitchen/roles:/tmp/kitchen:/tmp/kitchen/roles:/tmp/kitchen/roles

   The error appears to have been in '/tmp/kitchen/roles/ansible-nexus/meta/main.yml': line 3, column 5, but may
   be elsewhere in the file depending on the exact syntax problem.

   The offending line appears to be:

   dependencies:
     - { role: geerlingguy.java }

有没有办法告诉 Test Kitchen 首先从 Ansible Galaxy 引入依赖项?

最佳答案

您应该包含以下更改: .kitchen.yml

provisioner:
  hosts: test-kitchen
  name: ansible_playbook
  #require_chef_for_busser: false
  #require_ruby_for_busser: true
  ansible_verbosity: 2
  ansible_verbose: true
  require_ansible_repo: false
  require_ansible_omnibus: true
  requirements_path: requirements-test.txt
  #
  # When testing with Test Kitchen, run the Docker client with
  # "--insecure-registry registry.yourdomain.local" so that we can test pushing
  # to our test private registry.
  #
  #extra_vars:
  #  docker_opts: "--insecure-registry registry.yourdomain.local"

需求测试.txt

geerlingguy.java

关于ansible - 在 Ansible + Test Kitchen 中包含依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37363940/

相关文章:

ansible - 如何在一个文件库中为多个主机定义 sudo 密码?

ansible - 使用 ansible 循环访问主机

ansible - Ansible 中的条件角色包含失败

Ansible 中的 Git 模块在 tmp 目录上获得权限被拒绝

ubuntu - 在 Chef 中创建厨房时出错

ansible - 带有前导空格的多行字符串

windows - 测试厨房登录命令失败

chef-infra - 如何在 Test Kitchen .kitchen.yml 文件中指定 Chef Solo 的版本?

amazon-ec2 - 测试厨房几乎每次传输文件都会失败

testing - 如何为 chef make install 编写测试