Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quay HA Integration Testing
- when: inventory_hostname == groups['local'][0]
become: yes
block:
- name: Before - Create CA
block:
- name: Create CA Folder
file:
path: "/etc/docker/certs.d/{{ groups['quay'][0] }}"
state: directory
- name: Copy CA to Localhost Folder
copy:
src: "{{ quay_ca_files }}"
dest: "/etc/docker/certs.d/{{ groups['quay'][0] }}/ca.crt"
- name: Describe
block:
- name: It should login to local Quay Registry
command: "podman login -u={{ quay_test_robot_name }} -p={{ quay_test_robot_password }} {{ groups['quay'][0] }}"
register: callback
environment:
GODEBUG: x509ignoreCN=0
- name: debug
debug:
msg: "{{ callback.stdout_lines[0] }}"
- name: Assert that it has logged in to local Quay Registry
vars:
test_string: "Login Succeeded!"
assert:
that: test_string == callback.stdout_lines[0]
- name: After - Delete CA from Localhost
file:
path: "/etc/docker/certs.d/{{ groups['quay'][0] }}/ca.crt"
state: absent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment