Skip to content
Permalink
Browse files

update currency conversions daily(ish) for units

  • Loading branch information...
pigmonkey committed Jul 24, 2019
1 parent 5695dcd commit 24ef24c34aad89a0f9beb907de51b4aad16adff6
@@ -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
@@ -0,0 +1,4 @@
---
- name: restart units_cur
service: name=units_cur.timer state=restarted
when: units.run_on == "all"
@@ -0,0 +1,4 @@
---
dependencies:
- { role: nmtrust }
- { role: systemd }
@@ -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 }}"
@@ -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 %}
@@ -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

0 comments on commit 24ef24c

Please sign in to comment.
You can’t perform that action at this time.