Add role for eget installation
This commit is contained in:
24
roles/eget/tasks/main.yml
Normal file
24
roles/eget/tasks/main.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
# tasks file for eget
|
||||
|
||||
- name: 'Check if eget installed'
|
||||
ansible.builtin.command:
|
||||
cmd: '{{ eget_install_path }} --version'
|
||||
register: eget_installed_output
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
|
||||
- name: 'Check eget installed --version'
|
||||
ansible.builtin.set_fact:
|
||||
eget_need_install: '{{ not (eget_installed_output.rc == 0 and eget_version in eget_installed_output.stdout) }}'
|
||||
|
||||
- name: 'Assert that installation flag is defined'
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- eget_need_install is defined
|
||||
- eget_need_install is boolean
|
||||
|
||||
- name: 'Download eget and install eget'
|
||||
ansible.builtin.include_tasks:
|
||||
file: 'install.yml'
|
||||
when: eget_need_install
|
Reference in New Issue
Block a user