methods/lx_client.rb
# Create post install package on container
Create post install package on container
Create post install package on container
def create_lxc_post(options,post_list)
  tmp_file   = "/tmp/post"
  options['clientdir'] = options['lxcdir']+"/"+options['name']
  post_file  = options['clientdir']+"/rootfs/root/post_install.sh"
  file       = File.open(tmp_file,"w")
  post_list.each do |line|
    output = line+"\n"
    file.write(output)
  end
  file.close
  message = "Information:\tCreating post install script"
  command = "cp #{tmp_file} #{post_file} ; chmod +x #{post_file} ; rm #{tmp_file}"
  execute_command(options,message,command)
  return
end
def create_lxc_post ( options , post_list ) tmp_file = "/tmp/post" options [ 'clientdir' ] = options [ 'lxcdir' ] + "/" + options [ 'name' ] post_file = options [ 'clientdir' ] + "/rootfs/root/post_install.sh" file = File . open ( tmp_file , "w" ) post_list . each do | line | output = line + "\n" file . write ( output ) end file . close message = "Information:\tCreating post install script" command = "cp #{tmp_file} #{post_file} ; chmod +x #{post_file} ; rm #{tmp_file}" execute_command ( options , message , command ) return end
Create post install package on container
Create post install package on container
options
<not_specific>
post_list
<not_specific>