mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			69 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| - name: "Set 'nodejs_install: True' and 'nodejs_enabled: True'"
 | |
|   set_fact:
 | |
|     nodejs_install: True
 | |
|     nodejs_enabled: True
 | |
| 
 | |
| - name: NODEJS - run 'nodejs' role (attempt to install & enable Node.js)
 | |
|   include_role:
 | |
|     name: nodejs
 | |
| 
 | |
| - name: FAIL (STOP THE INSTALL) IF 'nodejs_installed is undefined'
 | |
|   fail:
 | |
|     msg: "JupyterHub install cannot proceed, as Node.js is not installed."
 | |
|   when: nodejs_installed is undefined
 | |
| 
 | |
| 
 | |
| - name: Make the directories to hold JupyterHub config
 | |
|   file:
 | |
|     state: directory
 | |
|     path: "{{ item }}"
 | |
|   with_items:
 | |
|     - "{{ jupyterhub_venv }}/etc/jupyter"
 | |
|     - "{{ jupyterhub_venv }}/etc/jupyterhub"
 | |
|     - "{{ jupyterhub_venv }}/etc/systemd"
 | |
| 
 | |
| - name: Use npm to install configurable-http-proxy
 | |
|   npm:
 | |
|     name: configurable-http-proxy
 | |
|     global: yes
 | |
|     state: latest
 | |
| 
 | |
| - name: "Use pip to install into a virtual environment: {{ jupyterhub_venv }} (~229 MB)"
 | |
|   pip:
 | |
|     name:
 | |
|       - pip
 | |
|       - wheel
 | |
|       - ipywidgets
 | |
|       - jupyterhub
 | |
|       - jupyterlab
 | |
|       - jupyterhub_firstuseauthenticator
 | |
|       - jupyterhub-systemdspawner
 | |
|     virtualenv: "{{ jupyterhub_venv }}"    # /opt/iiab/jupyterhub
 | |
|     virtualenv_site_packages: no
 | |
|     virtualenv_command: /usr/bin/virtualenv
 | |
|     virtualenv_python: python3
 | |
|     extra_args: "--no-cache-dir"
 | |
|   when: internet_available
 | |
| 
 | |
| - name: "Install from template: {{ jupyterhub_venv }}/etc/jupyterhub/jupyterhub_config.py"
 | |
|   template:
 | |
|     src: jupyterhub_config.py
 | |
|     dest: "{{ jupyterhub_venv }}/etc/jupyterhub/"
 | |
| 
 | |
| - name: "Install from template: /etc/systemd/system/jupyterhub.service"
 | |
|   template:
 | |
|     src: jupyterhub.service
 | |
|     dest: /etc/systemd/system/
 | |
| 
 | |
| 
 | |
| # RECORD JupyterHub AS INSTALLED
 | |
| 
 | |
| - name: "Set 'jupyterhub_installed: True'"
 | |
|   set_fact:
 | |
|     jupyterhub_installed: True
 | |
| 
 | |
| - name: "Add 'jupyterhub_installed: True' to {{ iiab_state_file }}"
 | |
|   lineinfile:
 | |
|     path: "{{ iiab_state_file }}"    # /etc/iiab/iiab_state.yml
 | |
|     regexp: '^jupyterhub_installed'
 | |
|     line: 'jupyterhub_installed: True'
 |