Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pkg installed (not latest), allow_updates, version #153

Merged
merged 1 commit into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docker/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ docker:
refresh_repo: True
config: []

pkg:
version:
allow_updates: False

pip:
pkgname: python-pip
upgrade: False
Expand Down
7 changes: 5 additions & 2 deletions docker/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ docker package repository:
{%- endif %}

docker package:
{%- if "version" in docker %}
pkg.installed:
{%- if "version" in docker %}
{%- if grains["oscodename"]|lower == 'jessie' %}
- name: docker.io
- version: {{ docker.version }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this the same as docker.pkg.version ?

Copy link
Member Author

@noelmcloughlin noelmcloughlin Jun 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and No. That docker.version is generated by map.jinja and docker-pkg:lookup:version pillar. But docker-pkg namespace is, or should be, depreciated.

There is repetition in the code block - I could fix that but small PR gets too big then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem as long as you have it on your radar, we can merge this one, I rather see small PR's which document the Transitions.

Expand All @@ -103,7 +103,6 @@ docker package:
{%- endif %}
- hold: True
{%- else %}
pkg.latest:
{%- if grains["oscodename"]|lower == 'jessie' %}
- name: docker.io
- fromrepo: {{ docker.kernel.pkg.fromrepo }}
Expand All @@ -122,6 +121,10 @@ docker package:
- pkgrepo: docker package repository
{%- endif %}
- file: docker-config
- allow_updates: {{ docker.pkg.allow_updates }}
{% if docker.pkg.version %}
- version: {{ docker.pkg.version }}
{% endif %}

docker-config:
file.managed:
Expand Down
5 changes: 5 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ docker:
# version of docker-compose to install (defaults to latest)
#compose_version: 1.9.0

pkg:
# Package handling
#version: 1.13.1
#allow_updates: True

# Global functions for docker_container states
containers:
skip_translate: ports
Expand Down