--- - name: install smstools and usb-modeswitch apt: name: - smstools - usb-modeswitch state: present - name: add user sachet to smsd group user: name: sachet groups: smsd append: yes - 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