geerlingguy / ansible-role-docker

Ansible Role - Docker
https://galaxy.ansible.com/geerlingguy/docker/
MIT License
1.81k stars 853 forks source link

Feature : Replace the official docker repo by a remote repo. #374

Closed Silicoman closed 1 year ago

Silicoman commented 2 years ago

Hi Thanks for your work. I'm actually using your role to configure a server without rewriting the official guideline but with a little modification. :)

Why this MR ?

I'm working under private network and using artefacts managers Software to got mirrors (Ex: Nexus, Artifactory).

So i have to modify the role to got natively docker-ce.repo configured as i want. I dont want to setup a repo file with custom configuration. I wont to archive the file... I suggest, it's to put this remote depo change , transparent to user.

So if you are interested by the MR. It will be a pleasure to share this simple modification for RedHat distributions. It's may open the subject to others distributions.

How it was used/ tested?

Exemple:

roles: 
  - role: ansible-roler-docker
vars : 
  docker_repo_url: https://artefacts.enterprise.com/remote-rpm-download.docker.com/linux
  docker_yum_repo_url: "{{ docker_repo_url  }}/centos/docker-{{ docker_edition }}.repo"
  docker_yum_gpg_key: "{{ docker_repo_url }}/centos/gpg"

Before MR : head -27 /etc/yum.repos.d/docker-ce.repo

[docker-ce-stable] name=Docker CE Stable - $basearch baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable enabled=1 gpgcheck=1 gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-stable-debuginfo] name=Docker CE Stable - Debuginfo $basearch baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/stable enabled=0 gpgcheck=1 gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-stable-source] name=Docker CE Stable - Sources baseurl=https://download.docker.com/linux/centos/$releasever/source/stable enabled=0 gpgcheck=1 gpgkey=https://download.docker.com/linux/centos/gpg

[docker-ce-test] name=Docker CE Test - $basearch baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/test enabled=0 gpgcheck=1 gpgkey=https://download.docker.com/linux/centos/gpg

After MR : head -27 /etc/yum.repos.d/docker-ce.repo

[docker-ce-stable] name=Docker CE Stable - $basearch baseurl=https://artefacts.enterprise.com/remote-rpm-download.docker.com/linux/centos/$releasever/$basearch/stable enabled=1 gpgcheck=1 gpgkey=https://artefacts.enterprise.com/remote-rpm-download.docker.com/linux/centos/gpg

[docker-ce-stable-debuginfo] name=Docker CE Stable - Debuginfo $basearch baseurl=https://artefacts.enterprise.com/remote-rpm-download.docker.com/linux/centos/$releasever/debug-$basearch/stable enabled=0 gpgcheck=1 gpgkey=https://artefacts.enterprise.com/remote-rpm-download.docker.com/linux/centos/gpg

[docker-ce-stable-source] name=Docker CE Stable - Sources baseurl=https://artefacts.enterprise.com/remote-rpm-download.docker.com/linux/centos/$releasever/source/stable enabled=0 gpgcheck=1 gpgkey=https://artefacts.enterprise.com/remote-rpm-download.docker.com/linux/centos/gpg

[docker-ce-test] name=Docker CE Test - $basearch baseurl=https://artefacts.enterprise.com/remote-rpm-download.docker.com/linux/centos/$releasever/$basearch/test enabled=0 gpgcheck=1 gpgkey=https://artefacts.enterprise.com/remote-rpm-download.docker.com/linux/centos/gpg

Have a nice day :)

stale[bot] commented 1 year ago

This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark pull requests as stale.

stale[bot] commented 1 year ago

This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.