Skip to content

Commit cb57a15

Browse files
committed
ansible-lint: fix YAML failures
1 parent 562d58b commit cb57a15

File tree

14 files changed

+68
-76
lines changed

14 files changed

+68
-76
lines changed

.ansible-lint

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
skip_list:
22
- name[missing]
3-
- name[play]
43
- var-naming[no-reserved]
54
- var-naming[no-role-prefix]
6-
- yaml[empty-lines]
7-
- yaml[indentation]
85
- yaml[line-length]
9-
- yaml[new-line-at-end-of-file]
10-
- yaml[trailing-spaces]
11-
- yaml[truthy]
126
- galaxy[no-changelog]
137
- galaxy[tags]
148
- galaxy[version-incorrect]

.github/workflows/pull_request.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
21
name: Tests
32

43
# Controls when the action will run.
5-
on:
4+
'on':
65
pull_request:
76
push:
87
branches:
98
- master
109
env:
11-
ANSIBLE_FORCE_COLOR: True
10+
ANSIBLE_FORCE_COLOR: true
1211

1312
jobs:
1413
lint:

roles/pulp_django_user/tasks/user_groups/add_user_to_groups.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
- name: Fail when group cannot be unambiguosly returned from Pulp
1515
fail:
16-
msg: >
17-
"Pulp API query: GET '{{ group_href_result.url }}' did not return
18-
exactly one group. Groupname '{{ add_group }}' was found
19-
'{{ group_href_result.json.count }}' times.
20-
Groupnames should be unique and exist before associating users
21-
with them"
16+
msg: >
17+
"Pulp API query: GET '{{ group_href_result.url }}' did not return
18+
exactly one group. Groupname '{{ add_group }}' was found
19+
'{{ group_href_result.json.count }}' times.
20+
Groupnames should be unique and exist before associating users
21+
with them"
2222
when: group_href_result.json.count != 1
2323

2424
# Will fail before we get here if the group doesn't exist or has

roles/pulp_django_user/tasks/user_groups/remove_user_from_groups.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
# from pulp API
1616
- name: Fail when group cannot be unambiguosly returned from Pulp API
1717
fail:
18-
msg: >
19-
"Pulp API query: GET '{{ group_href_result.url }}' did not return
20-
exactly one group. Groupname '{{ remove_group }}' was found
21-
'{{ group_href_result.json.count }}' times.
22-
Groupnames should be unique and exist before associating users
23-
with them"
18+
msg: >
19+
"Pulp API query: GET '{{ group_href_result.url }}' did not return
20+
exactly one group. Groupname '{{ remove_group }}' was found
21+
'{{ group_href_result.json.count }}' times.
22+
Groupnames should be unique and exist before associating users
23+
with them"
2424
when: group_href_result.json.count != 1
2525

2626
- name: Get user id from Pulp API

roles/pulp_group/tasks/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
loop_var: "group"
2525
label: "{{ group.item.name }}"
2626
when:
27-
- group.json.count == 1
28-
- group.item.state is defined
29-
- group.item.state == "absent"
27+
- group.json.count == 1
28+
- group.item.state is defined
29+
- group.item.state == "absent"
3030

3131
- name: Set groups to create fact
3232
set_fact:
@@ -36,8 +36,8 @@
3636
loop_var: "group"
3737
label: "{{ group.item.name }}"
3838
when:
39-
- group.json.count == 0
40-
- group.item.state is not defined or group.item.state != "absent"
39+
- group.json.count == 0
40+
- group.item.state is not defined or group.item.state != "absent"
4141

4242
- name: Create groups
4343
uri:

roles/pulp_repository/tasks/container.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
url: "{{ pulp_repository_container_repos[repository_index].url | default(omit) }}"
3636
state: "{{ pulp_repository_container_repos[repository_index].state }}"
3737
when: >
38-
pulp_repository_container_repos[repository_index].state == "absent" or
38+
pulp_repository_container_repos[repository_index].state == "absent" or
3939
pulp_repository_container_repos[repository_index].url is defined
4040
loop: "{{ pulp_repository_container_repos | map(attribute='name') }}"
4141
loop_control:
@@ -56,6 +56,6 @@
5656
loop_control:
5757
index_var: repository_index
5858
register: pulp_repository_container_repos_sync
59-
until: "pulp_repository_container_repos_sync is not failed"
59+
until: "pulp_repository_container_repos_sync is not failed"
6060
retries: "{{ pulp_repository_container_repos_sync_retries }}"
6161
delay: 1

roles/pulp_repository/tasks/deb.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
url: "{{ pulp_repository_deb_repos[repository_index].url | default(omit) }}"
3636
state: "{{ pulp_repository_deb_repos[repository_index].state }}"
3737
when: >
38-
pulp_repository_deb_repos[repository_index].state == "absent" or
38+
pulp_repository_deb_repos[repository_index].state == "absent" or
3939
pulp_repository_deb_repos[repository_index].url is defined
4040
loop: "{{ pulp_repository_deb_repos | map(attribute='name') }}"
4141
loop_control:
@@ -57,6 +57,6 @@
5757
loop_control:
5858
index_var: repository_index
5959
register: pulp_repository_deb_repos_sync
60-
until: "pulp_repository_deb_repos_sync is not failed"
60+
until: "pulp_repository_deb_repos_sync is not failed"
6161
retries: "{{ pulp_repository_deb_repos_sync_retries }}"
6262
delay: 1

roles/pulp_repository/tasks/python.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
url: "{{ pulp_repository_python_repos[repository_index].url | default(omit) }}"
3636
state: "{{ pulp_repository_python_repos[repository_index].state }}"
3737
when: >
38-
pulp_repository_python_repos[repository_index].state == "absent" or
38+
pulp_repository_python_repos[repository_index].state == "absent" or
3939
pulp_repository_python_repos[repository_index].url is defined
4040
loop: "{{ pulp_repository_python_repos | map(attribute='name') }}"
4141
loop_control:
@@ -56,7 +56,6 @@
5656
loop_control:
5757
index_var: repository_index
5858
register: pulp_repository_python_repos_sync
59-
until: "pulp_repository_python_repos_sync is not failed"
59+
until: "pulp_repository_python_repos_sync is not failed"
6060
retries: "{{ pulp_repository_python_repos_sync_retries }}"
6161
delay: 1
62-

roles/pulp_repository/tasks/rpm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
url: "{{ pulp_repository_rpm_repos[repository_index].url | default(omit) }}"
3333
state: "{{ pulp_repository_rpm_repos[repository_index].state }}"
3434
when: >
35-
pulp_repository_rpm_repos[repository_index].state == "absent" or
35+
pulp_repository_rpm_repos[repository_index].state == "absent" or
3636
pulp_repository_rpm_repos[repository_index].url is defined
3737
loop: "{{ pulp_repository_rpm_repos | map(attribute='name') }}"
3838
loop_control:
@@ -54,6 +54,6 @@
5454
loop_control:
5555
index_var: repository_index
5656
register: pulp_repository_rpm_repos_sync
57-
until: "pulp_repository_rpm_repos_sync is not failed"
57+
until: "pulp_repository_rpm_repos_sync is not failed"
5858
retries: "{{ pulp_repository_rpm_repos_sync_retries }}"
5959
delay: 1

tests/test_container_repository.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@
8282
that: container_remotes.remotes | length == 0
8383

8484
- block:
85-
- include_role:
86-
name: pulp_repository
87-
vars:
88-
pulp_repository_container_repos:
89-
- name: test_container_repo_bad_url
90-
upstream_name: pulp/test-fixture-1
91-
url: "https://google.com/404"
92-
policy: immediate
93-
state: present
85+
- include_role:
86+
name: pulp_repository
87+
vars:
88+
pulp_repository_container_repos:
89+
- name: test_container_repo_bad_url
90+
upstream_name: pulp/test-fixture-1
91+
url: "https://google.com/404"
92+
policy: immediate
93+
state: present
9494

9595
rescue:
9696
- set_fact:
@@ -111,5 +111,5 @@
111111
name: pulp_repository
112112
vars:
113113
pulp_repository_deb_repos:
114-
- name: test_container_repo_bad_url
115-
state: absent
114+
- name: test_container_repo_bad_url
115+
state: absent

tests/test_content_guard_rbac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
assert:
152152
that:
153153
- rbac_cg_list.json.results | json_query(query) | length == 0
154-
154+
155155
- name: Cleanup
156156
include_role:
157157
name: pulp_content_guard

tests/test_deb_repository.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@
8282
that: deb_remotes.remotes | length == 0
8383

8484
- block:
85-
- include_role:
86-
name: pulp_repository
87-
vars:
88-
pulp_repository_deb_repos:
89-
- name: test_deb_repo_bad_url
90-
url: "https://google.com/404"
91-
distributions: "ragnarok"
92-
policy: immediate
93-
state: present
85+
- include_role:
86+
name: pulp_repository
87+
vars:
88+
pulp_repository_deb_repos:
89+
- name: test_deb_repo_bad_url
90+
url: "https://google.com/404"
91+
distributions: "ragnarok"
92+
policy: immediate
93+
state: present
9494
rescue:
9595
- set_fact:
9696
failed_task: "{{ ansible_failed_task }}"
@@ -110,5 +110,5 @@
110110
name: pulp_repository
111111
vars:
112112
pulp_repository_deb_repos:
113-
- name: test_deb_repo_bad_url
114-
state: absent
113+
- name: test_deb_repo_bad_url
114+
state: absent

tests/test_django_user.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- name: Set Pulp version fact
2020
set_fact:
2121
pulp_version: "{{ pulp_status.json.versions | selectattr('component', 'equalto', 'core') | map(attribute='version') | first }}"
22-
22+
2323
- name: Run Django user test on Pulp =< 3.18
2424
when: pulp_version is version('3.18', 'le', version_type='strict')
2525
block:
@@ -33,7 +33,7 @@
3333
status_code: 200
3434
force_basic_auth: true
3535
register: groups_result
36-
36+
3737
- name: Create groups
3838
uri:
3939
url: "{{ pulp_url }}/pulp/api/v3/groups/"
@@ -49,7 +49,7 @@
4949
- test_group1
5050
- test_group2
5151
when: item not in groups_result.json.results | map(attribute='name') | list
52-
52+
5353
- include_role:
5454
name: pulp_django_user
5555
vars:
@@ -58,7 +58,7 @@
5858
password: correct horse battery staple
5959
groups:
6060
- test_group1
61-
61+
6262
- name: Query user
6363
uri:
6464
url: "{{ pulp_url }}/pulp/api/v3/users/?username=test_user"
@@ -68,15 +68,15 @@
6868
status_code: 200
6969
force_basic_auth: true
7070
register: user_result
71-
71+
7272
- name: Verify django user creation
7373
assert:
7474
that:
7575
- user_result.json.count == 1
7676
- user_result.json.results[0].username == "test_user"
7777
- user_result.json.results[0].groups | length == 1
7878
- user_result.json.results[0].groups[0].name == "test_group1"
79-
79+
8080
# Update group membership.
8181
- include_role:
8282
name: pulp_django_user
@@ -86,7 +86,7 @@
8686
password: correct horse battery staple
8787
groups:
8888
- test_group2
89-
89+
9090
- name: Query user
9191
uri:
9292
url: "{{ pulp_url }}/pulp/api/v3/users/?username=test_user"
@@ -96,7 +96,7 @@
9696
status_code: 200
9797
force_basic_auth: true
9898
register: user_result
99-
99+
100100
- name: Verify django user group update
101101
assert:
102102
that:

tests/test_rpm_repository.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@
8080
that: rpm_remotes.remotes | length == 0
8181

8282
- block:
83-
- include_role:
84-
name: pulp_repository
85-
vars:
86-
pulp_repository_rpm_repos:
87-
- name: test_rpm_repo_bad_url
88-
url: "https://google.com/404"
89-
policy: immediate
90-
state: present
83+
- include_role:
84+
name: pulp_repository
85+
vars:
86+
pulp_repository_rpm_repos:
87+
- name: test_rpm_repo_bad_url
88+
url: "https://google.com/404"
89+
policy: immediate
90+
state: present
9191
rescue:
9292
- set_fact:
9393
failed_task: "{{ ansible_failed_task }}"
@@ -107,5 +107,5 @@
107107
name: pulp_repository
108108
vars:
109109
pulp_repository_rpm_repos:
110-
- name: test_rpm_repo_bad_url
111-
state: absent
110+
- name: test_rpm_repo_bad_url
111+
state: absent

0 commit comments

Comments
 (0)