1
0
Fork 0
mirror of https://github.com/roles-ansible/role_akku_warning.git synced 2024-08-16 10:09:50 +02:00

Optimize role order

This commit is contained in:
L3D 2020-02-20 23:30:57 +01:00
parent 5f68a6f447
commit d4cafafddf
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 37 additions and 26 deletions

View file

@ -1,3 +1,6 @@
[![Build Status](https://travis-ci.org/chaos-bodensee/role_akku_warning.svg?branch=master)](https://travis-ci.org/chaos-bodensee/role_akku_warning)
[![MIT License](https://raw.githubusercontent.com/chaos-bodensee/role_akku_warning/master/.github/license.svg?sanitize=true)](https://github.com/chaos-bodensee/role_akku_warning/blob/master/LICENSE)
Akku Warning role
---------------------
<a href="https://galaxy.ansible.com/do1jlr/akku_warning"><img width="80px" src="https://galaxy.ansible.com/assets/galaxy-logo-02.svg"/></a>

View file

@ -12,5 +12,8 @@ install_and_enable_cronie: false
# play a video in the background with sound
multimedia_akku_warning: true
# you want to install missing packages?
manage_packages_akku_warning: true
# version check for this playbook
submodules_versioncheck: true

View file

@ -0,0 +1,19 @@
---
- name: copy sound warning script
become: yes
template:
src: 'templates/akku.sh'
dest: '/opt/akku.sh'
owner: 'root'
group: 'root'
mode: '0755'
- name: copy sound warning video
become: yes
copy:
src: "{{ akku_sound_src }}"
dest: "{{ akku_sound_dest }}"
owner: 'root'
group: 'root'
mode: '0644'
when: multimedia_akku_warning|bool

View file

@ -2,24 +2,7 @@
- include_tasks: versioncheck.yml
when: submodules_versioncheck|bool
- name: copy sound warning script
become: yes
template:
src: 'templates/akku.sh'
dest: '/opt/akku.sh'
owner: 'root'
group: 'root'
mode: '0755'
- name: copy sound warning video
become: yes
copy:
src: "{{ akku_sound_src }}"
dest: "{{ akku_sound_dest }}"
owner: 'root'
group: 'root'
mode: '0644'
when: multimedia_akku_warning|bool
- include_tasks: copy_media_files.yml
- name: install zenity and mpv for notifications
become: yes
@ -28,6 +11,17 @@
- zenity
- mpv
state: present
when: manage_packages_akku_warning | bool
- name: Make sure cron is installed
become: true
package:
name:
- cronie
state: present
when:
- manage_packages_akku_warning | bool
- install_and_enable_cronie|bool
- name: Check akku every 2 minutes
become: yes
@ -38,14 +32,6 @@
user: '{{ akku_user }}'
cron_file: /etc/crontab
- name: Make sure cron is installed
become: true
when: install_and_enable_cronie|bool
package:
name:
- cronie
state: present
- name: Make sure cron is running
become: true
when: install_and_enable_cronie|bool