This Gem extends the Beaker DSL for the purpose of changing things on a Puppet Master.
Add this line to your application's Gemfile:
gem 'master_manipulator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install master_manipulator
Disable the node classifier on a Puppet Enterprise master and use the "site.pp" manifest instead for node classification.
disable_node_classifier(master)
Disable environment caching on a Puppet Enterprise master to allow for dynamic updates to environments without waiting for cache purge.
disable_env_cache(master)
Restart the Puppet Server service to pickup configuration changes made to the "puppet.conf" file.
Restart the Puppet Server service on Puppet Enterprise:
restart_puppet_server(master)
Retrieve the path to the manifests folder for an environment on a master.
Retrieve the path to the manifests folder for the "production" environment.
prod_env_manifests_path = get_manifests_path(master)
Retrieve the path to the manifests folder for the "staging" environment.
stage_env_manifests_path = get_manifests_path(master, :env => 'staging')
Retrieve the path to the "site.pp" manifest for an environment on a master.
Retrieve the path to the "site.pp" manifest for the "production" environment.
prod_env_site_pp_path = get_site_pp_path(master)
Retrieve the path to the "site.pp" manifest for the "production" environment.
stage_env_site_pp_path = get_site_pp_path(master, :env => 'staging')
Create a "site.pp" file with file bucket enabled. Also, allow the creation of a custom node definition or use the 'default' node definition.
Create a "site.pp" manifest with the default node definition using a simple manifest.
site_pp = create_site_pp(master, :manifest => 'notify { hello: }')
Create a "site.pp" manifest with a custom node definition using a simple manifest.
site_pp = create_site_pp(master, :node_def_name => 'puppet_agent', :manifest => 'notify { hello: }')
Set permissions and ownership on a remote file.
Set permissions on the "site.pp" manifest with default ownership of Pupppet user and group.
set_perms_on_remote(master, get_site_pp_path(master), '644')
Set permissions on the "site.pp" manifest with root ownership.
set_perms_on_remote(master, get_site_pp_path(master), '644', :owner => 'root', :group => 'root')
Inject a "site.pp" manifest onto a master.
prod_env_site_pp_path = get_site_pp_path(master)
site_pp = create_site_pp(master, :manifest => 'notify { hello: }')
inject_site_pp(master, prod_env_site_pp_path, site_pp)