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

41 lines
766 B
YAML

- name: systemd daemon-reload
systemd:
daemon_reload: yes
# enable or disable
- name: Enable & Restart jupyterhub
systemd:
name: "{{ item }}"
enabled: yes
state: restarted
with_items:
- jupyter
when: jupyter_enabled
- name: Disable jupyterhub
systemd:
name: "{{ item }}"
enabled: no
state: stopped
with_items:
- jupyter
when: not jupyter_enabled
- name: Put the nginx config file in place
template:
src: jupyter-nginx.conf
dest: "{{ nginx_conf_dir }}/"
when: jupyter_enabled
- name: Disable jupyterhub
file:
path: "{{ nginx_conf_dir }}/jupyter-nginx.conf"
state: absent
when: not jupyter_enabled
- name: Restart 'nginx' systemd service
systemd:
name: nginx
state: restarted