|
| 1 | +- name: nodogsplash dependencies |
| 2 | + package: |
| 3 | + name: libmicrohttpd12 |
| 4 | + state: present |
| 5 | + |
| 6 | +- name: Get the nodogsplash software |
| 7 | + get_url: |
| 8 | + url: "{{ iiab_download_url }}/{{ nodogsplash_arm_deb }}" |
| 9 | + dest: "{{ downloads_dir }}/{{ nodogsplash_arm_deb }}" |
| 10 | + when: internet_available |
| 11 | + async: 300 |
| 12 | + poll: 5 |
| 13 | + |
| 14 | +- name: Install nodogsplash |
| 15 | + apt: |
| 16 | + deb="{{ downloads_dir }}/{{ nodogsplash_arm_deb }}" |
| 17 | + |
| 18 | +#- name: Create nodogsplash.service # deb file has one |
| 19 | +# template: |
| 20 | +# backup: no |
| 21 | +# src: nodogsplash.service.j2 |
| 22 | +# dest: "/etc/systemd/system/nodogsplash.service" |
| 23 | +# owner: root |
| 24 | +# group: root |
| 25 | +# mode: 0644 |
| 26 | + |
| 27 | +- name: Install custom files |
| 28 | + template: |
| 29 | + backup: no |
| 30 | + src: "{{ item.src }}" |
| 31 | + dest: "{{ item.dest }}" |
| 32 | + owner: root |
| 33 | + group: root |
| 34 | + mode: "{{ item.mode }}" |
| 35 | + with_items: |
| 36 | + - { src: 'nodogsplash.conf.j2', dest: '/etc/nodogsplash/nodogsplash.conf', mode: '0644'} |
| 37 | + - { src: 'splash.html.j2', dest: '/etc/nodogsplash/htdocs/splash.html', mode: '0644'} |
| 38 | + |
| 39 | +# We should probably only start this service on next boot |
| 40 | +- name: Enable nodogsplash service |
| 41 | + service: |
| 42 | + name: nodogsplash |
| 43 | + enabled: yes |
| 44 | + state: started |
| 45 | + when: nodogsplash_enabled |
| 46 | + |
| 47 | +- name: Disable nodogsplash service |
| 48 | + service: |
| 49 | + name: nodogsplash |
| 50 | + enabled: no |
| 51 | + state: stopped |
| 52 | + when: not nodogsplash_enabled |
| 53 | + |
| 54 | +- name: Add 'nodogsplash' to list of services at /etc/iiab/iiab.ini |
| 55 | + ini_file: |
| 56 | + dest: "{{ service_filelist }}" |
| 57 | + section: nodogsplash |
| 58 | + option: "{{ item.option }}" |
| 59 | + value: "{{ item.value }}" |
| 60 | + with_items: |
| 61 | + - option: name |
| 62 | + value: nodogsplash |
| 63 | + - option: description |
| 64 | + value: '"Nodogsplash is a lightweight Captive Portal."' |
| 65 | + - option: source |
| 66 | + value: "{{ nodogsplash_arm_deb }}" |
| 67 | + - option: enabled |
| 68 | + value: "{{ nodogsplash_enabled }}" |
0 commit comments