From 4aab7e065cc6d9ea29228280ce665c154773754d Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Fri, 29 Apr 2022 16:55:13 +0100 Subject: [PATCH] meta: allow use of collections key (#244) --- f/ansible-meta.json | 8 ++++++++ .../roles/meta_invalid_collection/meta/main.yml | 10 ++++++++++ .../roles/meta_invalid_collections/meta/main.yml | 10 ++++++++++ test/roles/foo/meta/main.yml | 2 ++ 4 files changed, 30 insertions(+) create mode 100644 negative_test/roles/meta_invalid_collection/meta/main.yml create mode 100644 negative_test/roles/meta_invalid_collections/meta/main.yml diff --git a/f/ansible-meta.json b/f/ansible-meta.json index d3ca60e4..96c88768 100644 --- a/f/ansible-meta.json +++ b/f/ansible-meta.json @@ -1348,6 +1348,14 @@ "title": "Allow Duplicates", "type": "boolean" }, + "collections": { + "items": { + "markdownDescription": "See [Using collections in roles](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html#using-collections-in-roles) and [collection naming conventions](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_in_groups.html#naming-conventions)", + "pattern": "^[a-z_]+\\.[a-z_]+$", + "type": "string" + }, + "type": "array" + }, "dependencies": { "items": { "$ref": "#/definitions/DependencyModel" diff --git a/negative_test/roles/meta_invalid_collection/meta/main.yml b/negative_test/roles/meta_invalid_collection/meta/main.yml new file mode 100644 index 00000000..1d822352 --- /dev/null +++ b/negative_test/roles/meta_invalid_collection/meta/main.yml @@ -0,0 +1,10 @@ +collections: + - foo # invalid pattern +galaxy_info: + description: foo + license: bar + min_ansible_version: "2.10" + platforms: + - name: Fedora + versions: + - all diff --git a/negative_test/roles/meta_invalid_collections/meta/main.yml b/negative_test/roles/meta_invalid_collections/meta/main.yml new file mode 100644 index 00000000..ae9766e4 --- /dev/null +++ b/negative_test/roles/meta_invalid_collections/meta/main.yml @@ -0,0 +1,10 @@ +collections: + - FOO.BAR # invalid pattern, need to use lowercase +galaxy_info: + description: foo + license: bar + min_ansible_version: "2.10" + platforms: + - name: Fedora + versions: + - all diff --git a/test/roles/foo/meta/main.yml b/test/roles/foo/meta/main.yml index d49df08f..984c655a 100644 --- a/test/roles/foo/meta/main.yml +++ b/test/roles/foo/meta/main.yml @@ -1,3 +1,5 @@ +collections: + - foo.bar dependencies: - name: ansible-role-foo version: "1.0"