apt_repository: add caddy repo as molecule test
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include apt_repository"
|
||||
ansible.builtin.import_role:
|
||||
- name: Add docker apt repository
|
||||
ansible.builtin.include_role:
|
||||
name: apt_repository
|
||||
vars:
|
||||
repo_name: docker
|
||||
@@ -12,3 +12,14 @@
|
||||
repo_arch: "{{ apt_arch }}"
|
||||
repo_components:
|
||||
- stable
|
||||
|
||||
- name: Add caddy apt repository
|
||||
ansible.builtin.include_role:
|
||||
name: apt_repository
|
||||
vars:
|
||||
repo_name: caddy-stable
|
||||
repo_url: https://dl.cloudsmith.io/public/caddy/stable/deb/debian
|
||||
repo_key_url: https://dl.cloudsmith.io/public/caddy/stable/gpg.key
|
||||
repo_suite: any-version
|
||||
repo_components:
|
||||
- main
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
ansible.builtin.slurp:
|
||||
src: /etc/apt/sources.list.d/docker.list
|
||||
register: docker_repo
|
||||
- name: Get content of caddy source file
|
||||
ansible.builtin.slurp:
|
||||
src: /etc/apt/sources.list.d/caddy-stable.list
|
||||
register: caddy_repo
|
||||
|
||||
- name: Ensure docker repo file content is as expected
|
||||
ansible.builtin.assert:
|
||||
@@ -19,3 +23,15 @@
|
||||
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
|
||||
|
||||
- name: Ensure caddy repo file content is as expected
|
||||
ansible.builtin.assert:
|
||||
that: >
|
||||
caddy_repo.content | b64decode == "deb [signed-by=/etc/apt/keyrings/caddy-stable.asc]
|
||||
https://dl.cloudsmith.io/public/caddy/stable/deb/debian
|
||||
any-version main\n"
|
||||
msg: >
|
||||
/etc/apt/sources.list.d/caddy-stable.list should contain
|
||||
deb [signed-by=/etc/apt/keyrings/caddy-stable.asc]
|
||||
https://dl.cloudsmith.io/public/caddy/stable/deb/debian
|
||||
any-version main but it contained {{ docker_repo.content | b64decode }} instead
|
||||
|
||||
Reference in New Issue
Block a user