Via https://ubuntu.com/esm#faq
"We're mirroring the repository on our internal Landscape server. Can we still get Ubuntu ESM if using Landscape? ESM is just a regular Ubuntu archive, but authenticated and served over HTTPS. Archive mirroring is already available in Landscape and is the only supported mechanism for mirroring the ESM archive."
# Extract login/pass
> cat /etc/apt/auth.conf.d/90ubuntu-advantage
> /usr/bin/aptly -config /etc/aptly.conf mirror create -architectures="amd64" -with-sources=false -with-udebs=false ubuntu-esm-trusty https://<login>:<pass>@esm.ubuntu.com/ubuntu trusty-updates
# Security repo
> aptly mirror show esm-ubuntu-trusty-security|grep packages
Number of packages: 841
# OR
> curl -v https://<login>:<pass>@esm.ubuntu.com/ubuntu
We created a script exactly for this cause: https://github.com/APIVersa/rSyncOverHTTP
You can use it along with the following instructions to do exactly this and mirror the esm repos:
(use the command pro status --all to check)
Congrats, you should now have a working mirror. Be sure in step 10, supply for -d the MAIN DIRECTORY URL OF SERVER, NOT THE SUBDIRECTORY FOR THE SPECIFIC ESM MODULE.
Here is an example run after installing following instructions and using above instructions:
rsyncoverhttp -s https://bearer:INFRA_PASSWORD_HERE@esm.ubuntu.com/infra/ -d /var/www/esm/ -nr
rsyncoverhttp -s https://bearer:APP_PASSWORD_HERE@esm.ubuntu.com/apps/ -d /var/www/esm/ -nr
** NOTE ** YOU WILL HAVE A DIFFERENT PASSWORD FOR EACH MODULE / DIRECTORY ON esm.ubuntu.com
Thanks :)