simp-rspec-puppet-facts 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -0
  3. data/facts/1.7/centos-6-x86_64.facts +7 -6
  4. data/facts/1.7/centos-7-x86_64.facts +6 -5
  5. data/facts/1.7/redhat-6-x86_64.facts +6 -5
  6. data/facts/1.7/redhat-7-x86_64.facts +6 -5
  7. data/facts/2.0/centos-6-x86_64.facts +7 -6
  8. data/facts/2.0/centos-7-x86_64.facts +8 -7
  9. data/facts/2.0/redhat-6-x86_64.facts +6 -5
  10. data/facts/2.0/redhat-7-x86_64.facts +6 -5
  11. data/facts/2.1/centos-6-x86_64.facts +7 -6
  12. data/facts/2.1/centos-7-x86_64.facts +8 -7
  13. data/facts/2.1/redhat-6-x86_64.facts +5 -4
  14. data/facts/2.1/redhat-7-x86_64.facts +5 -4
  15. data/facts/2.2/centos-6-x86_64.facts +8 -7
  16. data/facts/2.2/centos-7-x86_64.facts +9 -8
  17. data/facts/2.2/redhat-6-x86_64.facts +6 -5
  18. data/facts/2.2/redhat-7-x86_64.facts +6 -5
  19. data/facts/2.3/centos-6-x86_64.facts +8 -7
  20. data/facts/2.3/centos-7-x86_64.facts +9 -8
  21. data/facts/2.3/redhat-6-x86_64.facts +6 -5
  22. data/facts/2.3/redhat-7-x86_64.facts +6 -5
  23. data/facts/2.4/centos-6-x86_64.facts +8 -7
  24. data/facts/2.4/centos-7-x86_64.facts +9 -8
  25. data/facts/2.4/redhat-6-x86_64.facts +6 -5
  26. data/facts/2.4/redhat-7-x86_64.facts +6 -5
  27. data/facts/3.0/centos-6-x86_64.facts +404 -316
  28. data/facts/3.0/centos-7-x86_64.facts +408 -320
  29. data/facts/3.0/redhat-6-x86_64.facts +405 -314
  30. data/facts/3.0/redhat-7-x86_64.facts +415 -324
  31. data/facts/3.1/centos-6-x86_64.facts +430 -342
  32. data/facts/3.1/centos-7-x86_64.facts +434 -346
  33. data/facts/3.1/redhat-6-x86_64.facts +431 -340
  34. data/facts/3.1/redhat-7-x86_64.facts +441 -350
  35. data/facts/Vagrantfile +9 -9
  36. data/facts/scripts/get_facts.rb +8 -0
  37. data/facts/{get_facts.sh → scripts/get_facts_for_each_facter.sh} +18 -10
  38. data/lib/simp/rspec-puppet-facts.rb +5 -0
  39. data/lib/simp/version.rb +1 -1
  40. metadata +5 -11
  41. data/facts/1.6/centos-6-x86_64.facts +0 -0
  42. data/facts/1.6/centos-7-x86_64.facts +0 -0
  43. data/facts/1.6/redhat-6-x86_64.facts +0 -0
  44. data/facts/1.6/redhat-7-x86_64.facts +0 -0
data/facts/Vagrantfile CHANGED
@@ -10,25 +10,25 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
10
10
  config.vm.define "redhat-6-x86_64" do |host|
11
11
  host.vm.box = "anandbitra/redhat-6.5"
12
12
  host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
13
- host.vm.provision "shell", path: "get_facts.sh", args: "6"
14
- host.vm.provision "shell", inline: "/sbin/shutdown -h now"
13
+ host.vm.provision "shell", path: "scripts/get_facts_for_each_facter.sh", args: "6"
14
+ host.vm.provision "shell", inline: "/sbin/shutdown -h now" unless ENV['SHUTDOWN'] == 'no'
15
15
  end
16
- config.vm.define "redhat-6-x86_64" do |host|
16
+ config.vm.define "redhat-7-x86_64" do |host|
17
17
  host.vm.box = "mrlesmithjr/rhel-7"
18
18
  host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
19
- host.vm.provision "shell", path: "get_facts.sh", args: "7"
20
- host.vm.provision "shell", inline: "/sbin/shutdown -h now"
19
+ host.vm.provision "shell", path: "scripts/get_facts_for_each_facter.sh", args: "7"
20
+ host.vm.provision "shell", inline: "/sbin/shutdown -h now" unless ENV['SHUTDOWN'] == 'no'
21
21
  end
22
22
  config.vm.define "centos-6-x86_64" do |host|
23
23
  host.vm.box = "puppetlabs/centos-6.6-64-nocm"
24
24
  host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
25
- host.vm.provision "shell", path: "get_facts.sh", args: "6"
26
- host.vm.provision "shell", inline: "/sbin/shutdown -h now"
25
+ host.vm.provision "shell", path: "scripts/get_facts_for_each_facter.sh", args: "6"
26
+ host.vm.provision "shell", inline: "/sbin/shutdown -h now" unless ENV['SHUTDOWN'] == 'no'
27
27
  end
28
28
  config.vm.define "centos-7-x86_64" do |host|
29
29
  host.vm.box = "puppetlabs/centos-7.0-64-nocm"
30
30
  host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
31
- host.vm.provision "shell", path: "get_facts.sh", args: "7"
32
- host.vm.provision "shell", inline: "/sbin/shutdown -h now"
31
+ host.vm.provision "shell", path: "scripts/get_facts_for_each_facter.sh", args: "7"
32
+ host.vm.provision "shell", inline: "/sbin/shutdown -h now" unless ENV['SHUTDOWN'] == 'no'
33
33
  end
34
34
  end
@@ -0,0 +1,8 @@
1
+ require 'puppet'
2
+ require 'json'
3
+ require 'facter'
4
+
5
+ ENV['FACTERLIB'].split(':').each{|x| Facter.search x }
6
+
7
+ Puppet.initialize_settings
8
+ jj JSON.parse Facter.collection.to_h.to_json
@@ -1,19 +1,23 @@
1
1
  #!/bin/bash
2
2
  operatingsystemmajrelease=$1
3
-
4
3
  export PATH=/opt/puppetlabs/bin:$PATH
5
4
  export FACTERLIB=`ls -1d /vagrant/modules/*/lib/facter | tr '\n' ':'`
6
5
 
7
- yum install epel-release -y
8
6
  wget "https://yum.puppetlabs.com/puppetlabs-release-pc1-el-${operatingsystemmajrelease}.noarch.rpm" -O /tmp/puppetlabs-release-pc1.rpm
9
7
  rpm -ivh /tmp/puppetlabs-release-pc1.rpm
10
8
 
9
+ # Because `yum install epel-release -y` doesn't work for RedHat:
10
+ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-${operatingsystemmajrelease}.noarch.rpm
11
+ rpm -Uvh epel-release-latest-${operatingsystemmajrelease}*.rpm
12
+
13
+
11
14
  # Capture data for (c)facter 3.X
12
15
  for puppet_agent_version in 1.2.2 1.2.7; do
13
16
  yum install -y puppet-agent-${puppet_agent_version} rubygems git ruby-devel
14
- output_file="/vagrant/$(facter --version | cut -c1-3)/$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
15
- mkdir -p $(dirname ${output_file})
16
- facter -j | tee ${output_file}
17
+ output_dir="/vagrant/$(facter --version | cut -c1-3)"
18
+ output_file="$(facter operatingsystem | tr '[:upper:]' '[:lower:]')-$(facter operatingsystemmajrelease)-$(facter hardwaremodel).facts"
19
+ mkdir -p $output_dir
20
+ puppet facts | tee "${output_dir}/${output_file}"
17
21
  done
18
22
 
19
23
  operatingsystem=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
@@ -25,11 +29,15 @@ gem install bundler --no-ri --no-rdoc --no-format-executable
25
29
  bundle install --path vendor/bundler
26
30
 
27
31
  # Capture data for ruby-based facters
28
- for version in 1.6.0 1.7.0 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0; do
32
+ for version in 1.7.0 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0; do
29
33
  FACTER_GEM_VERSION="~> ${version}" bundle update
30
- output_file="/vagrant/$(bundle exec facter --version | cut -c1-3)/${operatingsystem}-${operatingsystemmajrelease}-${hardwaremodel}.facts"
34
+ os_string="$(bundle exec facter --version | cut -c1-3)/${operatingsystem}-${operatingsystemmajrelease}-${hardwaremodel}"
35
+ echo
36
+ echo
37
+ echo ============== ${os_string} ================
38
+ echo
39
+ echo
40
+ output_file="/vagrant/${os_string}.facts"
31
41
  mkdir -p $(dirname $output_file)
32
- echo $version | grep -q -E '^1\.' &&
33
- FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | bundle exec ruby -e 'require "json"; jj JSON.parse gets' | tee $output_file ||
34
- FACTER_GEM_VERSION="~> ${version}" bundle exec facter -j | tee $output_file
42
+ FACTER_GEM_VERSION="~> ${version}" bundle exec ruby /vagrant/scripts/get_facts.rb | tee $output_file
35
43
  done
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require 'puppet'
2
3
 
3
4
  module Simp; end
4
5
  module Simp::RspecPuppetFacts
@@ -22,6 +23,7 @@ module Simp::RspecPuppetFacts
22
23
 
23
24
  facts.merge! captured_facts
24
25
  facts.merge! opts.fetch( :extra_facts, {} )
26
+ facts.merge!({ :puppetversion => ::Puppet.version })
25
27
  facts.merge! lsb_facts( facts )
26
28
  facts.merge! selinux_facts( selinux_mode, facts )
27
29
  facts.merge! opts.fetch( :extra_facts_immutable, {} )
@@ -60,16 +62,19 @@ module Simp::RspecPuppetFacts
60
62
  sefacts = {}
61
63
  sefacts_enforcing = {
62
64
  :selinux => true,
65
+ :selinux_enforced => true,
63
66
  :selinux_current_mode => 'enforcing',
64
67
  :selinux_state => 'enforcing',
65
68
  }
66
69
  sefacts_permissive = {
67
70
  :selinux => true,
71
+ :selinux_enforced => false,
68
72
  :selinux_current_mode => 'permissive',
69
73
  :selinux_state => 'permssive',
70
74
  }
71
75
  sefacts_disabled = {
72
76
  :selinux => false,
77
+ :selinux_enforced => false,
73
78
  :selinux_current_mode => 'disabled',
74
79
  :selinux_state => 'disabled',
75
80
  }
data/lib/simp/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Simp; end
2
2
  module Simp::RspecPuppetFacts
3
- VERSION = '1.2.0'
3
+ VERSION = '1.3.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-rspec-puppet-facts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -124,10 +124,6 @@ files:
124
124
  - LICENSE
125
125
  - README.md
126
126
  - Rakefile
127
- - facts/1.6/centos-6-x86_64.facts
128
- - facts/1.6/centos-7-x86_64.facts
129
- - facts/1.6/redhat-6-x86_64.facts
130
- - facts/1.6/redhat-7-x86_64.facts
131
127
  - facts/1.7/centos-6-x86_64.facts
132
128
  - facts/1.7/centos-7-x86_64.facts
133
129
  - facts/1.7/redhat-6-x86_64.facts
@@ -162,7 +158,8 @@ files:
162
158
  - facts/3.1/redhat-7-x86_64.facts
163
159
  - facts/Gemfile
164
160
  - facts/Vagrantfile
165
- - facts/get_facts.sh
161
+ - facts/scripts/get_facts.rb
162
+ - facts/scripts/get_facts_for_each_facter.sh
166
163
  - lib/simp-rspec-puppet-facts.rb
167
164
  - lib/simp/rspec-puppet-facts.rb
168
165
  - lib/simp/version.rb
@@ -209,11 +206,6 @@ test_files:
209
206
  - facts/2.0/redhat-6-x86_64.facts
210
207
  - facts/2.0/centos-7-x86_64.facts
211
208
  - facts/2.0/centos-6-x86_64.facts
212
- - facts/get_facts.sh
213
- - facts/1.6/redhat-7-x86_64.facts
214
- - facts/1.6/redhat-6-x86_64.facts
215
- - facts/1.6/centos-7-x86_64.facts
216
- - facts/1.6/centos-6-x86_64.facts
217
209
  - facts/1.7/redhat-7-x86_64.facts
218
210
  - facts/1.7/redhat-6-x86_64.facts
219
211
  - facts/1.7/centos-7-x86_64.facts
@@ -231,6 +223,8 @@ test_files:
231
223
  - facts/2.3/redhat-6-x86_64.facts
232
224
  - facts/2.3/centos-7-x86_64.facts
233
225
  - facts/2.3/centos-6-x86_64.facts
226
+ - facts/scripts/get_facts_for_each_facter.sh
227
+ - facts/scripts/get_facts.rb
234
228
  - facts/2.2/redhat-7-x86_64.facts
235
229
  - facts/2.2/redhat-6-x86_64.facts
236
230
  - facts/2.2/centos-7-x86_64.facts
File without changes
File without changes
File without changes
File without changes