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

Add ability to install Snaps with classic confinement #20

Merged
merged 2 commits into from
Apr 18, 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
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ You can specify:
You can specify:

* ``wanted`` snapd packages, which will be installed using snap.
* ``classic`` snapd packages, chich will be installed using snap with classic confinement.
* ``unwanted`` snapd packages, which will be uninstalled using snap.
* ``required system packages`` on which any of the ``wanted`` snapd packages
depend for their correct installation.
Expand Down
1 change: 1 addition & 0 deletions packages/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ packages:
symlink: False
service: ['snapd',]
wanted: []
classic: []
unwanted: []
required:
states: []
Expand Down
13 changes: 13 additions & 0 deletions packages/snaps.sls
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{% set unwanted_packages = packages.pkgs.unwanted + packages.snaps.collides %}

{% set wanted_snaps = packages.snaps.wanted %}
{% set classic_snaps = packages.snaps.classic %}
{% set unwanted_snaps = packages.snaps.unwanted %}

{%- if packages.snaps.package %}
Expand Down Expand Up @@ -68,6 +69,18 @@ packages-snapd-{{ snap }}-wanted:
- pkg: unwanted_pkgs
{% endfor %}

### SNAPS to install in classic mode
{% for snap in classic_snaps %}
packages-snapd-{{ snap }}-classic:
cmd.run:
- name: snap install --classic {{ snap }}
- unless: snap list {{ snap }}
- output_loglevel: quiet
- require:
- pkg: pkg_req_pkgs
- pkg: unwanted_pkgs
{% endfor %}

### SNAPS to uninstall
{% for snap in unwanted_snaps %}
packages-snapd-{{ snap }}-unwanted:
Expand Down
2 changes: 2 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ packages:
snaps:
wanted:
- hello-world
classic:
- test-snapd-hello-classic
unwanted:
- goodbye-world

Expand Down