Files
ansible-general/roles/apt_repository/molecule/default/verify.yml
2023-07-14 15:14:54 +03:00

22 lines
892 B
YAML

---
- name: Verify
hosts: all
gather_facts: true
tasks:
- name: Get content of docker source file
ansible.builtin.slurp:
src: /etc/apt/sources.list.d/docker.list
register: docker_repo
- name: Ensure docker repo file content is as expected
ansible.builtin.assert:
that: >
docker_repo.content | b64decode == "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc]
https://download.docker.com/linux/{{ ansible_distribution | lower }}
{{ ansible_distribution_release }} stable\n"
msg: >
/etc/apt/sources.list.d/docker.list should contain
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc]
https://download.docker.com/linux/{{ ansible_distribution | lower }}
{{ ansible_distribution_release }} stable but it contained {{ docker_repo.content | b64decode }} instead