mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
update currency conversions daily(ish) for units
This commit is contained in:
parent
5695dcd45a
commit
24ef24c34a
7 changed files with 60 additions and 2 deletions
|
|
@ -89,7 +89,6 @@ base_packages:
|
|||
- python-docs
|
||||
- python2-docs
|
||||
- screen
|
||||
- units
|
||||
- python-pipenv
|
||||
- termdown
|
||||
|
||||
|
|
@ -292,6 +291,9 @@ syncthing:
|
|||
run_on: trusted
|
||||
|
||||
mirrorlist:
|
||||
run_on: trusted
|
||||
run_on: trusted
|
||||
|
||||
units:
|
||||
run_on: trusted
|
||||
|
||||
kernel_parameters: "quiet consoleblank=60 i915.enable_psr=2"
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
- { role: goesimage, tags: ['goesimage'], when: "goesimage is defined" }
|
||||
- { role: syncthing, tags: ['syncthing'], when: "syncthing is defined" }
|
||||
- { role: mirrorlist, tags: ['mirrorlist'], when: "mirrorlist is defined" }
|
||||
- { role: units, tags: ['units'], when: "units is defined" }
|
||||
- { role: logitech, tags: ['logitech'] }
|
||||
vars_prompt:
|
||||
- name: user_password
|
||||
|
|
|
|||
4
roles/units/handlers/main.yml
Normal file
4
roles/units/handlers/main.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- name: restart units_cur
|
||||
service: name=units_cur.timer state=restarted
|
||||
when: units.run_on == "all"
|
||||
4
roles/units/meta/main.yml
Normal file
4
roles/units/meta/main.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
dependencies:
|
||||
- { role: nmtrust }
|
||||
- { role: systemd }
|
||||
25
roles/units/tasks/main.yml
Normal file
25
roles/units/tasks/main.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- name: Install GNU Units
|
||||
pacman:
|
||||
name: units
|
||||
state: present
|
||||
|
||||
- name: Push GNU Units currency update service file
|
||||
template:
|
||||
src: units_cur.service.j2
|
||||
dest: /etc/systemd/system/units_cur.service
|
||||
notify:
|
||||
- reload systemd config
|
||||
|
||||
- name: Push GNU Units currency update timer file
|
||||
template:
|
||||
src: units_cur.timer.j2
|
||||
dest: /etc/systemd/system/units_cur.timer
|
||||
notify:
|
||||
- reload systemd config
|
||||
- restart units_cur
|
||||
|
||||
- include_tasks: roles/nmtrust/tasks/unit.yml
|
||||
vars:
|
||||
unit: units_cur.timer
|
||||
run_on: "{{ units.run_on }}"
|
||||
10
roles/units/templates/units_cur.service.j2
Normal file
10
roles/units/templates/units_cur.service.j2
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# {{ ansible_managed }}
|
||||
[Unit]
|
||||
Description=GNU Units Currency Update Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
ExecStart=/usr/bin/units_cur{% if 'args' in units %} {{ units.args }}{% endif %}
|
||||
12
roles/units/templates/units_cur.timer.j2
Normal file
12
roles/units/templates/units_cur.timer.j2
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# {{ ansible_managed }}
|
||||
[Unit]
|
||||
Description=GNU Units Currency Update Timer
|
||||
|
||||
[Timer]
|
||||
OnCalendar=daily
|
||||
Persistent=true
|
||||
RandomizedDelaySec=3600
|
||||
Unit=units_cur.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue