Skip to content

Commit

Permalink
Add version check
Browse files Browse the repository at this point in the history
  • Loading branch information
wawrzek committed Nov 29, 2024
1 parent 9d1b709 commit 76b7b31
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The role has a set of simple molecule test confirming that it works with contepo

Simple molecule check that the binaries are installed.

Each relase should trigger bump of the version in the defaults list and in the molecule verify.yml file.

# Known issue

- Fedora 41 causes an issue for Ansible dnf module (https://github.com/ansible/ansible/issues/84206).
Expand Down
15 changes: 14 additions & 1 deletion molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
hosts: all
vars:
ivynet_client_path: /opt/ivynet/bin/ivynet
ivynet_client_version: 0.3.0
tasks:
- name: Get file stats
ansible.builtin.stat:
Expand All @@ -12,9 +13,21 @@
- name: Show
ansible.builtin.debug:
msg: "{{ ivynet_bin }}"
- name: Assert the file is download
- name: Assert that the file is downloaded
ansible.builtin.assert:
that:
- ivynet_bin.stat.isreg is defined
- ivynet_bin.stat.isreg == True
- ivynet_bin.stat.size > 2**20
- name: Confirm right version
ansible.builtin.shell: |
set -o pipefail &&
{{ ivynet_client_path }} -V |
grep -q {{ ivynet_client_version }}
register:
ivynet_version_check
changed_when: ivynet_version_check.rc != 0
- name: Assert that the right version was found
ansible.builtin.assert:
that:
- ivynet_version_check.rc == 0

0 comments on commit 76b7b31

Please sign in to comment.