1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/network/tasks/captive_portal.yml

48 lines
1.3 KiB
YAML
Raw Normal View History

- name: Create directory for Captive Portal script
file:
path: /opt/iiab/captive-portal
state: directory
when: py_captive_portal_install
- name: Copy Captive Portal script
template:
src: roles/network/templates/captive_portal/captive_portal.py.j2
dest: /opt/iiab/captive-portal/captive_portal.py
owner: root
group: root
mode: 0740
when: py_captive_portal_install
- name: Copy Captive Portal service file
template:
src: roles/network/templates/captive_portal/captive_portal.service.j2
dest: /etc/systemd/system/captive_portal.service
owner: root
group: root
mode: 0644
when: py_captive_portal_install
- name: Enable captive_portal after copying files
service:
name: captive_portal.service
enabled: yes
when: py_captive_portal_install and py_captive_portal_enabled
- name: Start captive_portal after copying files
service:
name: captive_portal.service
state: started
when: py_captive_portal_install and py_captive_portal_enabled
- name: Disable captive_portal after copying files
service:
name: captive_portal.service
enabled: no
when: py_captive_portal_install and py_captive_portal_enabled
- name: Stop captive_portal after copying files
service:
name: captive_portal.service
state: started
when: py_captive_portal_install and py_captive_portal_enabled