freighthop 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. checksums.yaml +7 -0
  2. data/Puppetfile +1 -1
  3. data/Puppetfile.lock +4 -5
  4. data/README.md +18 -7
  5. data/Vagrantfile +4 -0
  6. data/lib/freighthop/cli/help.rb +1 -0
  7. data/lib/freighthop/cli/init.rb +10 -10
  8. data/lib/freighthop/cli/version.rb +17 -0
  9. data/lib/freighthop/cli.rb +3 -1
  10. data/lib/freighthop/version.rb +1 -1
  11. data/lib/freighthop.rb +4 -0
  12. data/modules/apt/CHANGELOG +2 -36
  13. data/modules/apt/Gemfile +5 -6
  14. data/modules/apt/Gemfile.lock +7 -40
  15. data/modules/apt/Modulefile +1 -1
  16. data/modules/apt/README.md +1 -2
  17. data/modules/apt/Rakefile +0 -1
  18. data/modules/apt/manifests/init.pp +2 -5
  19. data/modules/apt/manifests/params.pp +1 -4
  20. data/modules/apt/manifests/pin.pp +1 -1
  21. data/modules/apt/manifests/ppa.pp +10 -24
  22. data/modules/apt/manifests/update.pp +0 -1
  23. data/modules/apt/metadata.json +19 -32
  24. data/modules/apt/spec/defines/ppa_spec.rb +2 -53
  25. data/modules/apt/spec/defines/source_spec.rb +2 -2
  26. data/modules/apt/templates/source.list.erb +2 -2
  27. data/modules/apt/tests/key.pp +3 -3
  28. data/modules/concat/CHANGELOG +73 -0
  29. data/modules/concat/Gemfile +20 -0
  30. data/modules/concat/Gemfile.lock +104 -0
  31. data/modules/concat/Modulefile +7 -6
  32. data/modules/concat/README.md +440 -0
  33. data/modules/concat/Rakefile +5 -1
  34. data/modules/concat/files/concatfragments.rb +137 -0
  35. data/modules/concat/files/concatfragments.sh +15 -4
  36. data/modules/concat/lib/facter/concat_basedir.rb +9 -3
  37. data/modules/concat/manifests/fragment.pp +108 -48
  38. data/modules/concat/manifests/init.pp +191 -210
  39. data/modules/concat/manifests/setup.pp +31 -31
  40. data/modules/concat/metadata.json +40 -21
  41. data/modules/{apt → concat}/spec/spec_helper_system.rb +11 -6
  42. data/modules/{firewall → concat}/spec/system/basic_spec.rb +1 -1
  43. data/modules/concat/spec/system/concat_spec.rb +154 -0
  44. data/modules/concat/spec/system/deprecation_warnings_spec.rb +247 -0
  45. data/modules/concat/spec/system/empty_spec.rb +27 -0
  46. data/modules/concat/spec/system/fragment_source_spec.rb +142 -0
  47. data/modules/concat/spec/system/replace_spec.rb +257 -0
  48. data/modules/concat/spec/system/symbolic_name_spec.rb +35 -0
  49. data/modules/concat/spec/system/warn_spec.rb +106 -0
  50. data/modules/concat/spec/unit/classes/concat_setup_spec.rb +42 -0
  51. data/modules/concat/spec/unit/defines/concat_fragment_spec.rb +267 -0
  52. data/modules/concat/spec/unit/defines/concat_spec.rb +380 -0
  53. data/modules/concat/spec/unit/facts/concat_basedir_spec.rb +18 -0
  54. data/modules/concat/tests/fragment.pp +19 -0
  55. data/modules/concat/tests/init.pp +7 -0
  56. data/modules/firewall/Changelog +38 -0
  57. data/modules/firewall/Gemfile +5 -2
  58. data/modules/firewall/Gemfile.lock +76 -26
  59. data/modules/firewall/Modulefile +1 -1
  60. data/modules/firewall/README.markdown +47 -15
  61. data/modules/firewall/Rakefile +0 -7
  62. data/modules/firewall/lib/puppet/provider/firewall/ip6tables.rb +50 -7
  63. data/modules/firewall/lib/puppet/provider/firewall/iptables.rb +147 -31
  64. data/modules/firewall/lib/puppet/provider/firewallchain/iptables_chain.rb +19 -8
  65. data/modules/firewall/lib/puppet/type/firewall.rb +207 -3
  66. data/modules/firewall/lib/puppet/type/firewallchain.rb +73 -2
  67. data/modules/firewall/lib/puppet/util/firewall.rb +14 -0
  68. data/modules/firewall/metadata.json +181 -76
  69. data/modules/firewall/spec/acceptance/basic_spec.rb +8 -0
  70. data/modules/firewall/spec/acceptance/change_source_spec.rb +77 -0
  71. data/modules/firewall/spec/acceptance/class_spec.rb +27 -0
  72. data/modules/firewall/spec/acceptance/firewall_spec.rb +1608 -0
  73. data/modules/firewall/spec/acceptance/firewallchain_spec.rb +125 -0
  74. data/modules/firewall/spec/acceptance/ip6_fragment_spec.rb +94 -0
  75. data/modules/firewall/spec/acceptance/isfragment_spec.rb +92 -0
  76. data/modules/firewall/spec/acceptance/nodesets/centos-59-x64.yml +10 -0
  77. data/modules/firewall/spec/acceptance/nodesets/centos-64-x64-fusion.yml +10 -0
  78. data/modules/firewall/spec/acceptance/nodesets/centos-64-x64-pe.yml +12 -0
  79. data/modules/firewall/spec/acceptance/nodesets/centos-64-x64.yml +10 -0
  80. data/modules/firewall/spec/acceptance/nodesets/debian-607-x64.yml +10 -0
  81. data/modules/firewall/spec/acceptance/nodesets/debian-70rc1-x64.yml +10 -0
  82. data/modules/firewall/spec/acceptance/nodesets/default.yml +10 -0
  83. data/modules/firewall/spec/acceptance/nodesets/fedora-18-x64.yml +10 -0
  84. data/modules/firewall/spec/acceptance/nodesets/sles-11sp1-x64.yml +10 -0
  85. data/modules/firewall/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml +10 -0
  86. data/modules/firewall/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml +10 -0
  87. data/modules/firewall/spec/{system → acceptance}/params_spec.rb +44 -52
  88. data/modules/firewall/spec/acceptance/purge_spec.rb +124 -0
  89. data/modules/firewall/spec/acceptance/resource_cmd_spec.rb +93 -0
  90. data/modules/firewall/spec/acceptance/rules_spec.rb +248 -0
  91. data/modules/firewall/spec/acceptance/socket_spec.rb +96 -0
  92. data/modules/firewall/spec/{system → acceptance}/standard_usage_spec.rb +6 -10
  93. data/modules/firewall/spec/fixtures/ip6tables/conversion_hash.rb +107 -0
  94. data/modules/firewall/spec/fixtures/iptables/conversion_hash.rb +56 -2
  95. data/modules/firewall/spec/spec_helper_acceptance.rb +38 -0
  96. data/modules/firewall/spec/unit/classes/firewall_spec.rb +2 -2
  97. data/modules/firewall/spec/unit/facter/iptables_persistent_version_spec.rb +8 -5
  98. data/modules/firewall/spec/unit/facter/iptables_spec.rb +6 -4
  99. data/modules/firewall/spec/unit/puppet/provider/iptables_chain_spec.rb +14 -4
  100. data/modules/firewall/spec/unit/puppet/provider/iptables_spec.rb +246 -5
  101. data/modules/firewall/spec/unit/puppet/type/firewall_spec.rb +99 -8
  102. data/modules/firewall/spec/unit/puppet/type/firewallchain_spec.rb +50 -6
  103. data/modules/firewall/spec/unit/puppet/util/firewall_spec.rb +21 -0
  104. data/modules/mysql/CHANGELOG +0 -30
  105. data/modules/mysql/Gemfile +0 -1
  106. data/modules/mysql/Gemfile.lock +30 -31
  107. data/modules/mysql/Modulefile +1 -1
  108. data/modules/mysql/README.md +2 -49
  109. data/modules/mysql/files/mysqltuner.pl +1 -1
  110. data/modules/mysql/lib/puppet/provider/database/mysql.rb +1 -1
  111. data/modules/mysql/lib/puppet/provider/database_grant/mysql.rb +1 -1
  112. data/modules/mysql/lib/puppet/provider/database_user/mysql.rb +1 -1
  113. data/modules/mysql/lib/puppet/provider/mysql.rb +1 -2
  114. data/modules/mysql/lib/puppet/provider/mysql_database/mysql.rb +13 -2
  115. data/modules/mysql/lib/puppet/provider/mysql_user/mysql.rb +12 -0
  116. data/modules/mysql/lib/puppet/type/database_user.rb +1 -1
  117. data/modules/mysql/lib/puppet/type/mysql_grant.rb +3 -5
  118. data/modules/mysql/manifests/client.pp +0 -7
  119. data/modules/mysql/manifests/server/root_password.pp +0 -2
  120. data/modules/mysql/manifests/server.pp +0 -6
  121. data/modules/mysql/metadata.json +79 -81
  122. data/modules/mysql/spec/classes/mysql_server_spec.rb +0 -74
  123. data/modules/mysql/spec/system/mysql_server_root_password_spec.rb +1 -7
  124. data/modules/mysql/spec/system/mysql_server_spec.rb +3 -6
  125. data/modules/mysql/spec/system/types/mysql_grant_spec.rb +0 -27
  126. data/modules/mysql/spec/unit/puppet/functions/mysql_deepmerge_spec.rb +1 -1
  127. data/modules/mysql/spec/unit/puppet/provider/database/mysql_spec.rb +4 -4
  128. data/modules/mysql/spec/unit/puppet/provider/database_grant/mysql_spec.rb +15 -15
  129. data/modules/mysql/spec/unit/puppet/provider/database_user/mysql_spec.rb +4 -4
  130. data/modules/mysql/spec/unit/puppet/provider/mysql_database/mysql_spec.rb +3 -3
  131. data/modules/mysql/spec/unit/puppet/provider/mysql_user/mysql_spec.rb +3 -3
  132. data/modules/mysql/templates/my.cnf.erb +2 -4
  133. data/modules/mysql/tests/mysql_grant.pp +1 -1
  134. data/modules/postgresql/Changelog +31 -0
  135. data/modules/postgresql/Gemfile +4 -2
  136. data/modules/postgresql/Modulefile +1 -1
  137. data/modules/postgresql/README.md +10 -4
  138. data/modules/postgresql/Rakefile +0 -1
  139. data/modules/postgresql/lib/puppet/provider/postgresql_psql/ruby.rb +25 -3
  140. data/modules/postgresql/manifests/globals.pp +2 -0
  141. data/modules/postgresql/manifests/params.pp +21 -0
  142. data/modules/postgresql/manifests/server/config.pp +0 -5
  143. data/modules/postgresql/manifests/server/config_entry.pp +1 -1
  144. data/modules/postgresql/manifests/server/database.pp +2 -1
  145. data/modules/postgresql/manifests/server/db.pp +2 -0
  146. data/modules/postgresql/manifests/server/grant.pp +20 -16
  147. data/modules/postgresql/manifests/server/initdb.pp +27 -3
  148. data/modules/postgresql/manifests/server/pg_hba_rule.pp +2 -4
  149. data/modules/postgresql/manifests/server/role.pp +8 -2
  150. data/modules/postgresql/manifests/server/service.pp +5 -0
  151. data/modules/postgresql/manifests/server.pp +2 -0
  152. data/modules/postgresql/metadata.json +88 -65
  153. data/modules/postgresql/spec/acceptance/client_spec.rb +18 -0
  154. data/modules/postgresql/spec/{system → acceptance}/common_patterns_spec.rb +8 -14
  155. data/modules/postgresql/spec/{system → acceptance}/contrib_spec.rb +4 -9
  156. data/modules/postgresql/spec/acceptance/lib/devel_spec.rb +17 -0
  157. data/modules/postgresql/spec/acceptance/lib/java_spec.rb +20 -0
  158. data/modules/postgresql/spec/acceptance/lib/python_spec.rb +19 -0
  159. data/modules/postgresql/spec/acceptance/nodesets/centos-510-x64.yml +10 -0
  160. data/modules/postgresql/spec/acceptance/nodesets/centos-59-x64.yml +10 -0
  161. data/modules/postgresql/spec/acceptance/nodesets/centos-64-x64-pe.yml +12 -0
  162. data/modules/postgresql/spec/acceptance/nodesets/centos-64-x64.yml +10 -0
  163. data/modules/postgresql/spec/acceptance/nodesets/debian-607-x64.yml +10 -0
  164. data/modules/postgresql/spec/acceptance/nodesets/debian-73-x64.yml +10 -0
  165. data/modules/postgresql/spec/acceptance/nodesets/default.yml +10 -0
  166. data/modules/postgresql/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml +10 -0
  167. data/modules/postgresql/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml +10 -0
  168. data/modules/postgresql/spec/{system → acceptance}/postgresql_psql_spec.rb +6 -14
  169. data/modules/postgresql/spec/{system → acceptance}/server/config_entry_spec.rb +6 -12
  170. data/modules/postgresql/spec/{system → acceptance}/server/database_grant_spec.rb +6 -12
  171. data/modules/postgresql/spec/{system → acceptance}/server/database_spec.rb +6 -12
  172. data/modules/postgresql/spec/{system → acceptance}/server/db_spec.rb +47 -42
  173. data/modules/postgresql/spec/{system → acceptance}/server/grant_spec.rb +6 -12
  174. data/modules/postgresql/spec/{system → acceptance}/server/pg_hba_rule_spec.rb +10 -23
  175. data/modules/postgresql/spec/{system → acceptance}/server/plperl_spec.rb +6 -10
  176. data/modules/postgresql/spec/{system → acceptance}/server/role_spec.rb +13 -28
  177. data/modules/postgresql/spec/acceptance/server/table_grant_spec.rb +124 -0
  178. data/modules/postgresql/spec/{system → acceptance}/server/tablespace_spec.rb +8 -22
  179. data/modules/postgresql/spec/{system → acceptance}/server_spec.rb +38 -61
  180. data/modules/postgresql/spec/{system → acceptance}/validate_db_connection_spec.rb +8 -20
  181. data/modules/postgresql/spec/spec_helper_acceptance.rb +70 -0
  182. data/modules/postgresql/spec/unit/classes/globals_spec.rb +2 -2
  183. data/modules/postgresql/spec/unit/classes/lib/devel_spec.rb +1 -1
  184. data/modules/postgresql/spec/unit/classes/params_spec.rb +1 -1
  185. data/modules/postgresql/spec/unit/classes/repo_spec.rb +1 -1
  186. data/modules/postgresql/spec/unit/classes/server/initdb_spec.rb +2 -1
  187. data/modules/postgresql/spec/unit/classes/server/plperl_spec.rb +2 -2
  188. data/modules/postgresql/spec/unit/classes/server_spec.rb +9 -2
  189. data/modules/postgresql/spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb +15 -17
  190. data/modules/rbenv/bin/autospec +0 -0
  191. data/modules/rbenv/bin/facter +0 -0
  192. data/modules/rbenv/bin/filebucket +0 -0
  193. data/modules/rbenv/bin/hiera +0 -0
  194. data/modules/rbenv/bin/htmldiff +0 -0
  195. data/modules/rbenv/bin/ldiff +0 -0
  196. data/modules/rbenv/bin/pi +0 -0
  197. data/modules/rbenv/bin/puppet +0 -0
  198. data/modules/rbenv/bin/puppet-lint +0 -0
  199. data/modules/rbenv/bin/puppet-module +0 -0
  200. data/modules/rbenv/bin/puppetca +0 -0
  201. data/modules/rbenv/bin/puppetd +0 -0
  202. data/modules/rbenv/bin/puppetdoc +0 -0
  203. data/modules/rbenv/bin/puppetmasterd +0 -0
  204. data/modules/rbenv/bin/puppetqd +0 -0
  205. data/modules/rbenv/bin/puppetrun +0 -0
  206. data/modules/rbenv/bin/rake +0 -0
  207. data/modules/rbenv/bin/ralsh +0 -0
  208. data/modules/rbenv/bin/rspec +0 -0
  209. data/modules/rbenv/bin/rspec-puppet-init +0 -0
  210. data/modules/stdlib/spec/monkey_patches/alias_should_to_must.rb +0 -0
  211. data/modules/stdlib/spec/monkey_patches/publicize_methods.rb +0 -0
  212. data/modules/stdlib/spec/unit/puppet/parser/functions/abs_spec.rb +0 -0
  213. data/modules/stdlib/spec/unit/puppet/parser/functions/bool2num_spec.rb +0 -0
  214. data/modules/stdlib/spec/unit/puppet/parser/functions/capitalize_spec.rb +0 -0
  215. data/modules/stdlib/spec/unit/puppet/parser/functions/chomp_spec.rb +0 -0
  216. data/modules/stdlib/spec/unit/puppet/parser/functions/chop_spec.rb +0 -0
  217. data/modules/stdlib/spec/unit/puppet/parser/functions/delete_at_spec.rb +0 -0
  218. data/modules/stdlib/spec/unit/puppet/parser/functions/delete_spec.rb +0 -0
  219. data/modules/stdlib/spec/unit/puppet/parser/functions/dirname_spec.rb +0 -0
  220. data/modules/stdlib/spec/unit/puppet/parser/functions/downcase_spec.rb +0 -0
  221. data/modules/stdlib/spec/unit/puppet/parser/functions/empty_spec.rb +0 -0
  222. data/modules/stdlib/spec/unit/puppet/parser/functions/flatten_spec.rb +0 -0
  223. data/modules/stdlib/spec/unit/puppet/parser/functions/grep_spec.rb +0 -0
  224. data/modules/stdlib/spec/unit/puppet/parser/functions/has_interface_with_spec.rb +0 -0
  225. data/modules/stdlib/spec/unit/puppet/parser/functions/has_ip_address_spec.rb +0 -0
  226. data/modules/stdlib/spec/unit/puppet/parser/functions/has_ip_network_spec.rb +0 -0
  227. data/modules/stdlib/spec/unit/puppet/parser/functions/max_spec.rb +0 -0
  228. data/modules/stdlib/spec/unit/puppet/parser/functions/min_spec.rb +0 -0
  229. data/modules/stdlib/spec/unit/puppet/parser/functions/reject_spec.rb +0 -0
  230. data/modules/stdlib/spec/unit/puppet/parser/functions/to_bytes_spec.rb +0 -0
  231. data/modules/stdlib/spec/unit/puppet/parser/functions/validate_slength_spec.rb +0 -0
  232. metadata +92 -77
  233. data/modules/apt/manifests/unattended_upgrades.pp +0 -68
  234. data/modules/apt/spec/classes/unattended_upgrades_spec.rb +0 -204
  235. data/modules/apt/spec/system/apt_builddep_spec.rb +0 -38
  236. data/modules/apt/spec/system/apt_key_spec.rb +0 -53
  237. data/modules/apt/spec/system/apt_ppa_spec.rb +0 -59
  238. data/modules/apt/spec/system/apt_source_spec.rb +0 -51
  239. data/modules/apt/spec/system/basic_spec.rb +0 -10
  240. data/modules/apt/spec/system/class_spec.rb +0 -20
  241. data/modules/apt/templates/10periodic.erb +0 -12
  242. data/modules/apt/templates/50unattended-upgrades.erb +0 -53
  243. data/modules/apt/tests/unattended-upgrades.pp +0 -1
  244. data/modules/concat/README.markdown +0 -150
  245. data/modules/concat/spec/defines/init_spec.rb +0 -115
  246. data/modules/concat/spec/fixtures/manifests/site.pp +0 -0
  247. data/modules/firewall/spec/spec_helper_system.rb +0 -49
  248. data/modules/firewall/spec/system/class_spec.rb +0 -39
  249. data/modules/firewall/spec/system/purge_spec.rb +0 -29
  250. data/modules/firewall/spec/system/resource_cmd_spec.rb +0 -53
  251. data/modules/mysql/manifests/server/providers.pp +0 -8
  252. data/modules/mysql/tests/bindings.pp +0 -3
  253. data/modules/postgresql/Gemfile.lock +0 -74
  254. data/modules/postgresql/spec/spec_helper_system.rb +0 -66
  255. data/modules/postgresql/spec/system/client_spec.rb +0 -22
  256. data/modules/postgresql/spec/system/lib/devel_spec.rb +0 -22
  257. data/modules/postgresql/spec/system/lib/java_spec.rb +0 -25
  258. data/modules/postgresql/spec/system/lib/python_spec.rb +0 -24
  259. data/modules/postgresql/spec/system/server/table_grant_spec.rb +0 -72
@@ -1,50 +1,50 @@
1
- # Sets up the concat system.
1
+ # === Class: concat::setup
2
2
  #
3
- # $concatdir is where the fragments live and is set on the fact concat_basedir.
4
- # Since puppet should always manage files in $concatdir and they should
5
- # not be deleted ever, /tmp is not an option.
3
+ # Sets up the concat system. This is a private class.
6
4
  #
7
- # $puppetversion should be either 24 or 25 to enable a 24 compatible
8
- # mode, in 24 mode you might see phantom notifies this is a side effect
9
- # of the method we use to clear the fragments directory.
10
- #
11
- # The regular expression below will try to figure out your puppet version
12
- # but this code will only work in 0.24.8 and newer.
5
+ # [$concatdir]
6
+ # is where the fragments live and is set on the fact concat_basedir.
7
+ # Since puppet should always manage files in $concatdir and they should
8
+ # not be deleted ever, /tmp is not an option.
13
9
  #
14
10
  # It also copies out the concatfragments.sh file to ${concatdir}/bin
11
+ #
15
12
  class concat::setup {
16
- $id = $::id
17
- $root_group = $id ? {
18
- root => 0,
19
- default => $id
13
+ if $caller_module_name != $module_name {
14
+ warning("${name} is deprecated as a public API of the ${module_name} module and should no longer be directly included in the manifest.")
20
15
  }
21
16
 
22
17
  if $::concat_basedir {
23
18
  $concatdir = $::concat_basedir
24
19
  } else {
25
- fail ("\$concat_basedir not defined. Try running again with pluginsync enabled")
20
+ fail ('$concat_basedir not defined. Try running again with pluginsync=true on the [master] and/or [main] section of your node\'s \'/etc/puppet/puppet.conf\'.')
21
+ }
22
+
23
+ $script_name = $::kernel ? {
24
+ 'windows' => 'concatfragments.rb',
25
+ default => 'concatfragments.sh'
26
+ }
27
+
28
+ $script_path = "${concatdir}/bin/${script_name}"
29
+
30
+ $script_command = $::kernel ? {
31
+ 'windows' => "ruby.exe ${script_path}",
32
+ default => $script_path
26
33
  }
27
34
 
28
- $majorversion = regsubst($::puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1')
29
- $fragments_source = $majorversion ? {
30
- 24 => 'puppet:///concat/concatfragments.sh',
31
- default => 'puppet:///modules/concat/concatfragments.sh'
35
+ File {
36
+ backup => false,
32
37
  }
33
38
 
34
- file{"${concatdir}/bin/concatfragments.sh":
35
- owner => $id,
36
- group => $root_group,
39
+ file { $script_path:
40
+ ensure => file,
41
+ owner => $::id,
37
42
  mode => '0755',
38
- source => $fragments_source;
43
+ source => "puppet:///modules/concat/${script_name}",
44
+ }
39
45
 
40
- [ $concatdir, "${concatdir}/bin" ]:
46
+ file { [ $concatdir, "${concatdir}/bin" ]:
41
47
  ensure => directory,
42
- owner => $id,
43
- group => $root_group,
44
- mode => '0750';
45
-
46
- ## Old versions of this module used a different path.
47
- '/usr/local/bin/concatfragments.sh':
48
- ensure => absent;
48
+ mode => '0755',
49
49
  }
50
50
  }
@@ -1,31 +1,50 @@
1
1
  {
2
- "license": "Apache",
2
+ "name": "puppetlabs-concat",
3
+ "version": "1.1.0-rc1",
4
+ "source": "git://github.com/puppetlabs/puppetlabs-concat.git",
5
+ "author": "Puppetlabs",
6
+ "license": "Apache 2.0",
7
+ "summary": "Concat module",
8
+ "description": "Concat module",
9
+ "project_page": "http://github.com/puppetlabs/puppetlabs-concat",
3
10
  "dependencies": [
4
-
11
+ {
12
+ "name": "puppetlabs/stdlib",
13
+ "version_requirement": ">= 3.0.0"
14
+ }
5
15
  ],
6
- "source": "git://github.com/ripienaar/puppet-concat.git",
7
- "version": "0.2.0",
8
- "description": "Concat module",
9
- "summary": "Concat module",
10
16
  "types": [
11
17
 
12
18
  ],
13
- "author": "R.I.Pienaar",
14
- "project_page": "http://github.com/ripienaar/puppet-concat",
15
- "name": "ripienaar-concat",
16
19
  "checksums": {
17
- "spec/fixtures/manifests/site.pp": "d41d8cd98f00b204e9800998ecf8427e",
18
- "files/concatfragments.sh": "256169ee61115a6b717b2844d2ea3128",
20
+ "CHANGELOG": "e8e366be83819324f167e4966a872bdc",
21
+ "Gemfile": "d84cde6589d6c4003f15744d1eb0a2f0",
22
+ "Gemfile.lock": "39cbdebd1a4a3f3e9870fd28ef4d51ab",
23
+ "LICENSE": "f5a76685d453424cd63dde1535811cf0",
24
+ "Modulefile": "974590b1e266245fd03dc100d685e38e",
25
+ "README.md": "3a7350be9aff722e9aa04d4abefd5f28",
26
+ "Rakefile": "96b14653a661e66ab8dc54c33c103a9c",
27
+ "files/concatfragments.rb": "6784c28044a4204efb75fe4eb759816a",
28
+ "files/concatfragments.sh": "e7aaa4c45316eb97d2d88b57334c4060",
29
+ "lib/facter/concat_basedir.rb": "ff080677e7f192b9b96911698b0b9b3d",
30
+ "manifests/fragment.pp": "01bd7ea14eec8a3d95d895dccbb3351a",
31
+ "manifests/init.pp": "fc4c46156e23b9562c85f136cf16502e",
32
+ "manifests/setup.pp": "1d4c51a1883f05129e56b869e0201f92",
19
33
  "spec/spec_helper.rb": "0db89c9a486df193c0e40095422e19dc",
20
- "README.markdown": "f0605b99afffca3404e3a80dad951d83",
21
- "Modulefile": "5dda7c51425f5337bb3234993a52732f",
22
- "CHANGELOG": "543eb3beeb56b779171cff6e181a44cb",
23
- "manifests/fragment.pp": "a34e1f60a31bb64eaed22745f70a88e7",
24
- "lib/facter/concat_basedir.rb": "f2e991697602ffb3e80e0cc9efa37f3a",
25
- "spec/defines/init_spec.rb": "cc8ce111b49906033dbf7837bc6b7495",
26
- "manifests/init.pp": "7128c08a525c7bbc8bf4a721ad1c4f3e",
27
- "manifests/setup.pp": "dc8d30bc47d447c5bde2c390fd34541c",
28
- "Rakefile": "f37e6131fe7de9a49b09d31596f5fbf1",
29
- "LICENSE": "f5a76685d453424cd63dde1535811cf0"
34
+ "spec/spec_helper_system.rb": "048464aba919291ea7a2041e4aad2fdd",
35
+ "spec/system/basic_spec.rb": "9135d9af6a21f16980ab59b58e91ed9a",
36
+ "spec/system/concat_spec.rb": "84379caf03862d05c68518eb351b1710",
37
+ "spec/system/deprecation_warnings_spec.rb": "234e697f7716d21581cdf5f1b4d87ecb",
38
+ "spec/system/empty_spec.rb": "36f131e28e0ac134a7c8c141814370fa",
39
+ "spec/system/fragment_source_spec.rb": "7fc98976cf94cd0b395846ecbf7f4889",
40
+ "spec/system/replace_spec.rb": "8186d0bc3f2bdb5edbb00a77846dc219",
41
+ "spec/system/symbolic_name_spec.rb": "c3634e28d287c4021859c556256be9fc",
42
+ "spec/system/warn_spec.rb": "94edec0fdd519d0911a5beb90bd1c90e",
43
+ "spec/unit/classes/concat_setup_spec.rb": "6d3729833715d65f3c50c2153caed6bc",
44
+ "spec/unit/defines/concat_fragment_spec.rb": "ced7c3b1b6d7f2e65c6dc066aa8c0527",
45
+ "spec/unit/defines/concat_spec.rb": "33f09af54a1d9039c5316743f34fc7bc",
46
+ "spec/unit/facts/concat_basedir_spec.rb": "cf00f5a07948436fa0a84d00fc098539",
47
+ "tests/fragment.pp": "9adc3d9ba61676066072e1b949a37dbb",
48
+ "tests/init.pp": "bd3ce7d2ee146744b5dbbaae8a927043"
30
49
  }
31
50
  }
@@ -1,11 +1,9 @@
1
1
  require 'rspec-system/spec_helper'
2
2
  require 'rspec-system-puppet/helpers'
3
3
  require 'rspec-system-serverspec/helpers'
4
-
5
- include RSpecSystemPuppet::Helpers
6
-
7
4
  include Serverspec::Helper::RSpecSystem
8
5
  include Serverspec::Helper::DetectOS
6
+ include RSpecSystemPuppet::Helpers
9
7
 
10
8
  RSpec.configure do |c|
11
9
  # Project root
@@ -18,13 +16,20 @@ RSpec.configure do |c|
18
16
 
19
17
  # This is where we 'setup' the nodes before running our tests
20
18
  c.before :suite do
21
- # May as well update here as this can only run on apt-get machines.
22
- shell('apt-get update')
23
19
  # Install puppet
24
20
  puppet_install
25
21
 
26
22
  # Install modules and dependencies
27
- puppet_module_install(:source => proj_root, :module_name => 'apt')
23
+ puppet_module_install(:source => proj_root, :module_name => 'concat')
28
24
  shell('puppet module install puppetlabs-stdlib')
29
25
  end
26
+
27
+ c.before(:all) do
28
+ shell('mkdir -p /tmp/concat')
29
+ end
30
+ c.after(:all) do
31
+ shell('rm -rf /tmp/concat /var/lib/puppet/concat')
32
+ end
33
+
34
+ c.treat_symbols_as_metadata_keys_with_true_values = true
30
35
  end
@@ -4,7 +4,7 @@ require 'spec_helper_system'
4
4
  describe "basic tests:" do
5
5
  context 'make sure we have copied the module across' do
6
6
  # No point diagnosing any more if the module wasn't copied properly
7
- context shell 'ls /etc/puppet/modules/firewall' do
7
+ context shell 'ls /etc/puppet/modules/concat' do
8
8
  its(:stdout) { should =~ /Modulefile/ }
9
9
  its(:stderr) { should be_empty }
10
10
  its(:exit_code) { should be_zero }
@@ -0,0 +1,154 @@
1
+ require 'spec_helper_system'
2
+
3
+ describe 'basic concat test' do
4
+
5
+ shared_examples 'successfully_applied' do |pp|
6
+ context puppet_apply(pp) do
7
+ its(:stderr) { should be_empty }
8
+ its(:exit_code) { should_not == 1 }
9
+ its(:refresh) { should be_nil }
10
+ its(:stderr) { should be_empty }
11
+ its(:exit_code) { should be_zero }
12
+ end
13
+
14
+ describe file('/var/lib/puppet/concat') do
15
+ it { should be_directory }
16
+ it { should be_owned_by 'root' }
17
+ it { should be_grouped_into 'root' }
18
+ it { should be_mode 755 }
19
+ end
20
+ describe file('/var/lib/puppet/concat/bin') do
21
+ it { should be_directory }
22
+ it { should be_owned_by 'root' }
23
+ it { should be_grouped_into 'root' }
24
+ it { should be_mode 755 }
25
+ end
26
+ describe file('/var/lib/puppet/concat/bin/concatfragments.sh') do
27
+ it { should be_file }
28
+ it { should be_owned_by 'root' }
29
+ #it { should be_grouped_into 'root' }
30
+ it { should be_mode 755 }
31
+ end
32
+ describe file('/var/lib/puppet/concat/_tmp_concat_file') do
33
+ it { should be_directory }
34
+ it { should be_owned_by 'root' }
35
+ it { should be_grouped_into 'root' }
36
+ it { should be_mode 750 }
37
+ end
38
+ describe file('/var/lib/puppet/concat/_tmp_concat_file/fragments') do
39
+ it { should be_directory }
40
+ it { should be_owned_by 'root' }
41
+ it { should be_grouped_into 'root' }
42
+ it { should be_mode 750 }
43
+ end
44
+ describe file('/var/lib/puppet/concat/_tmp_concat_file/fragments.concat') do
45
+ it { should be_file }
46
+ it { should be_owned_by 'root' }
47
+ it { should be_grouped_into 'root' }
48
+ it { should be_mode 640 }
49
+ end
50
+ describe file('/var/lib/puppet/concat/_tmp_concat_file/fragments.concat.out') do
51
+ it { should be_file }
52
+ it { should be_owned_by 'root' }
53
+ it { should be_grouped_into 'root' }
54
+ it { should be_mode 640 }
55
+ end
56
+ end
57
+
58
+ context 'owner/group root' do
59
+ pp = <<-EOS
60
+ concat { '/tmp/concat/file':
61
+ owner => 'root',
62
+ group => 'root',
63
+ mode => '0644',
64
+ }
65
+
66
+ concat::fragment { '1':
67
+ target => '/tmp/concat/file',
68
+ content => '1',
69
+ order => '01',
70
+ }
71
+
72
+ concat::fragment { '2':
73
+ target => '/tmp/concat/file',
74
+ content => '2',
75
+ order => '02',
76
+ }
77
+ EOS
78
+
79
+ it_behaves_like 'successfully_applied', pp
80
+
81
+ describe file('/tmp/concat/file') do
82
+ it { should be_file }
83
+ it { should be_owned_by 'root' }
84
+ it { should be_grouped_into 'root' }
85
+ it { should be_mode 644 }
86
+ it { should contain '1' }
87
+ it { should contain '2' }
88
+ end
89
+ describe file('/var/lib/puppet/concat/_tmp_concat_file/fragments/01_1') do
90
+ it { should be_file }
91
+ it { should be_owned_by 'root' }
92
+ it { should be_grouped_into 'root' }
93
+ it { should be_mode 640 }
94
+ end
95
+ describe file('/var/lib/puppet/concat/_tmp_concat_file/fragments/02_2') do
96
+ it { should be_file }
97
+ it { should be_owned_by 'root' }
98
+ it { should be_grouped_into 'root' }
99
+ it { should be_mode 640 }
100
+ end
101
+ end
102
+
103
+ context 'owner/group non-root' do
104
+ before(:all) do
105
+ shell "groupadd -g 42 bob"
106
+ shell "useradd -u 42 -g 42 bob"
107
+ end
108
+
109
+ pp="
110
+ concat { '/tmp/concat/file':
111
+ owner => 'bob',
112
+ group => 'bob',
113
+ mode => '0644',
114
+ }
115
+
116
+ concat::fragment { '1':
117
+ target => '/tmp/concat/file',
118
+ content => '1',
119
+ order => '01',
120
+ }
121
+
122
+ concat::fragment { '2':
123
+ target => '/tmp/concat/file',
124
+ content => '2',
125
+ order => '02',
126
+ }
127
+ "
128
+
129
+ it_behaves_like 'successfully_applied', pp
130
+
131
+ describe file('/tmp/concat/file') do
132
+ it { should be_file }
133
+ it { should be_owned_by 'bob' }
134
+ it { should be_grouped_into 'bob' }
135
+ it { should be_mode 644 }
136
+ it { should contain '1' }
137
+ it { should contain '2' }
138
+ end
139
+ describe file('/var/lib/puppet/concat/_tmp_concat_file/fragments/01_1') do
140
+ it { should be_file }
141
+ it { should be_owned_by 'root' }
142
+ it { should be_grouped_into 'root' }
143
+ it { should be_mode 640 }
144
+ it { should contain '1' }
145
+ end
146
+ describe file('/var/lib/puppet/concat/_tmp_concat_file/fragments/02_2') do
147
+ it { should be_file }
148
+ it { should be_owned_by 'root' }
149
+ it { should be_grouped_into 'root' }
150
+ it { should be_mode 640 }
151
+ it { should contain '2' }
152
+ end
153
+ end
154
+ end
@@ -0,0 +1,247 @@
1
+ require 'spec_helper_system'
2
+
3
+ describe 'deprecation warnings' do
4
+
5
+ shared_examples 'has_warning'do |pp, w|
6
+ context puppet_apply(pp) do
7
+ its(:stderr) { should =~ /#{Regexp.escape(w)}/m }
8
+ its(:exit_code) { should_not == 1 }
9
+ its(:refresh) { should be_nil }
10
+ its(:stderr) { should =~ /#{Regexp.escape(w)}/m }
11
+ its(:exit_code) { should be_zero }
12
+ end
13
+ end
14
+
15
+ context 'concat gnu parameter' do
16
+ pp = <<-EOS
17
+ concat { '/tmp/concat/file':
18
+ gnu => 'foo',
19
+ }
20
+ concat::fragment { 'foo':
21
+ target => '/tmp/concat/file',
22
+ content => 'bar',
23
+ }
24
+ EOS
25
+ w = 'The $gnu parameter to concat is deprecated and has no effect'
26
+
27
+ it_behaves_like 'has_warning', pp, w
28
+ end
29
+
30
+ context 'concat warn parameter =>' do
31
+ ['true', 'yes', 'on'].each do |warn|
32
+ context warn do
33
+ pp = <<-EOS
34
+ concat { '/tmp/concat/file':
35
+ warn => '#{warn}',
36
+ }
37
+ concat::fragment { 'foo':
38
+ target => '/tmp/concat/file',
39
+ content => 'bar',
40
+ }
41
+ EOS
42
+ w = 'Using stringified boolean values (\'true\', \'yes\', \'on\', \'false\', \'no\', \'off\') to represent boolean true/false as the $warn parameter to concat is deprecated and will be treated as the warning message in a future release'
43
+
44
+ it_behaves_like 'has_warning', pp, w
45
+
46
+ describe file('/tmp/concat/file') do
47
+ it { should be_file }
48
+ it { should contain '# This file is managed by Puppet. DO NOT EDIT.' }
49
+ it { should contain 'bar' }
50
+ end
51
+ end
52
+ end
53
+
54
+ ['false', 'no', 'off'].each do |warn|
55
+ context warn do
56
+ pp = <<-EOS
57
+ concat { '/tmp/concat/file':
58
+ warn => '#{warn}',
59
+ }
60
+ concat::fragment { 'foo':
61
+ target => '/tmp/concat/file',
62
+ content => 'bar',
63
+ }
64
+ EOS
65
+ w = 'Using stringified boolean values (\'true\', \'yes\', \'on\', \'false\', \'no\', \'off\') to represent boolean true/false as the $warn parameter to concat is deprecated and will be treated as the warning message in a future release'
66
+
67
+ it_behaves_like 'has_warning', pp, w
68
+
69
+ describe file('/tmp/concat/file') do
70
+ it { should be_file }
71
+ it { should_not contain '# This file is managed by Puppet. DO NOT EDIT.' }
72
+ it { should contain 'bar' }
73
+ end
74
+ end
75
+ end
76
+ end
77
+
78
+ context 'concat::fragment ensure parameter' do
79
+ context 'target file exists' do
80
+ before(:all) do
81
+ shell("/bin/echo 'file1 contents' > /tmp/concat/file1")
82
+ end
83
+ after(:all) do
84
+ # XXX this test may leave behind a symlink in the fragment directory
85
+ # which could cause warnings and/or breakage from the subsequent tests
86
+ # unless we clean it up.
87
+ shell('rm -rf /tmp/concat /var/lib/puppet/concat')
88
+ shell('mkdir -p /tmp/concat')
89
+ end
90
+
91
+ pp = <<-EOS
92
+ concat { '/tmp/concat/file': }
93
+ concat::fragment { 'foo':
94
+ target => '/tmp/concat/file',
95
+ ensure => '/tmp/concat/file1',
96
+ }
97
+ EOS
98
+ w = 'Passing a value other than \'present\' or \'absent\' as the $ensure parameter to concat::fragment is deprecated. If you want to use the content of a file as a fragment please use the $source parameter.'
99
+
100
+ it_behaves_like 'has_warning', pp, w
101
+
102
+ describe file('/tmp/concat/file') do
103
+ it { should be_file }
104
+ it { should contain 'file1 contents' }
105
+ end
106
+
107
+ # check that the fragment can be changed from a symlink to a plain file
108
+
109
+ pp = <<-EOS
110
+ concat { '/tmp/concat/file': }
111
+ concat::fragment { 'foo':
112
+ target => '/tmp/concat/file',
113
+ content => 'new content',
114
+ }
115
+ EOS
116
+
117
+ context puppet_apply(pp) do
118
+ its(:stderr) { should be_empty }
119
+ its(:exit_code) { should_not == 1 }
120
+ its(:refresh) { should be_nil }
121
+ its(:stderr) { should be_empty }
122
+ its(:exit_code) { should be_zero }
123
+ end
124
+
125
+ describe file('/tmp/concat/file') do
126
+ it { should be_file }
127
+ it { should contain 'new content' }
128
+ it { should_not contain 'file1 contents' }
129
+ end
130
+ end # target file exists
131
+
132
+ context 'target does not exist' do
133
+ after(:all) do
134
+ # XXX this test may leave behind a symlink in the fragment directory
135
+ # which could cause warnings and/or breakage from the subsequent tests
136
+ # unless we clean it up.
137
+ shell('rm -rf /tmp/concat /var/lib/puppet/concat')
138
+ shell('mkdir -p /tmp/concat')
139
+ end
140
+
141
+ pp = <<-EOS
142
+ concat { '/tmp/concat/file': }
143
+ concat::fragment { 'foo':
144
+ target => '/tmp/concat/file',
145
+ ensure => '/tmp/concat/file1',
146
+ }
147
+ EOS
148
+ w = 'Passing a value other than \'present\' or \'absent\' as the $ensure parameter to concat::fragment is deprecated. If you want to use the content of a file as a fragment please use the $source parameter.'
149
+
150
+ it_behaves_like 'has_warning', pp, w
151
+
152
+ describe file('/tmp/concat/file') do
153
+ it { should be_file }
154
+ end
155
+
156
+ # check that the fragment can be changed from a symlink to a plain file
157
+
158
+ pp = <<-EOS
159
+ concat { '/tmp/concat/file': }
160
+ concat::fragment { 'foo':
161
+ target => '/tmp/concat/file',
162
+ content => 'new content',
163
+ }
164
+ EOS
165
+
166
+ context puppet_apply(pp) do
167
+ its(:stderr) { should be_empty }
168
+ its(:exit_code) { should_not == 1 }
169
+ its(:refresh) { should be_nil }
170
+ its(:stderr) { should be_empty }
171
+ its(:exit_code) { should be_zero }
172
+ end
173
+
174
+ describe file('/tmp/concat/file') do
175
+ it { should be_file }
176
+ it { should contain 'new content' }
177
+ end
178
+ end # target file exists
179
+
180
+ end # concat::fragment ensure parameter
181
+
182
+ context 'concat::fragment mode parameter' do
183
+ pp = <<-EOS
184
+ concat { '/tmp/concat/file': }
185
+ concat::fragment { 'foo':
186
+ target => '/tmp/concat/file',
187
+ content => 'bar',
188
+ mode => 'bar',
189
+ }
190
+ EOS
191
+ w = 'The $mode parameter to concat::fragment is deprecated and has no effect'
192
+
193
+ it_behaves_like 'has_warning', pp, w
194
+ end
195
+
196
+ context 'concat::fragment owner parameter' do
197
+ pp = <<-EOS
198
+ concat { '/tmp/concat/file': }
199
+ concat::fragment { 'foo':
200
+ target => '/tmp/concat/file',
201
+ content => 'bar',
202
+ owner => 'bar',
203
+ }
204
+ EOS
205
+ w = 'The $owner parameter to concat::fragment is deprecated and has no effect'
206
+
207
+ it_behaves_like 'has_warning', pp, w
208
+ end
209
+
210
+ context 'concat::fragment group parameter' do
211
+ pp = <<-EOS
212
+ concat { '/tmp/concat/file': }
213
+ concat::fragment { 'foo':
214
+ target => '/tmp/concat/file',
215
+ content => 'bar',
216
+ group => 'bar',
217
+ }
218
+ EOS
219
+ w = 'The $group parameter to concat::fragment is deprecated and has no effect'
220
+
221
+ it_behaves_like 'has_warning', pp, w
222
+ end
223
+
224
+ context 'concat::fragment backup parameter' do
225
+ pp = <<-EOS
226
+ concat { '/tmp/concat/file': }
227
+ concat::fragment { 'foo':
228
+ target => '/tmp/concat/file',
229
+ content => 'bar',
230
+ backup => 'bar',
231
+ }
232
+ EOS
233
+ w = 'The $backup parameter to concat::fragment is deprecated and has no effect'
234
+
235
+ it_behaves_like 'has_warning', pp, w
236
+ end
237
+
238
+ context 'include concat::setup' do
239
+ pp = <<-EOS
240
+ include concat::setup
241
+ EOS
242
+ w = 'concat::setup is deprecated as a public API of the concat module and should no longer be directly included in the manifest.'
243
+
244
+ it_behaves_like 'has_warning', pp, w
245
+ end
246
+
247
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper_system'
2
+
3
+ describe 'basic concat test' do
4
+ context 'should run successfully' do
5
+ pp = <<-EOS
6
+ concat { '/tmp/concat/file':
7
+ owner => root,
8
+ group => root,
9
+ mode => '0644',
10
+ force => true,
11
+ }
12
+ EOS
13
+
14
+ context puppet_apply(pp) do
15
+ its(:stderr) { should be_empty }
16
+ its(:exit_code) { should_not == 1 }
17
+ its(:refresh) { should be_nil }
18
+ its(:stderr) { should be_empty }
19
+ its(:exit_code) { should be_zero }
20
+ end
21
+
22
+ describe file('/tmp/concat/file') do
23
+ it { should be_file }
24
+ it { should_not contain '1\n2' }
25
+ end
26
+ end
27
+ end