Class: Marionetta::Manipulators::Puppet
- Inherits:
-
Object
- Object
- Marionetta::Manipulators::Puppet
- Includes:
- Commandable
- Defined in:
- lib/marionetta/manipulators/puppet.rb
Class Method Summary collapse
-
.tasks ⇒ Object
‘PupperManipulator` provides two rake tasks when used with `RakeHelper` namely `:install` and `:update`.
Instance Method Summary collapse
-
#can? ⇒ Boolean
Call ‘.can?()` to check if the `:manifest` key has been set in the `server`.
-
#initialize(server) ⇒ Puppet
constructor
The key ‘[:puppet]` must be set in your `server` hash in order for `PuppetManipulator` to function correctly.
-
#install ⇒ Object
‘PuppetManipulator` provides the `.install()` method to install puppet on debian or ubuntu servers.
-
#update ⇒ Object
Use ‘.update()` to package up your manifest and optionally modules and send them to your remote machine.
Constructor Details
Class Method Details
.tasks ⇒ Object
‘PupperManipulator` provides two rake tasks when used with `RakeHelper` namely `:install` and `:update`. When applied through `RakeHelper` they will appear namespaced under `:puppet` and your group name.
With a group name of ‘:staging` would appear as:
puppet:staging:install
puppet:staging:update
30 31 32 |
# File 'lib/marionetta/manipulators/puppet.rb', line 30 def self.tasks() [:install, :update] end |
Instance Method Details
#can? ⇒ Boolean
Call ‘.can?()` to check if the `:manifest` key has been set in the `server`.
47 48 49 |
# File 'lib/marionetta/manipulators/puppet.rb', line 47 def can?() server[:puppet].has_key?(:manifest) end |
#install ⇒ Object
‘PuppetManipulator` provides the `.install()` method to install puppet on debian or ubuntu servers.
56 57 58 59 60 61 62 63 64 |
# File 'lib/marionetta/manipulators/puppet.rb', line 56 def install() p = server[:puppet] unless p.has_key?(:use_distro_repo) and p[:use_distro_repo] == true install_deb_repo end install_deb end |
#update ⇒ Object
Use ‘.update()` to package up your manifest and optionally modules and send them to your remote machine. Once there they will be applied.
If puppet is not installed, we attempt to install it before applying the manifest.
75 76 77 78 79 |
# File 'lib/marionetta/manipulators/puppet.rb', line 75 def update() install unless installed? send_puppet_files apply_puppet_files end |