evocheck: don't install by default (but possible)

This commit is contained in:
Jérémy Lecour 2017-07-19 14:36:30 +02:00 committed by Jérémy Lecour
parent 360dacf9d8
commit 6f566533a3
5 changed files with 46 additions and 28 deletions

View file

@ -4,7 +4,8 @@ Install and run evocheck ; a script for checking various settings automatically.
## Tasks
The tasks in `main.yml` install the script. This is temporary as evocheck is a package on Debian which is a bit outdated for the moment. For OpenBSD, it should also be packaged, but the work is not done yet.
The roles does not install evocheck by default as it should be installed through dependencies.
For OpenBSD, it should be packaged, but the work is not done yet.
A separate `exec.yml` file can be imported manually in playbooks or roles to execute the script. Example :
@ -13,3 +14,8 @@ A separate `exec.yml` file can be imported manually in playbooks or roles to exe
name: evocheck
tasks_from: exec.yml
```
## Variables
We can force install via :
* `evocheck_force_install: local` : will copy the script provided by the role
* `evocheck_force_install: package` : will install the package via repositories

View file

@ -1,2 +1,3 @@
---
evocheck_force_install: False
evocheck_bin_dir: /usr/share/scripts

View file

@ -0,0 +1,29 @@
---
- include: remount_usr_rw.yml
when: evocheck_bin_dir | search ("/usr")
- name: Scripts dir is present
file:
path: "{{ evocheck_bin_dir }}"
state: directory
owner: root
group: root
mode: "0700"
- name: Copy evocheck.sh
copy:
src: evocheck.sh
dest: "{{ evocheck_bin_dir }}/evocheck.sh"
mode: "0700"
owner: root
force: yes
tags:
- evocheck
- name: Copy evocheck.cf
copy:
src: evocheck.cf
dest: /etc/evocheck.cf
force: no
tags:
- evocheck

View file

@ -0,0 +1,5 @@
---
- name: install evocheck from package
apt:
name: evocheck
state: installed

View file

@ -1,30 +1,7 @@
---
- include: remount_usr_rw.yml
when: evocheck_bin_dir | search ("/usr")
- include: install_local.yml
when: evocheck_force_install == "local"
- name: Scripts dir is present
file:
path: "{{ evocheck_bin_dir }}"
state: directory
owner: root
group: root
mode: "0700"
- name: Copy evocheck.sh
copy:
src: evocheck.sh
dest: "{{ evocheck_bin_dir }}/evocheck.sh"
mode: "0700"
owner: root
force: yes
tags:
- evocheck
- name: Copy evocheck.cf
copy:
src: evocheck.cf
dest: /etc/evocheck.cf
force: no
tags:
- evocheck
- include: install_package.yml
when: evocheck_force_install == "package"