-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for snapd package manager
- Loading branch information
1 parent
4a404cb
commit 4816786
Showing
5 changed files
with
96 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ include: | |
- packages.remote_pkgs | ||
- packages.pips | ||
- packages.gems | ||
- packages.snaps |
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,68 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
{% from "packages/map.jinja" import packages with context %} | ||
{% set req_states = packages.snaps.required.states %} | ||
{% set wanted_snaps = packages.snaps.wanted %} | ||
{% set unwanted_snaps = packages.snaps.unwanted %} | ||
### REQ PKGS (without these, some WANTED SNAPS fail to install/uninstall) | ||
include: | ||
- packages.pkgs | ||
extend: | ||
unwanted_pkgs: | ||
pkg.removed: | ||
- pkgs: {{ packages.snaps.collides }} | ||
{% if req_states %} | ||
- require: | ||
{% for dep in req_states %} | ||
- sls: {{ dep }} | ||
{% endfor %} | ||
{% endif %} | ||
pkg_req_pkgs: | ||
pkg.installed: | ||
- pkgs: [ {{ packages.snaps.package }}, ] | ||
{% if req_states %} | ||
- require: | ||
{% for dep in req_states %} | ||
- sls: {{ dep }} | ||
{% endfor %} | ||
{% endif %} | ||
{% for snap in packages.snaps.service %} | ||
packages-{{ snap }}-service: | ||
service.running: | ||
- name: {{ snap }} | ||
- enable: true | ||
- require: | ||
- pkg: pkg_req_pkgs | ||
- pkg: unwanted_pkgs | ||
{% endfor %} | ||
### SNAPS to install | ||
{% for snap in wanted_snaps %} | ||
packages-snapd-{{ snap }}-wanted: | ||
cmd.run: | ||
- name: snap install {{ 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: | ||
cmd.run: | ||
- name: snap remove {{ snap }} | ||
- onlyif: snap list {{ snap }} | ||
- output_loglevel: quiet | ||
- require: | ||
- pkg: pkg_req_pkgs | ||
- pkg: unwanted_pkgs | ||
{% endfor %} | ||
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