From 0dc390618ab35cd422c3b7806b90dae0d9c91441 Mon Sep 17 00:00:00 2001 From: Andrey Abramov Date: Wed, 19 Jun 2019 15:47:44 +0300 Subject: [PATCH] test fixes --- sls/collectd/pkg.sls | 1 + sls/core/binutils.sls | 11 ++++------- sls/editors/emacs/pkg.sls | 5 +++-- sls/editors/emacs/yaml-mode.sls | 9 +++------ sls/filebeat/pkg.sls | 15 ++++----------- sls/gentoo/dev-utils.sls | 10 ++++------ sls/gentoo/portage/init.sls | 12 +++--------- sls/go/init.sls | 3 --- sls/jemalloc/init.sls | 6 +++--- sls/keepalived/pkg.sls | 4 +++- sls/lib/glibc.sls | 10 ++++------ sls/pkg/common | 1 - 12 files changed, 32 insertions(+), 55 deletions(-) diff --git a/sls/collectd/pkg.sls b/sls/collectd/pkg.sls index 787b810..e3dc332 100644 --- a/sls/collectd/pkg.sls +++ b/sls/collectd/pkg.sls @@ -1,6 +1,7 @@ {% import 'pkg/common' as pkg %} include: - gentoo.makeconf + - lib.glibc {%- set extra_plugins = salt.pillar.get('collectd:extra-plugins', []) %} {% set makeconf_collectd_plugins = 'aggregation apcups cgroups chrony contextswitch conntrack cpu cpufreq csv curl curl_json curl_xml dbi df disk entropy ethstat exec filecount fscache interface iptables ipvs irq load logfile memcached memory nfs netlink network nginx numa hugepages processes python sensors swap syslog log_logstash statsd table tail target_notification treshold unixsock uptime users vmem write_graphite write_riemann write_prometheus ' + ' '.join(extra_plugins) %} diff --git a/sls/core/binutils.sls b/sls/core/binutils.sls index 26d157f..c25530a 100644 --- a/sls/core/binutils.sls +++ b/sls/core/binutils.sls @@ -1,15 +1,12 @@ -{% import 'pkg/common' as pkg %} -{% set arch_conf = salt.pillar.get('arch_conf') %} -{% set binutils_version = salt.pillar.get('gentoo:portage:packages:sys-devel/binutils:version') %} +{% set arch_conf = salt['pillar.get']('arch_conf', False) %} +{% set binutils_version = salt['pillar.get']('binutils:version', '2.31.1-r4') %} {% set binutils_target = arch_conf['CHOST'] + '-' + binutils_version.split('-')[0] %} sys-devel/binutils: pkg.installed: - pkgs: - - {{ pkg.gen_atom('sys-devel/binutils') }} - - {{ pkg.gen_atom('sys-devel/binutils-config') }} - {{ pkg.gen_portage_config('sys-devel/binutils', watch_in={'pkg': 'sys-devel/binutils'})|indent(8) }} - {{ pkg.gen_portage_config('sys-devel/binutils-config', watch_in={'pkg': 'sys-devel/binutils'})|indent(8) }} + - sys-devel/binutils: "{{ binutils_version }}[cxx,multitarget]" + - sys-devel/binutils-config: ">=5-r4" eselect-binutils: eselect.set: diff --git a/sls/editors/emacs/pkg.sls b/sls/editors/emacs/pkg.sls index 8500235..300d862 100644 --- a/sls/editors/emacs/pkg.sls +++ b/sls/editors/emacs/pkg.sls @@ -1,4 +1,5 @@ +{% import 'pkg/common' as pkg %} emacs: pkg.installed: - - name: app-editors/emacs - - version: '>=26.1:26' + - pkgs: + - {{ pkg.gen_atom('app-editors/emacs') }} diff --git a/sls/editors/emacs/yaml-mode.sls b/sls/editors/emacs/yaml-mode.sls index 2ad3d1d..052534f 100644 --- a/sls/editors/emacs/yaml-mode.sls +++ b/sls/editors/emacs/yaml-mode.sls @@ -1,10 +1,7 @@ +{% import 'pkg/common' as pkg %} include: - .pkg app-emacs/yaml-mode: - pkg.installed: - - version: '~>=0.0.13' - - require: - - pkg: emacs - - + pkg.latest + {{ pkg.gen_portage_config('app-emacs/yaml-mode', watch_in={'pkg': 'app-emacs/yaml-mode'})|indent(8) }} diff --git a/sls/filebeat/pkg.sls b/sls/filebeat/pkg.sls index c23253e..af7f419 100644 --- a/sls/filebeat/pkg.sls +++ b/sls/filebeat/pkg.sls @@ -1,16 +1,9 @@ -{% set filebeat_version = salt['pillar.get']('filebeat:version', '>=6.3') %} -{% set filebeat_packaged = salt['pillar.get']('filebeat:packaged', True) %} -{% if not filebeat_packaged %} -include: - - go -{% endif %} - +{% import 'pkg/common' as pkg %} app-admin/filebeat: pkg.installed: - - version: "{{ filebeat_version }}" - {% if filebeat_packaged %} - - binhost: force - {% endif %} + - pkgs: + - {{ pkg.gen_atom('app-admin/filebeat') }} + {{ pkg.gen_portage_config('app-admin/filebeat', watch_in={'pkg': 'app-admin/filebeat'})|indent(8) }} /var/lib/filebeat/module/: file.recurse: diff --git a/sls/gentoo/dev-utils.sls b/sls/gentoo/dev-utils.sls index 3e076d3..a5eb008 100644 --- a/sls/gentoo/dev-utils.sls +++ b/sls/gentoo/dev-utils.sls @@ -4,12 +4,10 @@ include: app-portage/repoman: pkg.latest: - pkgs: - - dev-python/lxml: ">=3.6" - - sys-apps/portage: ">=2.3" - - app-portage/repoman: ">=2.3" - -app-portage/overlint: - pkg.latest + - dev-python/lxml + - sys-apps/portage + - app-portage/repoman + - app-portage/overlint app-portage/gentoolkit-dev: pkg.purged diff --git a/sls/gentoo/portage/init.sls b/sls/gentoo/portage/init.sls index b1b93a6..c7ffce3 100644 --- a/sls/gentoo/portage/init.sls +++ b/sls/gentoo/portage/init.sls @@ -1,18 +1,12 @@ +{% import 'pkg/common' as pkg %} include: - vcs.git sys-apps/portage: pkg.latest: - pkgs: - - sys-apps/portage: "[xattr,-rsync-verify]" - - watch: - - portage_config: sys-apps/portage - portage_config.flags: - - accept_keywords: [] - - use: - - xattr - - -rsync-verify - - reload_modules: true + - {{ pkg.gen_atom('sys-apps/portage') }} + {{ pkg.gen_portage_config('sys-apps/portage', watch_in={'pkg': 'sys-apps/portage'})|indent(8) }} app-portage-purged: pkg.purged: diff --git a/sls/go/init.sls b/sls/go/init.sls index 8fbe59c..9187fab 100644 --- a/sls/go/init.sls +++ b/sls/go/init.sls @@ -1,8 +1,5 @@ include: - lib.glibc - - core.gcc - - core.binutils dev-lang/go: pkg.latest - diff --git a/sls/jemalloc/init.sls b/sls/jemalloc/init.sls index 18fbd83..e6a0816 100644 --- a/sls/jemalloc/init.sls +++ b/sls/jemalloc/init.sls @@ -1,6 +1,6 @@ +{% import 'pkg/common' as pkg %} dev-libs/jemalloc: pkg.latest: - pkgs: - - dev-libs/jemalloc: '[stats]' - - + - {{ pkg.gen_atom('dev-libs/jemalloc') }} + {{ pkg.gen_portage_config('dev-libs/jemalloc', watch_in={'pkg': 'dev-libs/jemalloc'})|indent(8) }} diff --git a/sls/keepalived/pkg.sls b/sls/keepalived/pkg.sls index dbafb98..ead167a 100644 --- a/sls/keepalived/pkg.sls +++ b/sls/keepalived/pkg.sls @@ -1,4 +1,6 @@ +{% import 'pkg/common' as pkg %} pkg_keepalived: pkg.installed: - pkgs: - - sys-cluster/keepalived: '[ipv6,snmp]' + - {{ pkg.gen_atom('sys-cluster/keepalived') }} + {{ pkg.gen_portage_config('sys-cluster/keepalived', watch_in={'pkg': 'pkg_keepalived'})|indent(8) }} diff --git a/sls/lib/glibc.sls b/sls/lib/glibc.sls index 2bff208..ec0bb67 100644 --- a/sls/lib/glibc.sls +++ b/sls/lib/glibc.sls @@ -1,13 +1,11 @@ -{% set glibc_use = salt['pillar.get']('glibc:use', ['-audit','caps','-docs','gd','multiarch','hardened']) %} -{% set libs_packaged = salt['pillar.get']('libs:packaged', False) %} +{% import 'pkg/common' as pkg %} sys-libs/glibc: pkg.latest: - - version: "[{{ ','.join(glibc_use) }}]" - {% if libs_packaged %} - - binhost: force - {% endif %} - require: - file: /etc/locale.gen + - pkgs: + - {{ pkg.gen_atom('sys-libs/glibc') }} + {{ pkg.gen_portage_config('sys-libs/glibc', watch_in={'pkg': 'sys-libs/glibc'})|indent(8) }} /etc/env.d/02locale: file.managed: diff --git a/sls/pkg/common b/sls/pkg/common index 0a74b48..0e18fa2 100644 --- a/sls/pkg/common +++ b/sls/pkg/common @@ -50,4 +50,3 @@ {{- package_name -}} {% endif %} {%- endmacro -%} -