Debian Codegraph @

test/integration/targets/ansible-galaxy-collection-scm/tasks/setup_collection_bad_version.yml

raw
1 - name: Initialize a git repo
2 command: 'git init {{ test_error_repo_path }}'
3
4 - stat:
5 path: "{{ test_error_repo_path }}"
6
7 - name: Add a collection to the repository
8 command: 'ansible-galaxy collection init {{ item }}'
9 args:
10 chdir: '{{ scm_path }}'
11 loop:
12 - error_test.float_version_collection
13 - error_test.not_semantic_version_collection
14 - error_test.list_version_collection
15 - error_test.dict_version_collection
16
17 - name: Add an invalid float version to a collection
18 lineinfile:
19 path: '{{ test_error_repo_path }}/float_version_collection/galaxy.yml'
20 regexp: '^version'
21 line: "version: 1.0" # Version is a float, not a string as expected
22
23 - name: Add an invalid non-semantic string version a collection
24 lineinfile:
25 path: '{{ test_error_repo_path }}/not_semantic_version_collection/galaxy.yml'
26 regexp: '^version'
27 line: "version: '1.0'" # Version is a string, but not a semantic version as expected
28
29 - name: Add an invalid list version to a collection
30 lineinfile:
31 path: '{{ test_error_repo_path }}/list_version_collection/galaxy.yml'
32 regexp: '^version'
33 line: "version: ['1.0.0']" # Version is a list, not a string as expected
34
35 - name: Add an invalid version to a collection
36 lineinfile:
37 path: '{{ test_error_repo_path }}/dict_version_collection/galaxy.yml'
38 regexp: '^version'
39 line: "version: {'broken': 'version'}" # Version is a dict, not a string as expected
40
41 - name: Commit the changes
42 command: '{{ item }}'
43 args:
44 chdir: '{{ test_error_repo_path }}'
45 loop:
46 - git add ./
47 - git commit -m 'add collections'