Skip to content

Commit

Permalink
bit of refactoring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ednxzu committed Jul 3, 2023
1 parent d12a59b commit cb36ee6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions molecule/with_custom_repo/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,14 @@
loop: "{{ find_etc_apt_sources_list_d.files }}"
register: slurp_etc_apt_sources_list_d


- name: "Verify file /etc/apt/sources.list.d/docker.list"
ansible.builtin.assert:
that:
- item.item.isreg
- item.item.pw_name == 'root'
- item.item.gr_name == 'root'
- item.item.mode == '0644'
- "(item.content|b64decode) in ('deb [signed-by=/usr/share/keyrings/docker-archive-keyring.asc] https://download.docker.com/linux/' + (ansible_distribution|lower) + ' ' + ansible_distribution_release + ' stable\\n')"
- "(item.content|b64decode) == ('deb [signed-by=/usr/share/keyrings/docker-archive-keyring.asc] https://download.docker.com/linux/' + (ansible_distribution|lower) + ' ' + ansible_distribution_release + ' stable\\n')"
loop: "{{ slurp_etc_apt_sources_list_d.results }}"
when: (item.item.path | basename | splitext | first) == 'docker'

Expand All @@ -96,6 +95,6 @@
- item.item.pw_name == 'root'
- item.item.gr_name == 'root'
- item.item.mode == '0644'
- "(item.content|b64decode) in ('deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.asc] https://apt.releases.hashicorp.com ' + ansible_distribution_release + ' main\\n')"
- "(item.content|b64decode) == ('deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.asc] https://apt.releases.hashicorp.com ' + ansible_distribution_release + ' main\\n')"
loop: "{{ slurp_etc_apt_sources_list_d.results }}"
when: (item.item.path | basename | splitext | first) == 'hashicorp'

0 comments on commit cb36ee6

Please sign in to comment.