bebox 0.0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +78 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +163 -0
- data/LICENSE +21 -0
- data/README.md +372 -0
- data/Rakefile +8 -0
- data/bebox.gemspec +40 -0
- data/bin/bebox +5 -0
- data/lib/bebox/cli.rb +42 -0
- data/lib/bebox/commands/commands_helper.rb +33 -0
- data/lib/bebox/commands/environment_commands.rb +46 -0
- data/lib/bebox/commands/general_commands.rb +24 -0
- data/lib/bebox/commands/node_commands.rb +68 -0
- data/lib/bebox/commands/prepare_commands.rb +59 -0
- data/lib/bebox/commands/project_commands.rb +44 -0
- data/lib/bebox/commands/provision_commands.rb +145 -0
- data/lib/bebox/environment.rb +114 -0
- data/lib/bebox/logger.rb +51 -0
- data/lib/bebox/node.rb +308 -0
- data/lib/bebox/profile.rb +102 -0
- data/lib/bebox/project.rb +259 -0
- data/lib/bebox/provision.rb +257 -0
- data/lib/bebox/role.rb +103 -0
- data/lib/bebox/version.rb +3 -0
- data/lib/bebox/wizards/environment_wizard.rb +45 -0
- data/lib/bebox/wizards/node_wizard.rb +163 -0
- data/lib/bebox/wizards/profile_wizard.rb +91 -0
- data/lib/bebox/wizards/project_wizard.rb +175 -0
- data/lib/bebox/wizards/provision_wizard.rb +80 -0
- data/lib/bebox/wizards/role_wizard.rb +97 -0
- data/lib/bebox.rb +2 -0
- data/lib/deb/puppet_3.6.0/augeas-lenses_0.10.0-0ubuntu4_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/debconf-utils_1.5.42ubuntu1_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/facter_2.0.1-1puppetlabs1_amd64.deb +0 -0
- data/lib/deb/puppet_3.6.0/hiera_1.3.2-1puppetlabs1_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/libaugeas-ruby1.8_0.3.0-1.1ubuntu4_amd64.deb +0 -0
- data/lib/deb/puppet_3.6.0/libaugeas-ruby_0.3.0-1.1ubuntu4_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/libaugeas0_0.10.0-0ubuntu4_amd64.deb +0 -0
- data/lib/deb/puppet_3.6.0/libjson-ruby_1.6.3-1_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/libruby1.8_1.8.7.352-2ubuntu1.4_amd64.deb +0 -0
- data/lib/deb/puppet_3.6.0/libruby_4.8_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/libshadow-ruby1.8_1.4.1-8build1_amd64.deb +0 -0
- data/lib/deb/puppet_3.6.0/puppet-common_3.6.0-1puppetlabs1_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/puppet_3.6.0-1puppetlabs1_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/ruby-json_1.6.3-1_amd64.deb +0 -0
- data/lib/deb/puppet_3.6.0/ruby-rgen_0.6.5-1puppetlabs1_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/ruby1.8_1.8.7.352-2ubuntu1.4_amd64.deb +0 -0
- data/lib/deb/puppet_3.6.0/ruby_4.8_all.deb +0 -0
- data/lib/deb/puppet_3.6.0/virt-what_1.11-1_amd64.deb +0 -0
- data/lib/templates/node/Vagrantfile.erb +18 -0
- data/lib/templates/node/deploy_vagrant_node.erb +3 -0
- data/lib/templates/node/node.yml.erb +3 -0
- data/lib/templates/node/prepared_node.yml.erb +4 -0
- data/lib/templates/node/provisioned_node.yml.erb +4 -0
- data/lib/templates/project/Capfile.erb +2 -0
- data/lib/templates/project/Gemfile.erb +5 -0
- data/lib/templates/project/config/deploy/environment.erb +40 -0
- data/lib/templates/project/config/deploy/vagrant.erb +42 -0
- data/lib/templates/project/config/deploy.erb +120 -0
- data/lib/templates/project/dot_bebox.erb +4 -0
- data/lib/templates/project/gitignore.erb +7 -0
- data/lib/templates/project/ubuntu_dependencies +10 -0
- data/lib/templates/puppet/default_profiles/base/fundamental/ruby/Puppetfile +0 -0
- data/lib/templates/puppet/default_profiles/base/fundamental/ruby/manifests/init.pp +24 -0
- data/lib/templates/puppet/default_profiles/base/fundamental/sudo/Puppetfile +0 -0
- data/lib/templates/puppet/default_profiles/base/fundamental/sudo/manifests/init.pp +22 -0
- data/lib/templates/puppet/default_profiles/base/fundamental/users/Puppetfile +0 -0
- data/lib/templates/puppet/default_profiles/base/fundamental/users/manifests/init.pp +18 -0
- data/lib/templates/puppet/default_profiles/base/security/fail2ban/Puppetfile +2 -0
- data/lib/templates/puppet/default_profiles/base/security/fail2ban/manifests/init.pp +28 -0
- data/lib/templates/puppet/default_profiles/base/security/iptables/Puppetfile +2 -0
- data/lib/templates/puppet/default_profiles/base/security/iptables/manifests/init.pp +27 -0
- data/lib/templates/puppet/default_profiles/base/security/ssh/Puppetfile +2 -0
- data/lib/templates/puppet/default_profiles/base/security/ssh/manifests/init.pp +30 -0
- data/lib/templates/puppet/default_profiles/base/security/sysctl/Puppetfile +2 -0
- data/lib/templates/puppet/default_profiles/base/security/sysctl/manifests/init.pp +20 -0
- data/lib/templates/puppet/default_profiles/base/users/ssh/Puppetfile +2 -0
- data/lib/templates/puppet/default_profiles/base/users/ssh/manifests/init.pp +47 -0
- data/lib/templates/puppet/default_profiles/base/users/users/Puppetfile +0 -0
- data/lib/templates/puppet/default_profiles/base/users/users/manifests/init.pp +18 -0
- data/lib/templates/puppet/default_roles/fundamental/manifests/init.pp +16 -0
- data/lib/templates/puppet/default_roles/security/manifests/init.pp +17 -0
- data/lib/templates/puppet/default_roles/users/manifests/init.pp +15 -0
- data/lib/templates/puppet/profiles/Puppetfile.erb +24 -0
- data/lib/templates/puppet/profiles/manifests/init.pp.erb +17 -0
- data/lib/templates/puppet/roles/manifests/init.pp.erb +14 -0
- data/lib/templates/puppet/step-0/Puppetfile.erb +5 -0
- data/lib/templates/puppet/step-0/hiera/data/common.yaml.erb +26 -0
- data/lib/templates/puppet/step-0/hiera/data/environment.yaml.erb +26 -0
- data/lib/templates/puppet/step-0/hiera/data/node.yaml.erb +26 -0
- data/lib/templates/puppet/step-0/hiera/hiera.yaml.erb +11 -0
- data/lib/templates/puppet/step-0/manifests/node.erb +5 -0
- data/lib/templates/puppet/step-0/manifests/site.pp.erb +15 -0
- data/lib/templates/puppet/step-0/modules/rbenv/AUTHORS +11 -0
- data/lib/templates/puppet/step-0/modules/rbenv/CHANGELOG.md +70 -0
- data/lib/templates/puppet/step-0/modules/rbenv/Gemfile +8 -0
- data/lib/templates/puppet/step-0/modules/rbenv/Gemfile.lock +28 -0
- data/lib/templates/puppet/step-0/modules/rbenv/Modulefile +7 -0
- data/lib/templates/puppet/step-0/modules/rbenv/README.md +173 -0
- data/lib/templates/puppet/step-0/modules/rbenv/Rakefile +22 -0
- data/lib/templates/puppet/step-0/modules/rbenv/TODO +10 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/autospec +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/facter +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/filebucket +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/hiera +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/htmldiff +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/ldiff +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/pi +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/puppet +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/puppet-lint +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/puppet-module +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetca +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetd +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetdoc +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetmasterd +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetqd +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/puppetrun +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/rake +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/ralsh +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/rspec +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/bin/rspec-puppet-init +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/lib/puppet/provider/rbenvgem/default.rb +50 -0
- data/lib/templates/puppet/step-0/modules/rbenv/lib/puppet/type/rbenvgem.rb +62 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/bundle.pp +36 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/client.pp +48 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/compile.pp +102 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/definition.pp +31 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/dependencies/centos.pp +25 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/dependencies/suse.pp +28 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/dependencies/ubuntu.pp +17 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/dependencies.pp +8 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/gem.pp +29 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/install.pp +55 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/plugin/rbenvvars.pp +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/plugin/rubybuild.pp +16 -0
- data/lib/templates/puppet/step-0/modules/rbenv/manifests/plugin.pp +40 -0
- data/lib/templates/puppet/step-0/modules/rbenv/metadata.json +109 -0
- data/lib/templates/puppet/step-0/modules/rbenv/templates/Gemfile.erb +5 -0
- data/lib/templates/puppet/step-0/modules/rbenv/templates/dot.rbenvrc.erb +8 -0
- data/lib/templates/puppet/step-0/modules/stdlib/CHANGELOG.md +418 -0
- data/lib/templates/puppet/step-0/modules/stdlib/CONTRIBUTING.md +65 -0
- data/lib/templates/puppet/step-0/modules/stdlib/Gemfile +33 -0
- data/lib/templates/puppet/step-0/modules/stdlib/Gemfile.lock +166 -0
- data/lib/templates/puppet/step-0/modules/stdlib/LICENSE +19 -0
- data/lib/templates/puppet/step-0/modules/stdlib/Modulefile +11 -0
- data/lib/templates/puppet/step-0/modules/stdlib/README.markdown +1304 -0
- data/lib/templates/puppet/step-0/modules/stdlib/README_DEVELOPER.markdown +35 -0
- data/lib/templates/puppet/step-0/modules/stdlib/README_SPECS.markdown +7 -0
- data/lib/templates/puppet/step-0/modules/stdlib/RELEASE_PROCESS.markdown +24 -0
- data/lib/templates/puppet/step-0/modules/stdlib/Rakefile +18 -0
- data/lib/templates/puppet/step-0/modules/stdlib/checksums.json +349 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/facter_dot_d.rb +202 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/pe_version.rb +53 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/puppet_vardir.rb +26 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/root_home.rb +32 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/facter/util/puppet_settings.rb +21 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/abs.rb +36 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/any2array.rb +33 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/base64.rb +37 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/bool2num.rb +49 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/capitalize.rb +34 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/chomp.rb +35 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/chop.rb +37 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/concat.rb +41 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/count.rb +22 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/deep_merge.rb +44 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/defined_with_params.rb +35 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/delete.rb +46 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/delete_at.rb +49 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/delete_undef_values.rb +34 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/delete_values.rb +26 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/difference.rb +36 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/dirname.rb +15 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/downcase.rb +33 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/empty.rb +28 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/ensure_packages.rb +35 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb +45 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/flatten.rb +33 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/floor.rb +25 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/fqdn_rotate.rb +46 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/get_module_path.rb +17 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/getparam.rb +35 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/getvar.rb +26 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/grep.rb +33 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/has_interface_with.rb +52 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/has_ip_address.rb +25 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/has_ip_network.rb +25 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/has_key.rb +28 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/hash.rb +41 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/intersection.rb +34 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_array.rb +22 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_bool.rb +22 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_domain_name.rb +50 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_float.rb +30 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_function_available.rb +26 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_hash.rb +22 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_integer.rb +45 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_ip_address.rb +32 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_mac_address.rb +27 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_numeric.rb +75 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/is_string.rb +26 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/join.rb +41 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/join_keys_to_values.rb +47 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/keys.rb +26 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb +20 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/lstrip.rb +33 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/max.rb +21 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/member.rb +44 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/merge.rb +34 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/min.rb +21 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/num2bool.rb +43 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/parsejson.rb +24 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/parseyaml.rb +24 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/pick.rb +29 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/pick_default.rb +35 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/prefix.rb +45 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/range.rb +88 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/reject.rb +31 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/reverse.rb +28 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/rstrip.rb +32 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/shuffle.rb +46 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/size.rb +48 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/sort.rb +27 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/squeeze.rb +36 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/str2bool.rb +46 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/str2saltedsha512.rb +32 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/strftime.rb +107 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/strip.rb +39 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/suffix.rb +45 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/swapcase.rb +39 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/time.rb +49 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/to_bytes.rb +28 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/type.rb +50 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/union.rb +34 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/unique.rb +51 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/upcase.rb +41 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/uriescape.rb +35 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_absolute_path.rb +56 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_array.rb +33 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_augeas.rb +81 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb +34 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_cmd.rb +48 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_hash.rb +33 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_ipv4_address.rb +48 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_ipv6_address.rb +49 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_re.rb +40 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb +71 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/validate_string.rb +33 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/values.rb +39 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/values_at.rb +98 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/parser/functions/zip.rb +65 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/provider/file_line/ruby.rb +83 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/type/anchor.rb +46 -0
- data/lib/templates/puppet/step-0/modules/stdlib/lib/puppet/type/file_line.rb +79 -0
- data/lib/templates/puppet/step-0/modules/stdlib/manifests/init.pp +20 -0
- data/lib/templates/puppet/step-0/modules/stdlib/manifests/stages.pp +43 -0
- data/lib/templates/puppet/step-0/modules/stdlib/metadata.json +111 -0
- data/lib/templates/puppet/step-0/modules/sudo/.fixtures.yml +5 -0
- data/lib/templates/puppet/step-0/modules/sudo/.gemfile +14 -0
- data/lib/templates/puppet/step-0/modules/sudo/.gemfile.lock +43 -0
- data/lib/templates/puppet/step-0/modules/sudo/.travis.yml +34 -0
- data/lib/templates/puppet/step-0/modules/sudo/LICENSE +13 -0
- data/lib/templates/puppet/step-0/modules/sudo/Modulefile +9 -0
- data/lib/templates/puppet/step-0/modules/sudo/README.md +171 -0
- data/lib/templates/puppet/step-0/modules/sudo/Rakefile +1 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.aix +90 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.archlinux +90 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.deb +90 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.freebsd +98 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.omnios +90 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.rhel5 +97 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.rhel6 +115 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.solaris +90 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.suse +81 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.ubuntu +30 -0
- data/lib/templates/puppet/step-0/modules/sudo/files/sudoers.wheezy +17 -0
- data/lib/templates/puppet/step-0/modules/sudo/lib/augeas/lenses/fixedsudoers.aug +520 -0
- data/lib/templates/puppet/step-0/modules/sudo/manifests/allow.pp +76 -0
- data/lib/templates/puppet/step-0/modules/sudo/manifests/conf.pp +105 -0
- data/lib/templates/puppet/step-0/modules/sudo/manifests/configs.pp +24 -0
- data/lib/templates/puppet/step-0/modules/sudo/manifests/init.pp +151 -0
- data/lib/templates/puppet/step-0/modules/sudo/manifests/package/aix.pp +46 -0
- data/lib/templates/puppet/step-0/modules/sudo/manifests/package/solaris.pp +60 -0
- data/lib/templates/puppet/step-0/modules/sudo/manifests/package.pp +61 -0
- data/lib/templates/puppet/step-0/modules/sudo/manifests/params.pp +127 -0
- data/lib/templates/puppet/step-0/modules/sudo/metadata.json +59 -0
- data/lib/templates/puppet/step-0/modules/sudo/templates/users_groups.erb +9 -0
- data/lib/templates/puppet/step-0/modules/users/manifests/init.pp +15 -0
- data/lib/templates/puppet/step-0/modules/users/manifests/user.pp +50 -0
- data/lib/templates/puppet/step-1/Puppetfile.erb +5 -0
- data/lib/templates/puppet/step-1/hiera/data/common.yaml.erb +11 -0
- data/lib/templates/puppet/step-1/hiera/data/environment.yaml.erb +11 -0
- data/lib/templates/puppet/step-1/hiera/data/node.yaml.erb +11 -0
- data/lib/templates/puppet/step-1/hiera/hiera.yaml.erb +11 -0
- data/lib/templates/puppet/step-1/manifests/node.erb +5 -0
- data/lib/templates/puppet/step-1/manifests/site.pp.erb +15 -0
- data/lib/templates/puppet/step-1/modules/users/manifests/init.pp +15 -0
- data/lib/templates/puppet/step-1/modules/users/manifests/user.pp +49 -0
- data/lib/templates/puppet/step-2/Puppetfile.erb +5 -0
- data/lib/templates/puppet/step-2/hiera/data/common.yaml.erb +1 -0
- data/lib/templates/puppet/step-2/hiera/data/environment.yaml.erb +1 -0
- data/lib/templates/puppet/step-2/hiera/data/node.yaml.erb +1 -0
- data/lib/templates/puppet/step-2/hiera/hiera.yaml.erb +11 -0
- data/lib/templates/puppet/step-2/manifests/node.erb +3 -0
- data/lib/templates/puppet/step-2/manifests/site.pp.erb +10 -0
- data/lib/templates/puppet/step-3/Puppetfile.erb +5 -0
- data/lib/templates/puppet/step-3/hiera/data/common.yaml.erb +99 -0
- data/lib/templates/puppet/step-3/hiera/data/environment.yaml.erb +99 -0
- data/lib/templates/puppet/step-3/hiera/data/node.yaml.erb +99 -0
- data/lib/templates/puppet/step-3/hiera/hiera.yaml.erb +11 -0
- data/lib/templates/puppet/step-3/manifests/node.erb +5 -0
- data/lib/templates/puppet/step-3/manifests/site.pp.erb +15 -0
- data/spec/environment_spec.rb +82 -0
- data/spec/factories/environment.rb +20 -0
- data/spec/factories/node.rb +22 -0
- data/spec/factories/profile.rb +10 -0
- data/spec/factories/project.rb +17 -0
- data/spec/factories/provision.rb +13 -0
- data/spec/factories/role.rb +9 -0
- data/spec/fixtures/Capfile.test +2 -0
- data/spec/fixtures/Gemfile.test +5 -0
- data/spec/fixtures/config/deploy/environment.test +35 -0
- data/spec/fixtures/config/deploy/production.test +35 -0
- data/spec/fixtures/config/deploy/staging.test +35 -0
- data/spec/fixtures/config/deploy/vagrant.test +37 -0
- data/spec/fixtures/config/deploy.test +120 -0
- data/spec/fixtures/dot_bebox.test.erb +4 -0
- data/spec/fixtures/dot_gitignore.test +8 -0
- data/spec/fixtures/node/Vagrantfile.test.erb +18 -0
- data/spec/fixtures/node/node_0.test.erb +3 -0
- data/spec/fixtures/node/prepared_node_0.test.erb +4 -0
- data/spec/fixtures/node/provisioned_node_0.test.erb +4 -0
- data/spec/fixtures/node/vagrant_deploy.test +38 -0
- data/spec/fixtures/puppet/hiera/data/node0.server1.test.yaml.test +4 -0
- data/spec/fixtures/puppet/profiles/test/profile_0/Puppetfile.test +24 -0
- data/spec/fixtures/puppet/profiles/test/profile_0/Puppetfile_with_modules.test +20 -0
- data/spec/fixtures/puppet/profiles/test/profile_0/manifests/init.pp.test +17 -0
- data/spec/fixtures/puppet/profiles/test/profile_0/manifests/init_with_content.pp.test +22 -0
- data/spec/fixtures/puppet/roles/manifests/init.pp.test +14 -0
- data/spec/fixtures/puppet/steps/step-0/hiera/data/common.yaml.test +26 -0
- data/spec/fixtures/puppet/steps/step-0/hiera/data/node0.server1.test.yaml.test +0 -0
- data/spec/fixtures/puppet/steps/step-0/hiera/data/pname_env.yaml.test +26 -0
- data/spec/fixtures/puppet/steps/step-0/hiera/data/production.yaml.test +0 -0
- data/spec/fixtures/puppet/steps/step-0/hiera/data/staging.yaml.test +0 -0
- data/spec/fixtures/puppet/steps/step-0/hiera/data/vagrant.yaml.test +0 -0
- data/spec/fixtures/puppet/steps/step-0/hiera/hiera.yaml.test +11 -0
- data/spec/fixtures/puppet/steps/step-0/manifests/site.pp.test +10 -0
- data/spec/fixtures/puppet/steps/step-0/manifests/site_with_node.pp.test +15 -0
- data/spec/fixtures/puppet/steps/step-1/hiera/data/common.yaml.test +11 -0
- data/spec/fixtures/puppet/steps/step-1/hiera/data/node0.server1.test.yaml.test +0 -0
- data/spec/fixtures/puppet/steps/step-1/hiera/data/pname_env.yaml.test +11 -0
- data/spec/fixtures/puppet/steps/step-1/hiera/data/production.yaml.test +0 -0
- data/spec/fixtures/puppet/steps/step-1/hiera/data/staging.yaml.test +0 -0
- data/spec/fixtures/puppet/steps/step-1/hiera/data/vagrant.yaml.test +0 -0
- data/spec/fixtures/puppet/steps/step-1/hiera/hiera.yaml.test +11 -0
- data/spec/fixtures/puppet/steps/step-1/manifests/site.pp.test +10 -0
- data/spec/fixtures/puppet/steps/step-1/manifests/site_with_node.pp.test +15 -0
- data/spec/fixtures/puppet/steps/step-2/Puppetfile.test +6 -0
- data/spec/fixtures/puppet/steps/step-2/hiera/data/common.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-2/hiera/data/node0.server1.test.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-2/hiera/data/pname_env.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-2/hiera/data/production.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-2/hiera/data/staging.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-2/hiera/data/vagrant.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-2/hiera/hiera.yaml.test +11 -0
- data/spec/fixtures/puppet/steps/step-2/manifests/site.pp.test +10 -0
- data/spec/fixtures/puppet/steps/step-2/manifests/site_with_node.pp.test +13 -0
- data/spec/fixtures/puppet/steps/step-2/manifests/site_with_node_role_association.pp.test +16 -0
- data/spec/fixtures/puppet/steps/step-2/modules/profiles/manifests/test/profile_0.pp.test +17 -0
- data/spec/fixtures/puppet/steps/step-2/modules/roles/manifests/role_0.pp.test +16 -0
- data/spec/fixtures/puppet/steps/step-3/hiera/data/common.yaml.test +99 -0
- data/spec/fixtures/puppet/steps/step-3/hiera/data/node0.server1.test.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-3/hiera/data/pname_env.yaml.test +99 -0
- data/spec/fixtures/puppet/steps/step-3/hiera/data/production.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-3/hiera/data/staging.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-3/hiera/data/vagrant.yaml.test +1 -0
- data/spec/fixtures/puppet/steps/step-3/hiera/hiera.yaml.test +11 -0
- data/spec/fixtures/puppet/steps/step-3/manifests/site.pp.test +10 -0
- data/spec/fixtures/puppet/steps/step-3/manifests/site_with_node.pp.test +15 -0
- data/spec/fixtures/puppet/ubuntu_dependencies.test +10 -0
- data/spec/node0.server1.test/prepare_phase_spec.rb +53 -0
- data/spec/node0.server1.test/provision_step_0_spec.rb +46 -0
- data/spec/node0.server1.test/provision_step_1_spec.rb +41 -0
- data/spec/node0.server1.test/provision_step_2_spec.rb +79 -0
- data/spec/node0.server1.test/provision_step_3_spec.rb +76 -0
- data/spec/node_role_spec.rb +20 -0
- data/spec/node_spec.rb +71 -0
- data/spec/node_wizard_spec.rb +22 -0
- data/spec/ordered_phases_spec.rb +55 -0
- data/spec/pre_prepare_spec.rb +78 -0
- data/spec/pre_provision_steps_spec.rb +40 -0
- data/spec/profile_spec.rb +70 -0
- data/spec/project_spec.rb +195 -0
- data/spec/project_wizard_spec.rb +51 -0
- data/spec/puppet_spec_helper.rb +15 -0
- data/spec/role_profiles_spec.rb +40 -0
- data/spec/role_spec.rb +56 -0
- data/spec/spec_helper.rb +37 -0
- data/spec/support/config_specs.yaml.example +2 -0
- data/spec/vagrant_spec_helper.rb +15 -0
- metadata +625 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Puppet::Type.type(:file_line).provide(:ruby) do
|
|
2
|
+
def exists?
|
|
3
|
+
lines.find do |line|
|
|
4
|
+
line.chomp == resource[:line].chomp
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def create
|
|
9
|
+
if resource[:match]
|
|
10
|
+
handle_create_with_match
|
|
11
|
+
elsif resource[:after]
|
|
12
|
+
handle_create_with_after
|
|
13
|
+
else
|
|
14
|
+
append_line
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def destroy
|
|
19
|
+
local_lines = lines
|
|
20
|
+
File.open(resource[:path],'w') do |fh|
|
|
21
|
+
fh.write(local_lines.reject{|l| l.chomp == resource[:line] }.join(''))
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
def lines
|
|
27
|
+
# If this type is ever used with very large files, we should
|
|
28
|
+
# write this in a different way, using a temp
|
|
29
|
+
# file; for now assuming that this type is only used on
|
|
30
|
+
# small-ish config files that can fit into memory without
|
|
31
|
+
# too much trouble.
|
|
32
|
+
@lines ||= File.readlines(resource[:path])
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def handle_create_with_match()
|
|
36
|
+
regex = resource[:match] ? Regexp.new(resource[:match]) : nil
|
|
37
|
+
match_count = lines.select { |l| regex.match(l) }.size
|
|
38
|
+
if match_count > 1 && resource[:multiple].to_s != 'true'
|
|
39
|
+
raise Puppet::Error, "More than one line in file '#{resource[:path]}' matches pattern '#{resource[:match]}'"
|
|
40
|
+
end
|
|
41
|
+
File.open(resource[:path], 'w') do |fh|
|
|
42
|
+
lines.each do |l|
|
|
43
|
+
fh.puts(regex.match(l) ? resource[:line] : l)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
if (match_count == 0)
|
|
47
|
+
fh.puts(resource[:line])
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def handle_create_with_after
|
|
53
|
+
regex = Regexp.new(resource[:after])
|
|
54
|
+
|
|
55
|
+
count = lines.count {|l| l.match(regex)}
|
|
56
|
+
|
|
57
|
+
case count
|
|
58
|
+
when 1 # find the line to put our line after
|
|
59
|
+
File.open(resource[:path], 'w') do |fh|
|
|
60
|
+
lines.each do |l|
|
|
61
|
+
fh.puts(l)
|
|
62
|
+
if regex.match(l) then
|
|
63
|
+
fh.puts(resource[:line])
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
when 0 # append the line to the end of the file
|
|
68
|
+
append_line
|
|
69
|
+
else
|
|
70
|
+
raise Puppet::Error, "#{count} lines match pattern '#{resource[:after]}' in file '#{resource[:path]}'. One or no line must match the pattern."
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
##
|
|
75
|
+
# append the line to the file.
|
|
76
|
+
#
|
|
77
|
+
# @api private
|
|
78
|
+
def append_line
|
|
79
|
+
File.open(resource[:path], 'a') do |fh|
|
|
80
|
+
fh.puts resource[:line]
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Puppet::Type.newtype(:anchor) do
|
|
2
|
+
desc <<-'ENDOFDESC'
|
|
3
|
+
A simple resource type intended to be used as an anchor in a composite class.
|
|
4
|
+
|
|
5
|
+
In Puppet 2.6, when a class declares another class, the resources in the
|
|
6
|
+
interior class are not contained by the exterior class. This interacts badly
|
|
7
|
+
with the pattern of composing complex modules from smaller classes, as it
|
|
8
|
+
makes it impossible for end users to specify order relationships between the
|
|
9
|
+
exterior class and other modules.
|
|
10
|
+
|
|
11
|
+
The anchor type lets you work around this. By sandwiching any interior
|
|
12
|
+
classes between two no-op resources that _are_ contained by the exterior
|
|
13
|
+
class, you can ensure that all resources in the module are contained.
|
|
14
|
+
|
|
15
|
+
class ntp {
|
|
16
|
+
# These classes will have the correct order relationship with each
|
|
17
|
+
# other. However, without anchors, they won't have any order
|
|
18
|
+
# relationship to Class['ntp'].
|
|
19
|
+
class { 'ntp::package': }
|
|
20
|
+
-> class { 'ntp::config': }
|
|
21
|
+
-> class { 'ntp::service': }
|
|
22
|
+
|
|
23
|
+
# These two resources "anchor" the composed classes within the ntp
|
|
24
|
+
# class.
|
|
25
|
+
anchor { 'ntp::begin': } -> Class['ntp::package']
|
|
26
|
+
Class['ntp::service'] -> anchor { 'ntp::end': }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
This allows the end user of the ntp module to establish require and before
|
|
30
|
+
relationships with Class['ntp']:
|
|
31
|
+
|
|
32
|
+
class { 'ntp': } -> class { 'mcollective': }
|
|
33
|
+
class { 'mcollective': } -> class { 'ntp': }
|
|
34
|
+
|
|
35
|
+
ENDOFDESC
|
|
36
|
+
|
|
37
|
+
newparam :name do
|
|
38
|
+
desc "The name of the anchor resource."
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def refresh
|
|
42
|
+
# We don't do anything with them, but we need this to
|
|
43
|
+
# show that we are "refresh aware" and not break the
|
|
44
|
+
# chain of propagation.
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Puppet::Type.newtype(:file_line) do
|
|
2
|
+
|
|
3
|
+
desc <<-EOT
|
|
4
|
+
Ensures that a given line is contained within a file. The implementation
|
|
5
|
+
matches the full line, including whitespace at the beginning and end. If
|
|
6
|
+
the line is not contained in the given file, Puppet will add the line to
|
|
7
|
+
ensure the desired state. Multiple resources may be declared to manage
|
|
8
|
+
multiple lines in the same file.
|
|
9
|
+
|
|
10
|
+
Example:
|
|
11
|
+
|
|
12
|
+
file_line { 'sudo_rule':
|
|
13
|
+
path => '/etc/sudoers',
|
|
14
|
+
line => '%sudo ALL=(ALL) ALL',
|
|
15
|
+
}
|
|
16
|
+
file_line { 'sudo_rule_nopw':
|
|
17
|
+
path => '/etc/sudoers',
|
|
18
|
+
line => '%sudonopw ALL=(ALL) NOPASSWD: ALL',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
In this example, Puppet will ensure both of the specified lines are
|
|
22
|
+
contained in the file /etc/sudoers.
|
|
23
|
+
|
|
24
|
+
EOT
|
|
25
|
+
|
|
26
|
+
ensurable do
|
|
27
|
+
defaultvalues
|
|
28
|
+
defaultto :present
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
newparam(:name, :namevar => true) do
|
|
32
|
+
desc 'An arbitrary name used as the identity of the resource.'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
newparam(:match) do
|
|
36
|
+
desc 'An optional regular expression to run against existing lines in the file;\n' +
|
|
37
|
+
'if a match is found, we replace that line rather than adding a new line.'
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
newparam(:multiple) do
|
|
41
|
+
desc 'An optional value to determine if match can change multiple lines.'
|
|
42
|
+
newvalues(true, false)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
newparam(:after) do
|
|
46
|
+
desc 'An optional value used to specify the line after which we will add any new lines. (Existing lines are added in place)'
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
newparam(:line) do
|
|
50
|
+
desc 'The line to be appended to the file located by the path parameter.'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
newparam(:path) do
|
|
54
|
+
desc 'The file Puppet will ensure contains the line specified by the line parameter.'
|
|
55
|
+
validate do |value|
|
|
56
|
+
unless (Puppet.features.posix? and value =~ /^\//) or (Puppet.features.microsoft_windows? and (value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/))
|
|
57
|
+
raise(Puppet::Error, "File paths must be fully qualified, not '#{value}'")
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Autorequire the file resource if it's being managed
|
|
63
|
+
autorequire(:file) do
|
|
64
|
+
self[:path]
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
validate do
|
|
68
|
+
unless self[:line] and self[:path]
|
|
69
|
+
raise(Puppet::Error, "Both line and path are required attributes")
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if (self[:match])
|
|
73
|
+
unless Regexp.new(self[:match]).match(self[:line])
|
|
74
|
+
raise(Puppet::Error, "When providing a 'match' parameter, the value must be a regex that matches against the value of your 'line' parameter")
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Class: stdlib
|
|
2
|
+
#
|
|
3
|
+
# This module manages stdlib. Most of stdlib's features are automatically
|
|
4
|
+
# loaded by Puppet, but this class should be declared in order to use the
|
|
5
|
+
# standardized run stages.
|
|
6
|
+
#
|
|
7
|
+
# Parameters: none
|
|
8
|
+
#
|
|
9
|
+
# Actions:
|
|
10
|
+
#
|
|
11
|
+
# Declares all other classes in the stdlib module. Currently, this consists
|
|
12
|
+
# of stdlib::stages.
|
|
13
|
+
#
|
|
14
|
+
# Requires: nothing
|
|
15
|
+
#
|
|
16
|
+
class stdlib {
|
|
17
|
+
|
|
18
|
+
class { 'stdlib::stages': }
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Class: stdlib::stages
|
|
2
|
+
#
|
|
3
|
+
# This class manages a standard set of run stages for Puppet. It is managed by
|
|
4
|
+
# the stdlib class, and should not be declared independently.
|
|
5
|
+
#
|
|
6
|
+
# The high level stages are (in order):
|
|
7
|
+
#
|
|
8
|
+
# * setup
|
|
9
|
+
# * main
|
|
10
|
+
# * runtime
|
|
11
|
+
# * setup_infra
|
|
12
|
+
# * deploy_infra
|
|
13
|
+
# * setup_app
|
|
14
|
+
# * deploy_app
|
|
15
|
+
# * deploy
|
|
16
|
+
#
|
|
17
|
+
# Parameters: none
|
|
18
|
+
#
|
|
19
|
+
# Actions:
|
|
20
|
+
#
|
|
21
|
+
# Declares various run-stages for deploying infrastructure,
|
|
22
|
+
# language runtimes, and application layers.
|
|
23
|
+
#
|
|
24
|
+
# Requires: nothing
|
|
25
|
+
#
|
|
26
|
+
# Sample Usage:
|
|
27
|
+
#
|
|
28
|
+
# node default {
|
|
29
|
+
# include stdlib
|
|
30
|
+
# class { java: stage => 'runtime' }
|
|
31
|
+
# }
|
|
32
|
+
#
|
|
33
|
+
class stdlib::stages {
|
|
34
|
+
|
|
35
|
+
stage { 'setup': before => Stage['main'] }
|
|
36
|
+
stage { 'runtime': require => Stage['main'] }
|
|
37
|
+
-> stage { 'setup_infra': }
|
|
38
|
+
-> stage { 'deploy_infra': }
|
|
39
|
+
-> stage { 'setup_app': }
|
|
40
|
+
-> stage { 'deploy_app': }
|
|
41
|
+
-> stage { 'deploy': }
|
|
42
|
+
|
|
43
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "puppetlabs-stdlib",
|
|
3
|
+
"version": "4.2.2",
|
|
4
|
+
"author": "puppetlabs",
|
|
5
|
+
"summary": "Puppet Module Standard Library",
|
|
6
|
+
"license": "Apache 2.0",
|
|
7
|
+
"source": "git://github.com/puppetlabs/puppetlabs-stdlib.git",
|
|
8
|
+
"project_page": "https://github.com/puppetlabs/puppetlabs-stdlib",
|
|
9
|
+
"issues_url": "https://github.com/puppetlabs/puppetlabs-stdlib/issues",
|
|
10
|
+
"operatingsystem_support": [
|
|
11
|
+
{
|
|
12
|
+
"operatingsystem": "RedHat",
|
|
13
|
+
"operatingsystemrelease": [
|
|
14
|
+
"4",
|
|
15
|
+
"5",
|
|
16
|
+
"6",
|
|
17
|
+
"7"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"operatingsystem": "CentOS",
|
|
22
|
+
"operatingsystemrelease": [
|
|
23
|
+
"4",
|
|
24
|
+
"5",
|
|
25
|
+
"6",
|
|
26
|
+
"7"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"operatingsystem": "OracleLinux",
|
|
31
|
+
"operatingsystemrelease": [
|
|
32
|
+
"4",
|
|
33
|
+
"5",
|
|
34
|
+
"6",
|
|
35
|
+
"7"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"operatingsystem": "Scientific",
|
|
40
|
+
"operatingsystemrelease": [
|
|
41
|
+
"4",
|
|
42
|
+
"5",
|
|
43
|
+
"6",
|
|
44
|
+
"7"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"operatingsystem": "SLES",
|
|
49
|
+
"operatingsystemrelease": [
|
|
50
|
+
"11 SP1"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"operatingsystem": "Debian",
|
|
55
|
+
"operatingsystemrelease": [
|
|
56
|
+
"6",
|
|
57
|
+
"7"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"operatingsystem": "Ubuntu",
|
|
62
|
+
"operatingsystemrelease": [
|
|
63
|
+
"10.04",
|
|
64
|
+
"12.04",
|
|
65
|
+
"14.04"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"operatingsystem": "Solaris",
|
|
70
|
+
"operatingsystemrelease": [
|
|
71
|
+
"10",
|
|
72
|
+
"11"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"operatingsystem": "Windows",
|
|
77
|
+
"operatingsystemrelease": [
|
|
78
|
+
"Server 2003",
|
|
79
|
+
"Server 2003 R2",
|
|
80
|
+
"Server 2008",
|
|
81
|
+
"Server 2008 R2",
|
|
82
|
+
"Server 2012",
|
|
83
|
+
"Server 2012 R2",
|
|
84
|
+
"7",
|
|
85
|
+
"8"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"operatingsystem": "AIX",
|
|
90
|
+
"operatingsystemrelease": [
|
|
91
|
+
"5.3",
|
|
92
|
+
"6.1",
|
|
93
|
+
"7.1"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"requirements": [
|
|
98
|
+
{
|
|
99
|
+
"name": "pe",
|
|
100
|
+
"version_requirement": ">= 3.2.0 < 3.4.0"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "puppet",
|
|
104
|
+
"version_requirement": ">=2.7.20 <4.0.0"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"description": "Standard Library for Puppet Modules",
|
|
108
|
+
"dependencies": [
|
|
109
|
+
|
|
110
|
+
]
|
|
111
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
group :development, :test do
|
|
4
|
+
gem 'rake', :require => false
|
|
5
|
+
gem 'puppet-lint', :require => false
|
|
6
|
+
gem 'rspec-puppet', :require => false
|
|
7
|
+
gem 'puppetlabs_spec_helper', :require => false
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
|
11
|
+
gem 'puppet', puppetversion, :require => false
|
|
12
|
+
else
|
|
13
|
+
gem 'puppet', :require => false
|
|
14
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
diff-lcs (1.2.5)
|
|
5
|
+
facter (1.7.5)
|
|
6
|
+
hiera (1.3.2)
|
|
7
|
+
json_pure
|
|
8
|
+
json_pure (1.8.1)
|
|
9
|
+
metaclass (0.0.4)
|
|
10
|
+
mocha (1.0.0)
|
|
11
|
+
metaclass (~> 0.0.1)
|
|
12
|
+
puppet (3.2.4)
|
|
13
|
+
facter (~> 1.6)
|
|
14
|
+
hiera (~> 1.0)
|
|
15
|
+
rgen (~> 0.6.5)
|
|
16
|
+
puppet-lint (0.3.2)
|
|
17
|
+
puppetlabs_spec_helper (0.4.1)
|
|
18
|
+
mocha (>= 0.10.5)
|
|
19
|
+
rake
|
|
20
|
+
rspec (>= 2.9.0)
|
|
21
|
+
rspec-puppet (>= 0.1.1)
|
|
22
|
+
rake (10.3.1)
|
|
23
|
+
rgen (0.6.6)
|
|
24
|
+
rspec (2.14.1)
|
|
25
|
+
rspec-core (~> 2.14.0)
|
|
26
|
+
rspec-expectations (~> 2.14.0)
|
|
27
|
+
rspec-mocks (~> 2.14.0)
|
|
28
|
+
rspec-core (2.14.8)
|
|
29
|
+
rspec-expectations (2.14.5)
|
|
30
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
|
31
|
+
rspec-mocks (2.14.6)
|
|
32
|
+
rspec-puppet (1.0.1)
|
|
33
|
+
rspec
|
|
34
|
+
|
|
35
|
+
PLATFORMS
|
|
36
|
+
ruby
|
|
37
|
+
|
|
38
|
+
DEPENDENCIES
|
|
39
|
+
puppet (~> 3.2.0)
|
|
40
|
+
puppet-lint
|
|
41
|
+
puppetlabs_spec_helper
|
|
42
|
+
rake
|
|
43
|
+
rspec-puppet
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
branches:
|
|
3
|
+
only:
|
|
4
|
+
- master
|
|
5
|
+
language: ruby
|
|
6
|
+
bundler_args: --without development
|
|
7
|
+
script: bundle exec rake spec SPEC_OPTS='--format documentation'
|
|
8
|
+
after_success:
|
|
9
|
+
- git clone -q git://github.com/puppetlabs/ghpublisher.git .forge-releng
|
|
10
|
+
- .forge-releng/publish
|
|
11
|
+
rvm:
|
|
12
|
+
- 1.8.7
|
|
13
|
+
- 1.9.3
|
|
14
|
+
env:
|
|
15
|
+
matrix:
|
|
16
|
+
- PUPPET_GEM_VERSION="~> 2.7.0"
|
|
17
|
+
- PUPPET_GEM_VERSION="~> 3.1.0"
|
|
18
|
+
- PUPPET_GEM_VERSION="~> 3.2.0"
|
|
19
|
+
- PUPPET_GEM_VERSION="~> 3.3.0"
|
|
20
|
+
global:
|
|
21
|
+
- PUBLISHER_LOGIN=saz
|
|
22
|
+
- secure: |-
|
|
23
|
+
Uo1E9umjUYnHYnI9rEanW1/HwQlMmAWiFQ22Dq4BpkMFZ8Fw/Qr3bB9QLGAFpWS0jNXOeMbU
|
|
24
|
+
dCdMDyzum547q8+ouAoOfm6cbJWU1UpnM/Z9ARFvPMreLhT4lhzYFv4lh3r3MiaeT0WF0Cc3
|
|
25
|
+
7eo8FsveTDufilOUZM2SQmnXi7w=
|
|
26
|
+
matrix:
|
|
27
|
+
include:
|
|
28
|
+
- rvm: 2.0.0
|
|
29
|
+
env: PUPPET_GEM_VERSION="~> 3.2.0"
|
|
30
|
+
- rvm: 2.0.0
|
|
31
|
+
env: PUPPET_GEM_VERSION="~> 3.3.0"
|
|
32
|
+
notifications:
|
|
33
|
+
email: false
|
|
34
|
+
gemfile: .gemfile
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2012 Steffen Zieger
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
name 'saz-sudo'
|
|
2
|
+
version '3.0.6'
|
|
3
|
+
source 'UNKNOWN'
|
|
4
|
+
author 'saz'
|
|
5
|
+
license 'Apache License, Version 2.0'
|
|
6
|
+
summary 'UNKNOWN'
|
|
7
|
+
description 'Manage sudo configuration via Puppet'
|
|
8
|
+
dependency 'puppetlabs/stdlib', '>= 2.3.0'
|
|
9
|
+
project_page 'https://github.com/saz/puppet-sudo'
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# puppet-sudo [](http://travis-ci.org/saz/puppet-sudo)
|
|
2
|
+
|
|
3
|
+
Manage sudo configuration via Puppet
|
|
4
|
+
|
|
5
|
+
### Gittip
|
|
6
|
+
[](https://www.gittip.com/saz/)
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
### WARNING
|
|
11
|
+
**This module will purge your current sudo config**
|
|
12
|
+
|
|
13
|
+
If this is not what you're expecting, set `purge` and/or `config_file_replace` to **false**
|
|
14
|
+
|
|
15
|
+
### Install sudo with default sudoers
|
|
16
|
+
|
|
17
|
+
#### Purge current sudo config
|
|
18
|
+
```puppet
|
|
19
|
+
class { 'sudo': }
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
#### Purge sudoers.d directory, but leave sudoers file as it is
|
|
23
|
+
```puppet
|
|
24
|
+
class { 'sudo':
|
|
25
|
+
config_file_replace => true,
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
#### Leave current sudo config as it is
|
|
30
|
+
```puppet
|
|
31
|
+
class { 'sudo':
|
|
32
|
+
purge => false,
|
|
33
|
+
config_file_replace => false,
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Adding sudoers configuration
|
|
38
|
+
|
|
39
|
+
#### Using Code
|
|
40
|
+
|
|
41
|
+
```puppet
|
|
42
|
+
class { 'sudo': }
|
|
43
|
+
sudo::conf { 'web':
|
|
44
|
+
source => 'puppet:///files/etc/sudoers.d/web',
|
|
45
|
+
}
|
|
46
|
+
sudo::conf { 'admins':
|
|
47
|
+
priority => 10,
|
|
48
|
+
content => "%admins ALL=(ALL) NOPASSWD: ALL",
|
|
49
|
+
}
|
|
50
|
+
sudo::conf { 'joe':
|
|
51
|
+
priority => 60,
|
|
52
|
+
source => 'puppet:///files/etc/sudoers.d/users/joe',
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### Using Hiera
|
|
57
|
+
|
|
58
|
+
A hiera hash may be used to assemble the sudoers configuration.
|
|
59
|
+
Hash merging is also enabled, which supports layering the configuration settings.
|
|
60
|
+
|
|
61
|
+
Examples using:
|
|
62
|
+
- YAML backend
|
|
63
|
+
- an environment called __production__
|
|
64
|
+
- a __/etc/puppet/hiera.yaml__ hierarchy configuration:
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
:hierarchy:
|
|
68
|
+
- "%{environment}"
|
|
69
|
+
- "defaults"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
##### Load module
|
|
73
|
+
|
|
74
|
+
###### Using Puppet version 3+
|
|
75
|
+
|
|
76
|
+
Load the module via Puppet Code or your ENC.
|
|
77
|
+
|
|
78
|
+
```puppet
|
|
79
|
+
include sudo
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
###### Using Puppet version 2.7+
|
|
83
|
+
|
|
84
|
+
After [Installing Hiera](http://docs.puppetlabs.com/hiera/1/installing.html):
|
|
85
|
+
|
|
86
|
+
- Load the `sudo` and `sudo::configs` modules via Puppet Code or your ENC.
|
|
87
|
+
|
|
88
|
+
```puppet
|
|
89
|
+
include sudo
|
|
90
|
+
include sudo::configs
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
##### Configure Hiera YAML __(defaults.yaml)__
|
|
94
|
+
|
|
95
|
+
These defaults will apply to all systems.
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
sudo::configs:
|
|
99
|
+
'web':
|
|
100
|
+
'source' : 'puppet:///files/etc/sudoers.d/web'
|
|
101
|
+
'admins':
|
|
102
|
+
'content' : "%admins ALL=(ALL) NOPASSWD: ALL"
|
|
103
|
+
'priority' : 10
|
|
104
|
+
'joe':
|
|
105
|
+
'priority' : 60
|
|
106
|
+
'source' : 'puppet:///files/etc/sudoers.d/users/joe'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
##### Configure Hiera YAML __(production.yaml)__
|
|
110
|
+
|
|
111
|
+
This will only apply to the production environment.
|
|
112
|
+
In this example we are:
|
|
113
|
+
- inheriting/preserving the __web__ configuration
|
|
114
|
+
- overriding the __admins__ configuration
|
|
115
|
+
- removing the __joe__ configuration
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
sudo::configs:
|
|
119
|
+
'admins':
|
|
120
|
+
'content' : "%prodadmins ALL=(ALL) NOPASSWD: ALL"
|
|
121
|
+
'priority' : 10
|
|
122
|
+
'joe':
|
|
123
|
+
'ensure' : 'absent'
|
|
124
|
+
'source' : 'puppet:///files/etc/sudoers.d/users/joe'
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
If you have Hiera version >= 1.2.0 and enable [Hiera Deeper Merging](http://docs.puppetlabs.com/hiera/1/lookup_types.html#deep-merging-in-hiera--120) you may conditionally override any setting.
|
|
128
|
+
|
|
129
|
+
In this example we are:
|
|
130
|
+
- inheriting/preserving the __web__ configuration
|
|
131
|
+
- overriding the __admins:content__ setting
|
|
132
|
+
- inheriting/preserving the __admins:priority__ setting
|
|
133
|
+
- inheriting/preserving the __joe:source__ and __joe:priority__ settings
|
|
134
|
+
- removing the __joe__ configuration
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
sudo::configs:
|
|
138
|
+
'admins':
|
|
139
|
+
'content' : "%prodadmins ALL=(ALL) NOPASSWD: ALL"
|
|
140
|
+
'joe':
|
|
141
|
+
'ensure' : 'absent'
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### sudo::conf / sudo::configs notes
|
|
145
|
+
* You can pass template() through content parameter.
|
|
146
|
+
* One of content or source must be set.
|
|
147
|
+
|
|
148
|
+
## sudo class parameters
|
|
149
|
+
|
|
150
|
+
| Parameter | Type | Default | Description |
|
|
151
|
+
| :-------------- | :------ |:----------- | :---------- |
|
|
152
|
+
| enable | boolean | true | Set this to remove or purge all sudoers configs |
|
|
153
|
+
| package | string | OS specific | Set package name _(for unsupported platforms)_ |
|
|
154
|
+
| package_ensure | string | present | latest, absent, or a specific package version |
|
|
155
|
+
| package_source | string | OS specific | Set package source _(for unsupported platforms)_ |
|
|
156
|
+
| purge | boolean | true | Purge unmanaged files from config_dir |
|
|
157
|
+
| config_file | string | OS specific | Set config_file _(for unsupported platforms)_ |
|
|
158
|
+
| config_file_replace | boolean | true | Replace config file with module config file |
|
|
159
|
+
| config_dir | string | OS specific | Set config_dir _(for unsupported platforms)_ |
|
|
160
|
+
| source | string | OS specific | Set source _(for unsupported platforms)_ |
|
|
161
|
+
|
|
162
|
+
## sudo::conf class / sudo::configs hash parameters
|
|
163
|
+
|
|
164
|
+
| Parameter | Type | Default | Description |
|
|
165
|
+
| :-------------- | :----- |:----------- | :---------- |
|
|
166
|
+
| ensure | string | present | present or absent |
|
|
167
|
+
| priority | number | 10 | file name prefix |
|
|
168
|
+
| content | string | undef | content of configuration snippet |
|
|
169
|
+
| source | string | undef | source of configuration snippet |
|
|
170
|
+
| sudo_config_dir | string | OS Specific | configuration snippet directory _(for unsupported platforms)_ |
|
|
171
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'puppetlabs_spec_helper/rake_tasks'
|