diff --git a/kitchen.yml b/kitchen.yml index 66d489b..9c523e2 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -447,7 +447,7 @@ suites: provisioner: dependencies: - name: node - branch: test-kitchen + branch: master repo: git source: https://github.com/saltstack-formulas/node-formula.git state_top: diff --git a/packages/gems.sls b/packages/gems.sls index f578833..506718d 100644 --- a/packages/gems.sls +++ b/packages/gems.sls @@ -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 %} diff --git a/packages/osfingermap.yaml b/packages/osfingermap.yaml index 9239f04..e8dd690 100644 --- a/packages/osfingermap.yaml +++ b/packages/osfingermap.yaml @@ -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: diff --git a/pillar.example b/pillar.example index 3a00266..d3122b6 100644 --- a/pillar.example +++ b/pillar.example @@ -41,7 +41,7 @@ packages: - epel wanted: - - dxpy + - iotop - attrs unwanted: - campbel @@ -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 diff --git a/test/integration/default/controls/gems_spec.rb b/test/integration/default/controls/gems_spec.rb index 5424e85..409f365 100644 --- a/test/integration/default/controls/gems_spec.rb +++ b/test/integration/default/controls/gems_spec.rb @@ -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' diff --git a/test/integration/default/controls/pips_spec.rb.old b/test/integration/default/controls/pips_spec.rb.old deleted file mode 100644 index 130937f..0000000 --- a/test/integration/default/controls/pips_spec.rb.old +++ /dev/null @@ -1,34 +0,0 @@ -### WANTED/REQUIRED -case platform[:family] -when 'fedora', 'suse' - wanted_pips = [] -else - wanted_pips = %w{ - dxpy - attrs - } -end - -control 'Wanted/Required python packages' do - title 'should be installed' - - wanted_pips.each do |p| - describe pip(p) do - it { should be_installed } - end - end -end - -### UNWANTED -control 'Unwanted python packages' do - title 'should be uninstalled' - %w{ - campbel - reverse_geocode - indy-crypto - }.each do |p| - describe pip(p) do - it { should_not be_installed } - end - end -end diff --git a/test/integration/default/files/_mapdata/almalinux-8.yaml b/test/integration/default/files/_mapdata/almalinux-8.yaml index 549a869..a3e8376 100644 --- a/test/integration/default/files/_mapdata/almalinux-8.yaml +++ b/test/integration/default/files/_mapdata/almalinux-8.yaml @@ -33,6 +33,8 @@ values: - kwalify wanted: - progressbar + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/amazonlinux-2.yaml b/test/integration/default/files/_mapdata/amazonlinux-2.yaml index 21d9e34..18e15e2 100644 --- a/test/integration/default/files/_mapdata/amazonlinux-2.yaml +++ b/test/integration/default/files/_mapdata/amazonlinux-2.yaml @@ -33,6 +33,8 @@ values: - kwalify wanted: - progressbar + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/arch-base-latest.yaml b/test/integration/default/files/_mapdata/arch-base-latest.yaml index 45c0c75..d5a5226 100644 --- a/test/integration/default/files/_mapdata/arch-base-latest.yaml +++ b/test/integration/default/files/_mapdata/arch-base-latest.yaml @@ -33,6 +33,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/centos-7.yaml b/test/integration/default/files/_mapdata/centos-7.yaml index 0b4178b..629f891 100644 --- a/test/integration/default/files/_mapdata/centos-7.yaml +++ b/test/integration/default/files/_mapdata/centos-7.yaml @@ -33,6 +33,8 @@ values: - kwalify wanted: - progressbar + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/centos-8.yaml b/test/integration/default/files/_mapdata/centos-8.yaml index 6ad6dee..c803a7c 100644 --- a/test/integration/default/files/_mapdata/centos-8.yaml +++ b/test/integration/default/files/_mapdata/centos-8.yaml @@ -33,6 +33,8 @@ values: - kwalify wanted: - progressbar + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/debian-10.yaml b/test/integration/default/files/_mapdata/debian-10.yaml index bdfae68..0134777 100644 --- a/test/integration/default/files/_mapdata/debian-10.yaml +++ b/test/integration/default/files/_mapdata/debian-10.yaml @@ -61,6 +61,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] @@ -89,14 +91,13 @@ values: required: pkgs: - libpython2.7-dev - - python-pip states: [] unwanted: - campbel - reverse_geocode - indy-crypto wanted: - - dxpy + - iotop - attrs pkgs: held: diff --git a/test/integration/default/files/_mapdata/debian-11.yaml b/test/integration/default/files/_mapdata/debian-11.yaml index 6999fd6..517fb42 100644 --- a/test/integration/default/files/_mapdata/debian-11.yaml +++ b/test/integration/default/files/_mapdata/debian-11.yaml @@ -61,6 +61,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] @@ -89,14 +91,13 @@ values: required: pkgs: - libpython2.7-dev - - python-pip states: [] unwanted: - campbel - reverse_geocode - indy-crypto wanted: - - dxpy + - iotop - attrs pkgs: held: diff --git a/test/integration/default/files/_mapdata/debian-9.yaml b/test/integration/default/files/_mapdata/debian-9.yaml index eb35f77..f4189a1 100644 --- a/test/integration/default/files/_mapdata/debian-9.yaml +++ b/test/integration/default/files/_mapdata/debian-9.yaml @@ -61,6 +61,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] @@ -96,7 +98,7 @@ values: - reverse_geocode - indy-crypto wanted: - - dxpy + - iotop - attrs pkgs: held: diff --git a/test/integration/default/files/_mapdata/fedora-33.yaml b/test/integration/default/files/_mapdata/fedora-33.yaml index 29885e1..659120f 100644 --- a/test/integration/default/files/_mapdata/fedora-33.yaml +++ b/test/integration/default/files/_mapdata/fedora-33.yaml @@ -34,6 +34,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/fedora-34.yaml b/test/integration/default/files/_mapdata/fedora-34.yaml index 00cbf6f..89c9bbc 100644 --- a/test/integration/default/files/_mapdata/fedora-34.yaml +++ b/test/integration/default/files/_mapdata/fedora-34.yaml @@ -34,6 +34,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml b/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml index 83b6aac..4597a63 100644 --- a/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml +++ b/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml @@ -33,6 +33,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml b/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml index 83b6aac..4597a63 100644 --- a/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml +++ b/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml @@ -33,6 +33,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/opensuse-15.yaml b/test/integration/default/files/_mapdata/opensuse-15.yaml index 0683fda..c2d42bc 100644 --- a/test/integration/default/files/_mapdata/opensuse-15.yaml +++ b/test/integration/default/files/_mapdata/opensuse-15.yaml @@ -34,6 +34,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml b/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml index 423e2d8..8961924 100644 --- a/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml +++ b/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml @@ -34,6 +34,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/oraclelinux-7.yaml b/test/integration/default/files/_mapdata/oraclelinux-7.yaml index 60ef79c..0faf46d 100644 --- a/test/integration/default/files/_mapdata/oraclelinux-7.yaml +++ b/test/integration/default/files/_mapdata/oraclelinux-7.yaml @@ -33,6 +33,8 @@ values: - kwalify wanted: - progressbar + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/oraclelinux-8.yaml b/test/integration/default/files/_mapdata/oraclelinux-8.yaml index bc29312..cc3d320 100644 --- a/test/integration/default/files/_mapdata/oraclelinux-8.yaml +++ b/test/integration/default/files/_mapdata/oraclelinux-8.yaml @@ -33,6 +33,8 @@ values: - kwalify wanted: - progressbar + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/rockylinux-8.yaml b/test/integration/default/files/_mapdata/rockylinux-8.yaml index 567d611..8b90a63 100644 --- a/test/integration/default/files/_mapdata/rockylinux-8.yaml +++ b/test/integration/default/files/_mapdata/rockylinux-8.yaml @@ -33,6 +33,8 @@ values: - kwalify wanted: - progressbar + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: [] goget: [] diff --git a/test/integration/default/files/_mapdata/ubuntu-18.yaml b/test/integration/default/files/_mapdata/ubuntu-18.yaml index 6f3ab81..7fef97c 100644 --- a/test/integration/default/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-18.yaml @@ -56,6 +56,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: - github.com/golang/example/hello diff --git a/test/integration/default/files/_mapdata/ubuntu-20.yaml b/test/integration/default/files/_mapdata/ubuntu-20.yaml index 20b3521..dfcbcf9 100644 --- a/test/integration/default/files/_mapdata/ubuntu-20.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-20.yaml @@ -56,6 +56,8 @@ values: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 golang: clean: - github.com/golang/example/hello diff --git a/test/salt/pillar/amazon.sls b/test/salt/pillar/amazon.sls index 5261f4c..a4f1d40 100644 --- a/test/salt/pillar/amazon.sls +++ b/test/salt/pillar/amazon.sls @@ -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 diff --git a/test/salt/pillar/arch.sls b/test/salt/pillar/arch.sls index ad7f33a..3a8e4da 100644 --- a/test/salt/pillar/arch.sls +++ b/test/salt/pillar/arch.sls @@ -29,6 +29,8 @@ packages: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 unwanted: - diff-lcs - kitchen-vagrant diff --git a/test/salt/pillar/debian.sls b/test/salt/pillar/debian.sls index aabd024..75b2acf 100644 --- a/test/salt/pillar/debian.sls +++ b/test/salt/pillar/debian.sls @@ -3,10 +3,8 @@ --- # Dependency (node) node: - version: 12.16.1-1nodesource1 - install_from_ppa: true - ppa: - repository_url: https://deb.nodesource.com/node_12.x + pkg: + use_upstream_repo: true packages: pkgs: @@ -41,9 +39,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 @@ -59,6 +56,8 @@ packages: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 unwanted: - diff-lcs - kitchen-vagrant diff --git a/test/salt/pillar/fedora.sls b/test/salt/pillar/fedora.sls index 72865f2..db348da 100644 --- a/test/salt/pillar/fedora.sls +++ b/test/salt/pillar/fedora.sls @@ -20,7 +20,7 @@ packages: - python3-dnf-plugin-versionlock pips: wanted: - # - dxpy + # - iotop - attrs unwanted: - campbel @@ -30,6 +30,8 @@ packages: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 unwanted: - diff-lcs - kitchen-vagrant diff --git a/test/salt/pillar/gentoo.sls b/test/salt/pillar/gentoo.sls index 3a57a2d..0d8343e 100644 --- a/test/salt/pillar/gentoo.sls +++ b/test/salt/pillar/gentoo.sls @@ -33,6 +33,8 @@ packages: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 unwanted: - diff-lcs - kitchen-vagrant diff --git a/test/salt/pillar/opensuse.sls b/test/salt/pillar/opensuse.sls index addd1fe..925316c 100644 --- a/test/salt/pillar/opensuse.sls +++ b/test/salt/pillar/opensuse.sls @@ -22,6 +22,8 @@ packages: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 unwanted: - diff-lcs - kitchen-vagrant diff --git a/test/salt/pillar/redhat.sls b/test/salt/pillar/redhat.sls index 832d27d..d766534 100644 --- a/test/salt/pillar/redhat.sls +++ b/test/salt/pillar/redhat.sls @@ -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 diff --git a/test/salt/pillar/redhat8.sls b/test/salt/pillar/redhat8.sls index 8fc591d..21f616f 100644 --- a/test/salt/pillar/redhat8.sls +++ b/test/salt/pillar/redhat8.sls @@ -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 diff --git a/test/salt/pillar/ubuntu.sls b/test/salt/pillar/ubuntu.sls index b964eef..a87e3e4 100644 --- a/test/salt/pillar/ubuntu.sls +++ b/test/salt/pillar/ubuntu.sls @@ -39,7 +39,7 @@ packages: - python-pip wanted: # TODO: Investigate why this is longer working; OK when running locally - # - dxpy + # - iotop - attrs unwanted: - campbel @@ -54,6 +54,8 @@ packages: wanted: - progressbar - minitest + - strings: 0.1.8 + - regexp_parser: 1.7.0 unwanted: - diff-lcs - kitchen-vagrant diff --git a/test/salt/pillar/windows.sls b/test/salt/pillar/windows.sls index ae8149d..16343bf 100644 --- a/test/salt/pillar/windows.sls +++ b/test/salt/pillar/windows.sls @@ -6,7 +6,7 @@ packages: required: pkgs: [] wanted: - Firefox: + firefox: package_args: "/l:en-GB" jq: version: '1.5'