-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from netmanagers/master
Add repo state and possibility to specify package name
- Loading branch information
Showing
10 changed files
with
139 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Debian: | ||
repo: | ||
url_base: https://download.docker.com/linux/{{ grains['os'] |lower }} | ||
key_url: https://download.docker.com/linux/{{ grains['os'] |lower }}/gpg | ||
version: {{ grains['oscodename'] |lower }} | ||
file: /etc/apt/sources.list.d/docker.list | ||
RedHat: | ||
repo: | ||
url_base: https://download.docker.com/linux/{{ grains['os'] |lower }}/{{ grains['osmajorrelease'] }}/$basearch/stable/ | ||
key_url: https://download.docker.com/linux/{{ grains['os'] |lower }}/gpg | ||
version: {{ grains['oscodename'] |lower }} | ||
file: /etc/yum.repos.d/docker-ce.repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{% from "docker/map.jinja" import docker with context %} | ||
{% set repo_state = 'absent' %} | ||
{% if docker.use_upstream_repo or docker.use_old_repo %} | ||
{% set repo_state = 'managed' %} | ||
{% endif %} | ||
{% set humanname_old = 'Old ' if docker.use_old_repo else '' %} | ||
{%- if grains['os']|lower in ('debian', 'ubuntu',) %} | ||
{% set url = 'https://apt.dockerproject.org/repo ' ~ grains["os"]|lower ~ '-' ~ grains["oscodename"] ~ ' main' if docker.use_old_repo else docker.repo.url_base ~ ' ' ~ docker.repo.version ~ ' stable' %} | ||
docker package repository: | ||
pkgrepo.{{ repo_state }}: | ||
- humanname: {{ grains["os"] }} {{ grains["oscodename"]|capitalize }} {{ humanname_old }}Docker Package Repository | ||
- name: deb {{ url }} | ||
- file: {{ docker.repo.file }} | ||
{% if docker.use_old_repo %} | ||
- keyserver: keyserver.ubuntu.com | ||
- keyid: 58118E89F3A912897C070ADBF76221572C52609D | ||
{% else %} | ||
- key_url: {{ docker.repo.key_url }} | ||
{% endif %} | ||
- refresh_db: True | ||
- require_in: | ||
- pkg: docker package | ||
- require: | ||
- pkg: docker package dependencies | ||
{%- elif grains['os']|lower in ('centos', 'fedora') %} | ||
{% set url = 'https://yum.dockerproject.org/repo/main/centos/$releasever/' if docker.use_old_repo else docker.repo.url_base %} | ||
docker package repository: | ||
pkgrepo.{{ repo_state }}: | ||
- name: docker-ce-stable | ||
- humanname: {{ grains['os'] }} {{ grains["oscodename"]|capitalize }} {{ humanname_old }}Docker Package Repository | ||
- baseurl: {{ url }} | ||
- enabled: 1 | ||
- gpgcheck: 1 | ||
{% if docker.use_old_repo %} | ||
- gpgkey: https://yum.dockerproject.org/gpg | ||
{% else %} | ||
- gpgkey: {{ docker.repo.key_url }} | ||
{% endif %} | ||
- require_in: | ||
- pkg: docker package | ||
- require: | ||
- pkg: docker package dependencies | ||
{%- else %} | ||
docker package repository: {} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters