---
- name: Install usb_modeswitch
  apt: pkg=usb-modeswitch state=latest

- name: Install miniupnpc
  apt: pkg=miniupnpc state=latest

- name: Turn on max_usb_current
  lineinfile: dest=/boot/config.txt line='max_usb_current=1'
  notify: reboot

- name: Add usb_modeswitch configuration file
  copy: src=12d1:1f01 dest=/etc/usb_modeswitch.d/12d1:1f01

- name: Add udev rule to run usb_modeswitch with custom config
  copy: src=90-huawei-e3772h.rules dest=/etc/udev/rules.d/90-huawei-e3772h.rules
  notify: restart-udev

- name: Add dhcpcd hook to set up port forwards
  template: src=90-upnpc.conf.j2 dest=/lib/dhcpcd/dhcpcd-hooks/90-upnpc.conf
  when: upnpc_port_forwards is defined
##############################################################################
#
#  Installs usb_modeswitch and custom udev rule to support Huawei USB modems
#
#  Also supports setting up port forwards from internet to Huawei's local address
#  using UPnP.
#
#  Usage:
#
#    - role: huawei_e3372h
#      upnpc_port_forwards: "500 UDP 4500 UDP 1701 UDP"     # These ports are forwarded from public IP to 192.168.8.100
#
---
- name: Install usb_modeswitch
  apt: pkg=usb-modeswitch state=latest

- name: Install miniupnpc
  apt: pkg=miniupnpc state=latest

- name: Turn on max_usb_current
  lineinfile: dest=/boot/config.txt line='max_usb_current=1'
  notify: reboot

- name: Add usb_modeswitch configuration file
  copy: src=12d1:1f01 dest=/etc/usb_modeswitch.d/12d1:1f01

- name: Add udev rule to run usb_modeswitch with custom config
  copy: src=90-huawei-e3772h.rules dest=/etc/udev/rules.d/90-huawei-e3772h.rules
  notify: restart-udev

- name: Add dhcpcd hook to set up port forwards
  template: src=90-upnpc.conf.j2 dest=/lib/dhcpcd/dhcpcd-hooks/90-upnpc.conf
  when: upnpc_port_forwards is defined
Add some documentation for huawei_e3372h role
Add some documentation for huawei_e3372h role
