diff options
author | Thomas Wiest <twiest@redhat.com> | 2014-12-15 16:00:47 -0500 |
---|---|---|
committer | Thomas Wiest <twiest@redhat.com> | 2014-12-15 16:00:47 -0500 |
commit | 023f92f9e3eec7de6c1286549000be79189a4fde (patch) | |
tree | 0bb33e5ee852ea533f1f808a8e86e38c97699bb4 /roles/docker_img_puppet/files/puppet_container/start.rb | |
parent | 2848232bdaed44fadb51548fe9d6c39fe89b8e11 (diff) | |
download | openshift-023f92f9e3eec7de6c1286549000be79189a4fde.tar.gz openshift-023f92f9e3eec7de6c1286549000be79189a4fde.tar.bz2 openshift-023f92f9e3eec7de6c1286549000be79189a4fde.tar.xz openshift-023f92f9e3eec7de6c1286549000be79189a4fde.zip |
changed atomic proxy to use pre-built container images
Diffstat (limited to 'roles/docker_img_puppet/files/puppet_container/start.rb')
-rwxr-xr-x | roles/docker_img_puppet/files/puppet_container/start.rb | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/roles/docker_img_puppet/files/puppet_container/start.rb b/roles/docker_img_puppet/files/puppet_container/start.rb deleted file mode 100755 index f1dd940ba..000000000 --- a/roles/docker_img_puppet/files/puppet_container/start.rb +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env ruby - -require 'fileutils' - -CTR_CONFIG_FLAG = '/shared/var/run/ctr-ipc/flag/ctr_configured' - - -class Start - def self.setup_shared_dirs() - puts '_' - puts 'Setting up dirs in shared volume' - puts '--------------------------------' - mtab = File.read('/etc/mtab') - - shared_dirs = mtab.grep(/ \/shared\//).collect { |line| line.split(' ')[1] } - - shared_dirs.each do |sh_dir| - orig_dir = sh_dir.gsub(/^\/shared/,'') - - next if File.symlink?(orig_dir) - - if File.exist?(orig_dir) - cmd = "cp -vaf #{orig_dir} #{File.dirname(sh_dir)}" - puts "Running: #{cmd}" - system(cmd) - - cmd = "rm -vrf #{orig_dir}" - puts "Running: #{cmd}" - system(cmd) - end - - FileUtils.ln_s(sh_dir, orig_dir, {:verbose => true}) - end - puts 'Done.' - puts '_' - end - - def self.run_puppet_agent() - puts '_' - puts 'Running Puppet Agent' - puts '--------------------' - exitcode = nil - 1.upto(3) do |ctr| - unless ctr == 1 - puts '_' - puts "Previous puppet run failed with exit code [#{exitcode}], running again..." - puts '_' - end - - system("bash -c 'time /usr/bin/puppet agent -t'") - exitcode = $?.exitstatus - puts "Exit Code [#{exitcode}]" - - break if exitcode == 0 || exitcode == 2 - end - - raise "Puppet run failed, retries exhausted." if exitcode != 0 && exitcode != 2 - - puts 'Done.' - puts '_' - - puts '_' - puts 'Creating ctr_configured flag' - FileUtils.mkdir_p(File.dirname(CTR_CONFIG_FLAG)) - FileUtils.touch(CTR_CONFIG_FLAG) - puts 'Done.' - puts '_' - end - - def self.exec_puppetd() - puts '_' - puts 'Exec-ing puppet daemon' - puts '---------------------' - puts "Starting puppet agent..." - exec("bash -c '/usr/bin/puppet agent --no-daemonize --detailed-exitcodes --verbose'") - end -end - -if __FILE__ == $0 - $stdout.sync = true - $stderr.sync = true - - Start.setup_shared_dirs() - Start.run_puppet_agent() - Start.exec_puppetd() -end |