Sha256: 0636d2492d5ac0426dbb88f5051c6a8235d69f1ea537607249db5b8e132a5409

Contents?: true

Size: 1.2 KB

Versions: 63

Compression:

Stored size: 1.2 KB

Contents

require "log4r"

module VagrantPlugins
  module CFEngine
    module Cap
      module Linux
        module CFEngineNeedsBootstrap
          def self.cfengine_needs_bootstrap(machine, config)
            logger = Log4r::Logger.new("vagrant::plugins::cfengine::cap_linux_cfengine_bootstrap")

            machine.communicate.tap do |comm|
              # We hardcode fixing the permissions on /var/cfengine/ppkeys/, if it exists,
              # because otherwise CFEngine will fail to bootstrap.
              if comm.test("test -d /var/cfengine/ppkeys", sudo: true)
                logger.debug("Fixing permissions on /var/cfengine/ppkeys")
                comm.sudo("chmod -R 600 /var/cfengine/ppkeys")
              end

              logger.debug("Checking if CFEngine is bootstrapped...")
              bootstrapped = comm.test("test -f /var/cfengine/policy_server.dat", sudo: true)
              if bootstrapped && !config.force_bootstrap
                logger.info("CFEngine already bootstrapped, no need to do it again")
                return false
              end

              logger.info("CFEngine needs bootstrap.")
              return true
            end
          end
        end
      end
    end
  end
end

Version data entries

63 entries across 56 versions & 8 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.3.3.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.3.2.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.19.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.18.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.16.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.14.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.10.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.9.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.8.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.7.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.6.2 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.6.1 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.6.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.5.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.4.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.3.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb
vagrant-unbundled-2.2.2.0 plugins/provisioners/cfengine/cap/linux/cfengine_needs_bootstrap.rb