- name: Enable & Restart jupyterhub.service systemd: daemon_reload: yes name: jupyterhub enabled: yes state: restarted when: jupyterhub_enabled - name: Disable & Stop jupyterhub.service systemd: daemon_reload: yes name: jupyterhub enabled: no state: stopped when: not jupyterhub_enabled - name: "Install from template: {{ nginx_conf_dir }}/jupyterhub-nginx.conf" template: src: jupyterhub-nginx.conf dest: "{{ nginx_conf_dir }}/" when: jupyterhub_enabled - name: Disable {{ nginx_conf_dir }}/jupyterhub-nginx.conf file: path: "{{ nginx_conf_dir }}/jupyterhub-nginx.conf" state: absent when: not jupyterhub_enabled - name: Restart 'nginx' systemd service systemd: name: nginx state: restarted