--- - name: Install Jupyterhub hosts: UpskillChallengeNode gather_facts: no tasks: - name: Create NodeJS directory ansible.builtin.file: path: /opt/nodesource state: directory mode: 0755 - name: Create Jupyterhub config directory ansible.builtin.file: path: /etc/jupyterhub state: directory mode: 0755 - name: Download NodeJS apt configuration ansible.builtin.get_url: url: "https://deb.nodesource.com/setup_14.x" dest: /opt/nodesource checksum: "sha512:a0451fa9a2d679fb43a1e703eb1ae0e0ad62da3eac73ff5a25abc71cbe908eb463ee478c1f2f7687532b56106956634afb72129572db347334bd1b7fbf99dcdc" mode: 0755 - name: run NodeJS configuration script ansible.builtin.shell: /opt/nodesource/setup_14.x args: chdir: /opt/nodesource creates: /etc/apt/sources.list.d/nodesource.list - name: update and upgrade packages ansible.builtin.apt: update_cache: yes - name: install prerequisites [apt] ansible.builtin.apt: package: - sudo - python3 - python3-pip - gcc - g++ - make - build-essential - nodejs - nginx - certbot - python3-certbot-nginx state: present - name: install prerequisites [pip] ansible.builtin.pip: name: - jupyterhub - notebook - virtualenv - name: install prerequisites [npm] community.general.npm: global: yes name: configurable-http-proxy - name: copy Jupyterhub service file ansible.builtin.copy: src: jupyterhub.service dest: /etc/systemd/system/ - name: copy Jupyterhub config file ansible.builtin.copy: src: jupyterhub_config.py dest: /etc/jupyterhub - name: daemon-reload ansible.builtin.systemd: name: jupyterhub state: restarted daemon_reload: yes