Skip to content

Commit

Permalink
fix: testing, structure and add latest feature
Browse files Browse the repository at this point in the history
  • Loading branch information
fadnincx committed Apr 19, 2023
1 parent 94f7b17 commit 8c8570f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @Jocomol

2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
potos_evince_enforce_latest: false
6 changes: 6 additions & 0 deletions meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ argument_specs:
main:
short_description: Role to install Evince on Potos Linux Clients.
options:
potos_evince_enforce_latest:
description:
- If Evince package should be always updated to the latest version (else just ensure Evince is present)
type: bool
required: no
default: false
7 changes: 1 addition & 6 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@
hosts: all
gather_facts: yes

tasks:
# Update the apt cache as it's potentialy outdated in the container
- name: update apt
ansible.builtin.shell: # noqa: command-instead-of-module
cmd: 'apt-get update && apt-get upgrade -y'
when: ansible_distribution == 'Ubuntu'
tasks: []
6 changes: 4 additions & 2 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
- name: check if package has been installed
ansible.builtin.command: dpkg-query -l evince
register: package_check
failed_when: false
failed_when: package_check.rc != 0
changed_when: false

- name: check if template has been applied
ansible.builtin.command: evince --version
register: package_check
failed_when: false
failed_when: package_check.rc != 0
changed_when: false
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
- name: Ensure evince is installed
ansible.builtin.package:
name: evince
state: present
state: "{{ potos_evince_enforce_latest | ternary('latest', 'present') }}"

0 comments on commit 8c8570f

Please sign in to comment.