summaryrefslogtreecommitdiff
path: root/roles/monitoring/sachet/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/monitoring/sachet/tasks')
-rw-r--r--roles/monitoring/sachet/tasks/smstools.yml34
1 files changed, 31 insertions, 3 deletions
diff --git a/roles/monitoring/sachet/tasks/smstools.yml b/roles/monitoring/sachet/tasks/smstools.yml
index 9631a3b7..1b41fadb 100644
--- a/roles/monitoring/sachet/tasks/smstools.yml
+++ b/roles/monitoring/sachet/tasks/smstools.yml
@@ -1,7 +1,9 @@
---
-- name: install smstools
+- name: install smstools and usb-modeswitch
apt:
- name: smstools
+ name:
+ - smstools
+ - usb-modeswitch
state: present
- name: add user sachet to smsd group
@@ -10,4 +12,30 @@
groups: smsd
append: yes
-## TODO: configure smstools
+- name: configure usb-modeswitch
+ when: sachet_usbmodeswitch is defined
+ loop: "{{ sachet_usbmodeswitch | dict2items }}"
+ loop_control:
+ label: "{{ item.key }}"
+ copy:
+ content: "{{ item.value }}"
+ dest: "/etc/usb_modeswitch.d/{{ item.key }}"
+
+- name: configure smstool device list
+ ini_file:
+ path: /etc/smsd.conf
+ section: ""
+ option: devices
+ value: "{{ sachet_smstools_devices | list | join(', ') }}"
+ notify: restart smstools
+
+- name: configure smstool devices
+ loop: "{{ sachet_smstools_devices | smstools_device_options }}"
+ loop_control:
+ label: "{{ item.device }} ({{ item.option }})"
+ ini_file:
+ path: /etc/smsd.conf
+ section: "{{ item.device }}"
+ option: "{{ item.option }}"
+ value: "{{ item.value }}"
+ notify: restart smstools