If you prefer to manually create local mirrors for your MCP deployment, refer to MCP Release Notes: Release artifacts for the list of repositories and artifacts required for an installation of MCP.
Warning
Perform the procedure below only in case you need a new downstream, self-hosted repository structure. To fetch and update the Mirantis mirrors, refer to Customize the prebuilt mirrors.
To manually create an Aptly-based local mirror:
Log in to the Salt Master node.
Identify where the container with the aptly
service is running in the
Docker Swarm cluster.
salt -C 'I@docker:swarm:role:master' cmd.run 'docker service ps aptly|head -n3'
Log in to the node where the container with the aptly
service is
running.
Open the console in the container with the aptly
service:
docker exec -it <CONTAINER_ID> bash
In the console, import the public key that will be used to fetch the repository.
Note
The public keys are typically available in the root directory
of the repository and are called Release.key
or Release.gpg
.
Also, you can download the public key from the key server
keys.gnupg.net
.
gpg --no-default-keyring --keyring trustedkeys.gpg --keyserver keys.gnupg.net \
--recv-keys <PUB_KEY_ID>
For example, for the apt.mirantis.com
repository:
gpg --no-default-keyring --keyring trustedkeys.gpg --keyserver keys.gnupg.net \
--recv-keys 24008509A76882D3
Create a local mirror for the specified repository:
Note
You can find the list of repositories in the Repository planning section of the MCP Reference Architecture guide.
aptly mirror create <LOCAL_MIRROR_NAME> <REMOTE_REPOSITORY> <DISTRIBUTION>
For example, for the http://apt.mirantis.com/xenial
repository:
aptly mirror create local.apt.mirantis.xenial http://apt.mirantis.com/xenial stable
Update a local mirror:
aptly mirror update <LOCAL_MIRROR_NAME>
For example, for the local.apt.mirantis.xenial
local mirror:
aptly mirror update local.apt.mirantis.xenial
Verify that the local mirror has been created:
aptly mirror show <LOCAL_MIRROR_NAME>
For example, for the local.apt.mirantis.xenial
local mirror:
aptly mirror show local.apt.mirantis.xenial
Example of system response:
Name: local.apt.mirantis.xenial
Status: In Update (PID 9167)
Archive Root URL: http://apt.mirantis.com/xenial/
Distribution: stable
Components: extra, mitaka, newton, oc31, oc311, oc32, oc323, oc40, oc666, ocata,
salt, salt-latest
Architectures: amd64
Download Sources: no
Download .udebs: no
Last update: never
Information from release file:
Architectures: amd64
Codename: stable
Components: extra mitaka newton oc31 oc311 oc32 oc323 oc40 oc666 ocata salt
salt-latest
Date: Mon, 28 Aug 2017 14:12:39 UTC
Description: Generated by aptly
Label: xenial stable
Origin: xenial stable
Suite: stable
In the Model Designer web UI, set the local_repositories
parameter
to True
to enable using of local mirrors.
Add the local_repo_url
parameter manually to
classes/cluster/<cluster_name>/init.yml
after model generation.