[Pkg-puppet-devel] [facter] 63/352: (Maint) Remove puppet specific setup steps

Stig Sandbeck Mathisen ssm at debian.org
Sun Apr 6 22:21:32 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit f845df5dce9d6ff7db6c22d7b7082e807e77fde1
Author: Josh Cooper <josh at puppetlabs.com>
Date:   Thu Dec 5 20:56:50 2013 -0800

    (Maint) Remove puppet specific setup steps
    
    These steps are not needed when executing facter acceptance.
---
 acceptance/setup/02_PuppetWorkArounds.rb  | 21 ---------
 acceptance/setup/03_PuppetMasterSanity.rb | 24 ----------
 acceptance/setup/04_ValidateSignCert.rb   | 28 ------------
 acceptance/setup/06_InstallModules.rb     | 76 -------------------------------
 4 files changed, 149 deletions(-)

diff --git a/acceptance/setup/02_PuppetWorkArounds.rb b/acceptance/setup/02_PuppetWorkArounds.rb
deleted file mode 100644
index d7b1f71..0000000
--- a/acceptance/setup/02_PuppetWorkArounds.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-test_name 'work arounds for bugs' do
-  hosts.each do |host|
-    next if host['platform'].include? 'windows'
-
-    step "REVISIT: see #9862, this step should not be required for agents" do
-      on host, "getent group puppet || groupadd puppet"
-
-      if host['platform'].include? 'solaris'
-        useradd_opts = '-d /puppet -m -s /bin/sh -g puppet puppet'
-      else
-        useradd_opts = 'puppet -g puppet -G puppet'
-      end
-
-      on host, "getent passwd puppet || useradd #{useradd_opts}"
-    end
-
-    step "REVISIT: Work around bug #5794 not creating reports as required" do
-      on host, "mkdir -p /tmp/reports && chown puppet:puppet /tmp/reports"
-    end
-  end
-end
diff --git a/acceptance/setup/03_PuppetMasterSanity.rb b/acceptance/setup/03_PuppetMasterSanity.rb
deleted file mode 100755
index 6d1df4c..0000000
--- a/acceptance/setup/03_PuppetMasterSanity.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-test_name "Puppet Master sanity checks: PID file and SSL dir creation"
-
-pidfile = '/var/lib/puppet/run/master.pid'
-
-hostname = on(master, 'facter hostname').stdout.strip                                             
-fqdn = on(master, 'facter fqdn').stdout.strip                                                     
-                                                                                                  
-master_conf = {
-  :main => {
-    :dns_alt_names => "puppet,#{hostname},#{fqdn}",
-    :verbose => true,
-    :noop => true,
-  },
-}
-
-with_puppet_running_on(master, master_conf) do
-  # SSL dir created?
-  step "SSL dir created?"
-  on master,  "[ -d #{master['puppetpath']}/ssl ]"
-
-  # PID file exists?
-  step "PID file created?"
-  on master, "[ -f #{pidfile} ]"
-end
diff --git a/acceptance/setup/04_ValidateSignCert.rb b/acceptance/setup/04_ValidateSignCert.rb
deleted file mode 100755
index 7c9e309..0000000
--- a/acceptance/setup/04_ValidateSignCert.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-test_name "Validate Sign Cert"
-
-hostname = on(master, 'facter hostname').stdout.strip                                             
-fqdn = on(master, 'facter fqdn').stdout.strip                                                     
-                                                                                                  
-master_conf = {
-  :master => {
-    :dns_alt_names => "puppet,#{hostname},#{fqdn}",
-  },
-}
-
-step "Master: Start Puppet Master"
-with_puppet_running_on(master, master_conf) do
-  hosts.each do |host|
-    next if host['roles'].include? 'master'
-
-    step "Agents: Run agent --test first time to gen CSR"
-    on host, puppet_agent("--test"), :acceptable_exit_codes => [1]
-  end
-
-  # Sign all waiting certs
-  step "Master: sign all certs"
-  on master, puppet_cert("--sign --all"), :acceptable_exit_codes => [0,24]
-
-  step "Agents: Run agent --test second time to obtain signed cert"
-  on agents, puppet_agent("--test"), :acceptable_exit_codes => [0,2]
-end
-
diff --git a/acceptance/setup/06_InstallModules.rb b/acceptance/setup/06_InstallModules.rb
deleted file mode 100644
index 0024301..0000000
--- a/acceptance/setup/06_InstallModules.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-require 'pathname'
-
-# Given an array of modules specified by the --modules command line option,
-# Parse all of them into an array of usable hash structures.
-class PuppetModules
-  attr_reader :modules
-
-  def initialize(modules=[])
-    @modules = modules
-  end
-
-  def list
-    return [] unless modules
-    modules.collect do |uri|
-      git_url, git_ref = uri.split '#'
-      folder = Pathname.new(git_url).basename('.git')
-      name = folder.to_s.split('-', 2)[1] || folder.to_s
-      {
-        :name     => name,
-        :url      => git_url,
-        :folder   => folder.to_s,
-        :ref      => git_ref,
-        :protocol => git_url.split(':')[0].intern,
-      }
-    end
-  end
-end
-
-def install_git_module(mod, hosts)
-  # The idea here is that each test can symlink the modules they want from a
-  # temporary directory to this location.  This will preserve the global
-  # state of the system while allowing individual test cases to quickly run
-  # with a module "installed" in the module path.
-  moddir = "/opt/puppet-git-repos"
-  target = "#{moddir}/#{mod[:name]}"
-
-  step "Clone #{mod[:url]} if needed"
-  on hosts, "test -d #{moddir} || mkdir -p #{moddir}"
-  on hosts, "test -d #{target} || git clone #{mod[:url]} #{target}"
-  step "Update #{mod[:name]} and check out revision #{mod[:ref]}"
-
-  commands = ["cd #{target}",
-              "remote rm origin",
-              "remote add origin #{mod[:url]}",
-              "fetch origin",
-              "checkout -f #{mod[:ref]}",
-              "reset --hard refs/remotes/origin/#{mod[:ref]}",
-              "clean -fdx",
-  ]
-
-  on hosts, commands.join(" && git ")
-end
-
-def install_scp_module(mod, hosts)
-  moddir = "/opt/puppet-git-repos"
-  target = "#{moddir}/#{mod[:name]}"
-
-  step "Purge #{target} if needed"
-  on hosts, "test -d #{target} && rm -rf #{target} || true"
-
-  step "Copy #{mod[:name]} to hosts"
-  scp_to hosts, mod[:url].split(':', 2)[1], target
-end
-
-modules = PuppetModules.new(options[:modules]).list
-
-step "Masters: Install Puppet Modules"
-masters = hosts.select { |host| host['roles'].include? 'master' }
-
-modules.each do |mod|
-  if mod[:protocol] == :scp
-    install_scp_module(mod, masters)
-  else
-    install_git_module(mod, masters)
-  end
-end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list