Skip to content

Commit

Permalink
fix(packages): corrected dependency packages & user:group
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Jul 1, 2019
1 parent 4d9e571 commit 20b6c31
Show file tree
Hide file tree
Showing 6 changed files with 1,082 additions and 8 deletions.
3 changes: 0 additions & 3 deletions deepsea/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ deepsea:
pkg:
name: deepsea
deps:
- python3-boto
- python3-rados
- python3-tox
- lsscsi
- jq
- pciutils
Expand Down
1,007 changes: 1,007 additions & 0 deletions deepsea/files/default/Makefile

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion deepsea/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{#- Start imports as #}
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}

{#- Retrieve the config dict only once #}
{#- set _config = salt['config.get'](tplroot, default={}) #}
Expand All @@ -14,7 +15,9 @@
{%- set defaults = salt['grains.filter_by']( default_settings,
default=tplroot,
merge=salt['grains.filter_by']( osfamilymap, grain='os_family',
merge=salt['grains.filter_by']( _config, default='lookup'
merge=salt['grains.filter_by']( osmap, grain='os',
merge=salt['grains.filter_by']( _config, default='lookup'
)
)
)
)
Expand Down
26 changes: 23 additions & 3 deletions deepsea/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
Debian:
pkg:
deps:
- python3-tox
- python3-boto3
- python3-rados
- tox
- gdisk
- iperf

Expand All @@ -24,6 +26,7 @@ RedHat:
enabled: False
pkg:
deps:
- python-boto3
- python3-netaddr
- iperf3
- gdisk
Expand All @@ -35,6 +38,8 @@ Suse:
use_upstream_repo: True
deps:
- python3-tox
- python3-boto3
- python3-rados
- gptfdisk
- iperf
- lsof
Expand All @@ -52,11 +57,26 @@ Suse:

Gentoo: {}

Arch: {}
Arch:
pkg:
deps:
- python-tox
- python-boto3
- python3-rados

Alpine: {}

FreeBSD: {}
FreeBSD:
pkg:
deps:
- py36-boto3
- py36-tox

NetBSD:
pkg:
deps:
- py36-boto3
- py36-tox

OpenBSD: {}

Expand Down
37 changes: 37 additions & 0 deletions deepsea/osmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
#
# Setup variables using grains['os'] based logic.
# You just need to add the key:values for an `os` that differ
# from `defaults.yaml` + `os_family.yaml`.
# Only add an `os` which is/will be supported by the formula
#
# If you do not need to provide defaults via the `os` grain,
# you will need to provide at least an empty dict in this file, e.g.
# osmap: {}
---
# os_family: Debian
Ubuntu: {}

Raspbian: {}

# os_family: RedHat
Fedora:
pkg:
deps:
- python3-boto
- python3-tox

CentOS: {}

# os_family: Suse
openSUSE: {}

# os_family: Gentoo
Funtoo: {}

# os_family: Arch
Manjaro: {}

# os_family: Solaris
SmartOS: {}
12 changes: 11 additions & 1 deletion deepsea/source/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import deepsea with context %}
{%- from tplroot ~ "/jinja/macros.jinja" import format_kwargs with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
deepsea-package-source-install-file-directory:
file.directory:
Expand Down Expand Up @@ -41,11 +42,20 @@ deepsea-package-source-install-source-extracted:
- recurse:
- user
- group
file.managed:
- name: {{ deepsea.pkg.source.name }}/Makefile
- source: {{ files_switch(['Makefile'], lookup='deepsea-package-source-install-source-extracted') }}
deepsea-package-source-install-cmd-run-make-install:
file.replace:
- name: /usr/bin/salt-api
- pattern: '/usr/bin/python2'
- repl: '/usr/bin/python3'
- onlyif: test -x /usr/bin/salt-api
cmd.run:
- cwd: {{ deepsea.pkg.source.name }}
- name: make install
- names:
- make install
- unless:
- test -f /usr/local/bin/deepsea
- require:
Expand Down

0 comments on commit 20b6c31

Please sign in to comment.