Setup repository server

This page describe how to configure a server running Ubuntu 20.04 Server to serve a custom apt repository using aptly. This can be the same server as the one used for netboot or another one.

Quick way

  1. Install Ubuntu 20.04 Server.

  2. Define server’s host it the Ansible inventory:

    [servers]
    tp-server
    
  3. Adjust the content of the playbook server-repository.yml to your need:

    - name: Setup custom repository server
      hosts: tp-server
      gather_facts: yes
    
      collections:
        - ufrmath.computer_labs
    
      roles:
    
      - role: server_repository
        ntp_server: ntp.example.com
        repository_name: "focal-tp"
    
      - role: add_deb
        packages:
          codium: latest
          rstudio: latest
          freefem: latest
          veyon: latest
          deaduction: latest
          command-configure: '4.8.0'
        files:
          - /tmp/packages/mathematica_13.2.0_amd64.deb
          - /tmp/packages/maple_2022.2_amd64.deb
          - /tmp/packages/matlab_2022b3_amd64.deb
    
      vars:
        ansible_ssh_pass: test
        ansible_become_pass: test
        allowed_ips: [10.0.2.0/24, 10.0.3.0/24]
    
  4. Run the playbook:

    ansible-playbook -i hosts server-repository.yml
    

In case additional proprietary scientific software (Mathematica, MATLAB, or Maple) are needed to be included in the repository, they should be added manually as described in Adding proprietary scientific software.

Documentation

The playbook server-repository.yml uses two roles:

Details

The role ufrmath.computer_labs.server_repository setup an aptly repository and serve it using nginx.

The role ufrmath.computer_labs.add_deb adds software to the repository either from internet or from local Debian packages.

The main steps done automatically by the Ansible roles are detailed in a “manual” way: