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
Install Ubuntu 20.04 Server.
Define server’s host it the Ansible inventory:
[servers] tp-serverAdjust the content of the playbook
server-repository.ymlto 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]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:
ufrmath.computer_labs.server_repositoryto setup the repository with aptly;ufrmath.computer_labs.add_debto add software to the repository.
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: