Class: Chef::Application::LXC
- Inherits:
-
Chef::Application
- Object
- Chef::Application
- Chef::Application::LXC
- Includes:
- LXCHelper
- Defined in:
- lib/chef/application/lxc.rb
Instance Method Summary collapse
-
#initialize ⇒ LXC
constructor
A new instance of LXC.
- #reconfigure ⇒ Object
- #run ⇒ Object
- #run_application ⇒ Object
- #run_chef_recipe ⇒ Object
Methods included from LXCHelper
Constructor Details
#initialize ⇒ LXC
Returns a new instance of LXC.
66 67 68 |
# File 'lib/chef/application/lxc.rb', line 66 def initialize super end |
Instance Method Details
#reconfigure ⇒ Object
70 71 72 73 74 |
# File 'lib/chef/application/lxc.rb', line 70 def reconfigure Chef::Config.merge!(config) configure_logging end |
#run ⇒ Object
102 103 104 105 |
# File 'lib/chef/application/lxc.rb', line 102 def run reconfigure run_application end |
#run_application ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/chef/application/lxc.rb', line 89 def run_application begin run_chef_recipe Chef::Application.exit! "Exiting", 0 rescue SystemExit => e raise rescue Exception => e Chef::Application.debug_stacktrace(e) Chef::Application.fatal!("#{e.class}: #{e.}", 1) end end |
#run_chef_recipe ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/chef/application/lxc.rb', line 76 def run_chef_recipe if config[:execute] recipe_text = config[:execute] elsif config[:stdin] recipe_text = STDIN.read else recipe_text = ::File.read(ARGV.first) end Chef::Config[:solo] = true ct = ::LXC::Container.new(ARGV.first) recipe_in_container(ct, recipe_text) end |