是否有使用 kvm 的分子角色的好例子?到目前为止得到 {'lint': ['must be of string type']} 错误

spe*_*00b 0 ansible molecule

我一直在尝试运行找到好的存储库或将分子与 kvm 一起使用的示例。但到目前为止,他们都得到了这一点。

{'lint': ['必须是字符串类型']}

我不知道如何解决这个问题。像这样

---
dependency:
  name: galaxy
driver:
  name: docker
lint:
  name: yamllint
platforms:
  - name: instance
    image: centos:7
provisioner:
  name: ansible
  lint:
    name: ansible-lint
verifier:
  name: testinfra
  lint:
    name: flake8
Run Code Online (Sandbox Code Playgroud)

小智 6

This error is because your molecule has been updated to version 3 while your test code is still with version 2. For version 3, use

lint: |
  ansible-lint
Run Code Online (Sandbox Code Playgroud)

Molecule 3 allows multiple linting tools at the same time, and you can specify them as array.