mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
check origin
This commit is contained in:
parent
d3ec97183d
commit
ab71d0a291
2 changed files with 27 additions and 0 deletions
2
Makefile
2
Makefile
|
|
@ -261,6 +261,8 @@ ansible_inventory:
|
||||||
echo " ansible_ssh_common_args: '-o StrictHostKeyChecking=no'" >> ansible_inventory
|
echo " ansible_ssh_common_args: '-o StrictHostKeyChecking=no'" >> ansible_inventory
|
||||||
|
|
||||||
test-vm: ansible_inventory
|
test-vm: ansible_inventory
|
||||||
|
$(eval _VARS = IMAGE_REPO IMAGE_NAME IMAGE_TAG)
|
||||||
|
|
||||||
ansible -i ansible_inventory -m ansible.builtin.wait_for_connection vm
|
ansible -i ansible_inventory -m ansible.builtin.wait_for_connection vm
|
||||||
|
|
||||||
# install tests
|
# install tests
|
||||||
|
|
|
||||||
25
tests/vm/install_image_source.yml
Normal file
25
tests/vm/install_image_source.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env -S ansible-playbook -i ./ansible_inventory
|
||||||
|
---
|
||||||
|
- name: Test Container Image source updates
|
||||||
|
hosts: vm
|
||||||
|
gather_facts: no
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
# Get list of origins
|
||||||
|
- name: Get origin
|
||||||
|
become: true
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: cat /ostree/deploy/default/deploy/*.origin
|
||||||
|
register: origin
|
||||||
|
|
||||||
|
- name: Get vars
|
||||||
|
ansible.builtin.set_facts:
|
||||||
|
image_repo: "{{ lookup('ansible.builtin.env', 'IMAGE_REPO') }}"
|
||||||
|
image_name: "{{ lookup('ansible.builtin.env', 'IMAGE_NAME') }}"
|
||||||
|
image_tag: "{{ lookup('ansible.builtin.env', 'IMAGE_TAG') }}"
|
||||||
|
|
||||||
|
- name: Tests
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- (image_repo + '/' + image_name + ':' + image_tag) in origin.stdout
|
||||||
|
fail_msg: 'Origin not configured'
|
||||||
Loading…
Add table
Add a link
Reference in a new issue