跳到内容

galaxy-version-incorrect

此规则检查 galaxy.yml 中的 version 键是否大于或等于 1.0.0。这是为了遵循 Ansible 自动化平台中强制执行的语义版本控制标准。

这是一个可选择启用的规则。您必须在 Ansible-lint 配置中启用它,如下所示

enable_list:
  - galaxy-version-incorrect

有问题代码

description: "description"
namespace: "namespace_name"
name: "collection_name"
version: "0.0.1" # <- version key is not greater than or equal to '1.0.0'.
readme: "README.md"
authors:
  - "Author1"
  - "Author2 (https://author2.example.com)"
  - "Author3 <author3@example.com>"
dependencies:
  "other_namespace.collection1": ">=1.0.0"
  "other_namespace.collection2": ">=2.0.0,<3.0.0"
  "anderson55.my_collection": "*" # note: "*" selects the highest version available
license:
  - "MIT"
tags:
  - demo
  - collection
repository: "https://www.github.com/my_org/my_collection"

正确代码

description: "description"
namespace: "namespace_name"
name: "collection_name"
version: "1.0.0" # <- version key is greater than or equal to '1.0.0'.
readme: "README.md"
authors:
  - "Author1"
  - "Author2 (https://author2.example.com)"
  - "Author3 <author3@example.com>"
dependencies:
  "other_namespace.collection1": ">=1.0.0"
  "other_namespace.collection2": ">=2.0.0,<3.0.0"
  "anderson55.my_collection": "*" # note: "*" selects the highest version available
license:
  - "MIT"
tags:
  - demo
  - collection
repository: "https://www.github.com/my_org/my_collection"