From 023f92f9e3eec7de6c1286549000be79189a4fde Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Mon, 15 Dec 2014 16:00:47 -0500 Subject: changed atomic proxy to use pre-built container images --- .../files/puppet_container/Dockerfile | 38 ---------- .../files/puppet_container/service.rb | 18 ----- .../files/puppet_container/start.rb | 86 ---------------------- 3 files changed, 142 deletions(-) delete mode 100644 roles/docker_img_puppet/files/puppet_container/Dockerfile delete mode 100755 roles/docker_img_puppet/files/puppet_container/service.rb delete mode 100755 roles/docker_img_puppet/files/puppet_container/start.rb (limited to 'roles/docker_img_puppet/files') diff --git a/roles/docker_img_puppet/files/puppet_container/Dockerfile b/roles/docker_img_puppet/files/puppet_container/Dockerfile deleted file mode 100644 index e16536c03..000000000 --- a/roles/docker_img_puppet/files/puppet_container/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# This FROM gives us the proper oo-rhui certs, basic runtime env vars, basic repos, etc. -# Otherwise we can't install anything -FROM rhel6ops - -MAINTAINER Thomas Wiest - -RUN yum -y update ; yum clean all - -# Container Specific RPMs -RUN yum -y install puppet3 crontabs cronie-anacron cronie system-config-firewall-base httpd mod_ssl ruby193-rubygem-zbxapi mod_security rhc-site-static; yum clean all - -# BEGIN: These are to fake out puppet - -RUN rm /usr/sbin/lokkit ; ln -s /bin/true /usr/sbin/lokkit - -# this is needed so that we can run puppet without running the start script -RUN mkdir -p /etc/haproxy - -# Setup libra_ops group for compatibility with host puppet -RUN groupadd libra_ops - -# END: These are to fake out puppet - -# Container specific files -ADD start.rb /usr/local/sbin/start.rb -ADD service.rb /sbin/service - -# Ensure the scripts are executable -RUN chmod 755 /sbin/service /usr/local/sbin/start.rb - -RUN yum -y install strace ; yum clean all - -# Get rid of puppet deprecation warnings -RUN sed -i 's/^.*manifest =.*$//' /etc/puppet/puppet.conf ; \ - sed -i 's/^.*manifestdir =.*$//' /etc/puppet/puppet.conf ; \ - sed -i 's/^.*modulepath =.*$//' /etc/puppet/puppet.conf - -CMD ["/usr/local/sbin/start.rb"] diff --git a/roles/docker_img_puppet/files/puppet_container/service.rb b/roles/docker_img_puppet/files/puppet_container/service.rb deleted file mode 100755 index 40779c270..000000000 --- a/roles/docker_img_puppet/files/puppet_container/service.rb +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env ruby - -require 'fileutils' - -if __FILE__ == $0 - abort "\nUsage: #{File.basename($0)} \n\n" unless ARGV.size == 2 - - name = ARGV[0] - action = ARGV[1] - - SERVICE_IPC_DIR = '/var/run/ctr-ipc/service' - - FileUtils.mkdir_p(SERVICE_IPC_DIR) - - File.open("#{SERVICE_IPC_DIR}/#{name}", 'w') do |f| - f.print action - end -end 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 -- cgit v1.2.3