summaryrefslogtreecommitdiff
path: root/roles/monitoring/sachet/tasks/smstools.yml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-07-22 01:11:31 +0200
committerChristian Pointner <equinox@spreadspace.org>2022-07-22 01:11:31 +0200
commit967953dd66c0963e40e3d184d04a3e431b9ff705 (patch)
tree454af70d3dd0a1f3bee106fe18c90dcb6a95c387 /roles/monitoring/sachet/tasks/smstools.yml
parentadd role for sachet (diff)
monitoring/sachet: add task to setup smstools
Diffstat (limited to 'roles/monitoring/sachet/tasks/smstools.yml')
-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