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

Feat specify gems versions #83

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
18 changes: 17 additions & 1 deletion packages/gems.sls
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,25 @@ gem_req_pkgs:
### GEMS to install
# (requires the ruby/rubygem deb/rpm installed, either by the system or listed in
# the required packages
# Standarize gems to format { gem: version }
{% set gem = namespace(name = '', version = '') %}

{%- for gm in wanted_gems %}
{{ gm }}:
{%- if gm is mapping %}
{%- for k,v in gm.items() %}
{%- set gem.name = k %}
{%- set gem.version = v %}
{%- endfor %}
{%- else %}
{%- set gem.name = gm %}
{%- set gem.version = 'version_undefined' %}
{%- endif %}
{{ gem.name }}-{{ gem.version }}:
gem.installed:
- name: {{ gem.name }}
{%- if gem.version != 'version_undefined' %}
- version: {{ gem.version }}
{%- endif %}
- require:
- pkg: gem_req_pkgs
{%- if req_states %}
Expand Down
10 changes: 10 additions & 0 deletions packages/osfingermap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ CentOS Linux-8:
collides: ['snap']
symlink: true

Debian-9:
pips:
required:
pkgs:
# Pillar parameters have precedence so, if you add a package here, you
# should also add the python pip package you want. Otherwise, the formula
# will take care of getting it if needed.
- libpython2.7-dev
- python-pip

Oracle Linux Server-8:
pkgs:
required:
Expand Down
3 changes: 3 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ packages:
wanted:
- progressbar
- minitest
# You can also specify a desired gem version
- some_gem: 1.2.3
- other: 2.3.4
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down
16 changes: 16 additions & 0 deletions test/integration/default/controls/gems_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
end
end

### SPECIFIC GEMS VERSIONS
control "Specific gems' versions" do
title 'should be installed'

specific_gems = {
'regexp_parser' => '1.7.0',
'strings' => '0.1.8'
}
specific_gems.each do |p, v|
describe gem(p) do
it { should be_installed }
its('versions') { should include(v) }
end
end
end

### UNWANTED
control 'Unwanted gems' do
title 'should be uninstalled'
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/almalinux-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
- kwalify
wanted:
- progressbar
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/amazonlinux-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
- kwalify
wanted:
- progressbar
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
- kwalify
wanted:
- progressbar
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/centos-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
- kwalify
wanted:
- progressbar
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
4 changes: 3 additions & 1 deletion test/integration/default/files/_mapdata/debian-10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down Expand Up @@ -96,7 +98,7 @@ values:
- reverse_geocode
- indy-crypto
wanted:
- dxpy
- iotop
- attrs
pkgs:
held:
Expand Down
4 changes: 3 additions & 1 deletion test/integration/default/files/_mapdata/debian-11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down Expand Up @@ -96,7 +98,7 @@ values:
- reverse_geocode
- indy-crypto
wanted:
- dxpy
- iotop
- attrs
pkgs:
held:
Expand Down
4 changes: 3 additions & 1 deletion test/integration/default/files/_mapdata/debian-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down Expand Up @@ -96,7 +98,7 @@ values:
- reverse_geocode
- indy-crypto
wanted:
- dxpy
- iotop
- attrs
pkgs:
held:
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/fedora-33.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/fedora-34.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/gentoo-2-sysd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/gentoo-2-sysv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/opensuse-15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/oraclelinux-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
- kwalify
wanted:
- progressbar
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/oraclelinux-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
- kwalify
wanted:
- progressbar
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/rockylinux-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ values:
- kwalify
wanted:
- progressbar
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean: []
goget: []
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/ubuntu-18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean:
- github.com/golang/example/hello
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/files/_mapdata/ubuntu-20.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ values:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
golang:
clean:
- github.com/golang/example/hello
Expand Down
2 changes: 2 additions & 0 deletions test/salt/pillar/amazon.sls
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ packages:
# https://stackoverflow.com/a/50931910
# $ sudo amazon-linux-extras install ruby2.6
# - minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down
2 changes: 2 additions & 0 deletions test/salt/pillar/arch.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ packages:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down
5 changes: 3 additions & 2 deletions test/salt/pillar/debian.sls
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ packages:
# should also add the python pip package you want. Otherwise, the formula
# will take care of getting it if needed.
- libpython2.7-dev
- python-pip
wanted:
- dxpy
- iotop
- attrs
unwanted:
- campbel
Expand All @@ -59,6 +58,8 @@ packages:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down
4 changes: 3 additions & 1 deletion test/salt/pillar/fedora.sls
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ packages:
- python3-dnf-plugin-versionlock
pips:
wanted:
# - dxpy
- iotop
- attrs
unwanted:
- campbel
Expand All @@ -30,6 +30,8 @@ packages:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down
2 changes: 2 additions & 0 deletions test/salt/pillar/gentoo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ packages:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down
2 changes: 2 additions & 0 deletions test/salt/pillar/opensuse.sls
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ packages:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down
2 changes: 2 additions & 0 deletions test/salt/pillar/redhat.sls
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ packages:
# https://stackoverflow.com/a/50931910
# $ sudo amazon-linux-extras install ruby2.6
# - minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down
2 changes: 2 additions & 0 deletions test/salt/pillar/redhat8.sls
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ packages:
# https://stackoverflow.com/a/50931910
# $ sudo amazon-linux-extras install ruby2.6
# - minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down
5 changes: 3 additions & 2 deletions test/salt/pillar/ubuntu.sls
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ packages:
- libpython2.7-dev
- python-pip
wanted:
# TODO: Investigate why this is longer working; OK when running locally
# - dxpy
- iotop
- attrs
unwanted:
- campbel
Expand All @@ -54,6 +53,8 @@ packages:
wanted:
- progressbar
- minitest
- strings: 0.1.8
- regexp_parser: 1.7.0
unwanted:
- diff-lcs
- kitchen-vagrant
Expand Down