1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/nodogsplash/tasks/rpi.yml

70 lines
2 KiB
YAML
Raw Normal View History

2018-10-31 06:31:15 +00:00
- name: Install package libmicrohttpd12 (Nodogsplash dependencies)
2017-12-05 16:47:49 +00:00
package:
name: libmicrohttpd12
state: present
2018-10-31 06:31:15 +00:00
- name: Download {{ iiab_download_url }}/{{ nodogsplash_arm_deb }} to {{ downloads_dir }}
2017-12-05 16:47:49 +00:00
get_url:
url: "{{ iiab_download_url }}/{{ nodogsplash_arm_deb }}"
dest: "{{ downloads_dir }}/{{ nodogsplash_arm_deb }}"
2017-12-08 05:32:58 +00:00
timeout: "{{ download_timeout }}"
when: internet_available | bool
2017-12-08 05:32:58 +00:00
#async: 300
#poll: 5
2017-12-05 16:47:49 +00:00
2018-10-31 06:31:15 +00:00
- name: Install Nodogsplash
2017-12-05 16:47:49 +00:00
apt:
2018-10-31 06:31:15 +00:00
deb: "{{ downloads_dir }}/{{ nodogsplash_arm_deb }}"
2017-12-05 16:47:49 +00:00
#- name: Create nodogsplash.service # deb file has one
# template:
# backup: no
# src: nodogsplash.service.j2
# dest: "/etc/systemd/system/nodogsplash.service"
# owner: root
# group: root
# mode: 0644
2018-10-31 06:31:15 +00:00
- name: Install custom /etc/nodogsplash/nodogsplash.conf, /etc/nodogsplash/htdocs/splash.html
2017-12-05 16:47:49 +00:00
template:
backup: no
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: root
mode: "{{ item.mode }}"
with_items:
- { src: 'nodogsplash.conf.j2', dest: '/etc/nodogsplash/nodogsplash.conf', mode: '0644'}
- { src: 'splash.html.j2', dest: '/etc/nodogsplash/htdocs/splash.html', mode: '0644'}
# We should probably only start this service on next boot
2018-10-31 06:31:15 +00:00
- name: Enable & Start 'nodogsplash' systemd service, if nodogsplash_enabled
systemd:
2017-12-05 16:47:49 +00:00
name: nodogsplash
enabled: yes
state: started
when: nodogsplash_enabled | bool
2017-12-05 16:47:49 +00:00
2018-10-31 06:31:15 +00:00
- name: Disable 'nodogsplash' systemd service, if not nodogsplash_enabled
systemd:
2017-12-05 16:47:49 +00:00
name: nodogsplash
enabled: no
state: stopped
when: not nodogsplash_enabled
2018-10-31 06:31:15 +00:00
- name: Add 'nodogsplash' variable values to {{ iiab_ini_file }}
2017-12-05 16:47:49 +00:00
ini_file:
2018-10-31 06:31:15 +00:00
path: "{{ iiab_ini_file }}"
2017-12-05 16:47:49 +00:00
section: nodogsplash
option: "{{ item.option }}"
value: "{{ item.value | string }}"
2017-12-05 16:47:49 +00:00
with_items:
2017-12-08 05:43:03 +00:00
- option: name
value: nodogsplash
- option: description
value: '"Nodogsplash is a lightweight Captive Portal."'
- option: source
value: "{{ nodogsplash_arm_deb }}"
- option: enabled
value: "{{ nodogsplash_enabled }}"