Module: Capistrano::Puppeteer::Puppet

Defined in:
lib/capistrano/puppeteer/puppet.rb

Class Method Summary collapse

Class Method Details

.extended(configuration) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/capistrano/puppeteer/puppet.rb', line 5

def self.extended(configuration)
  configuration.load do
    unless exists? :puppet_path
      set(:puppet_path) { '/srv/puppet' } unless exists? :puppet_path
    end

    namespace :puppet do
      task :update do
        system 'git push'
        run "#{sudo} chgrp -R adm #{puppet_path}"
        run "#{sudo} chmod -R g+rw #{puppet_path}"
        run "cd #{puppet_path} && git pull --quiet"
      end

      desc "      Perform a puppet run.\n\n      Pass options to puppt using OPTIONS\n\n      puppet:go options=\"--noop\"\n      DESC\n      task :go do\n        update\n        options = ENV['options'] || ENV['OPTIONS'] || ''\n        run \"cd \#{puppet_path} && \#{sudo} puppet apply --config puppet.conf --verbose \#{options} manifests/site.pp\"\n      end\n    end\n  end\nend\n"