elecksee 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. data/CHANGELOG.md +4 -0
  2. data/bin/lxc-awesome-ephemeral +57 -2
  3. data/lib/elecksee/clone.rb +15 -0
  4. data/lib/elecksee/ephemeral.rb +310 -0
  5. data/lib/elecksee/helpers.rb +70 -0
  6. data/lib/elecksee/lxc.rb +409 -5
  7. data/lib/elecksee/lxc_file_config.rb +86 -0
  8. data/lib/elecksee/storage/overlay_directory.rb +31 -0
  9. data/lib/elecksee/storage/overlay_mount.rb +60 -0
  10. data/lib/elecksee/storage/virtual_device.rb +81 -0
  11. data/lib/elecksee/version.rb +1 -1
  12. metadata +9 -39
  13. data/Gemfile.lock +0 -18
  14. data/lib/elecksee/awesome.rb +0 -14
  15. data/lib/elecksee/vendor/lxc/CHANGELOG.md +0 -37
  16. data/lib/elecksee/vendor/lxc/Gemfile +0 -4
  17. data/lib/elecksee/vendor/lxc/Gemfile.lock +0 -41
  18. data/lib/elecksee/vendor/lxc/README.md +0 -112
  19. data/lib/elecksee/vendor/lxc/attributes/default.rb +0 -28
  20. data/lib/elecksee/vendor/lxc/files/default/knife_lxc +0 -228
  21. data/lib/elecksee/vendor/lxc/files/default/lxc-awesome-ephemeral +0 -495
  22. data/lib/elecksee/vendor/lxc/libraries/lxc.rb +0 -366
  23. data/lib/elecksee/vendor/lxc/libraries/lxc_expanded_resources.rb +0 -40
  24. data/lib/elecksee/vendor/lxc/libraries/lxc_file_config.rb +0 -84
  25. data/lib/elecksee/vendor/lxc/libraries/monkey.rb +0 -51
  26. data/lib/elecksee/vendor/lxc/metadata.rb +0 -12
  27. data/lib/elecksee/vendor/lxc/providers/config.rb +0 -75
  28. data/lib/elecksee/vendor/lxc/providers/container.rb +0 -318
  29. data/lib/elecksee/vendor/lxc/providers/default.rb +0 -57
  30. data/lib/elecksee/vendor/lxc/providers/ephemeral.rb +0 -40
  31. data/lib/elecksee/vendor/lxc/providers/fstab.rb +0 -30
  32. data/lib/elecksee/vendor/lxc/providers/interface.rb +0 -45
  33. data/lib/elecksee/vendor/lxc/providers/service.rb +0 -53
  34. data/lib/elecksee/vendor/lxc/recipes/containers.rb +0 -13
  35. data/lib/elecksee/vendor/lxc/recipes/default.rb +0 -58
  36. data/lib/elecksee/vendor/lxc/recipes/install_dependencies.rb +0 -15
  37. data/lib/elecksee/vendor/lxc/recipes/knife.rb +0 -37
  38. data/lib/elecksee/vendor/lxc/resources/config.rb +0 -19
  39. data/lib/elecksee/vendor/lxc/resources/container.rb +0 -54
  40. data/lib/elecksee/vendor/lxc/resources/default.rb +0 -12
  41. data/lib/elecksee/vendor/lxc/resources/ephemeral.rb +0 -13
  42. data/lib/elecksee/vendor/lxc/resources/fstab.rb +0 -12
  43. data/lib/elecksee/vendor/lxc/resources/interface.rb +0 -13
  44. data/lib/elecksee/vendor/lxc/resources/service.rb +0 -5
  45. data/lib/elecksee/vendor/lxc/templates/default/client.rb.erb +0 -13
  46. data/lib/elecksee/vendor/lxc/templates/default/default-lxc.erb +0 -3
  47. data/lib/elecksee/vendor/lxc/templates/default/file_content.erb +0 -2
  48. data/lib/elecksee/vendor/lxc/templates/default/fstab.erb +0 -5
  49. data/lib/elecksee/vendor/lxc/templates/default/interface.erb +0 -27
@@ -1,54 +0,0 @@
1
- def initialize(*args)
2
- @subresources = []
3
- super
4
- end
5
-
6
- actions :create, :delete
7
- default_action :create
8
-
9
- attribute :validation_client, :kind_of => String
10
- attribute :validator_pem, :kind_of => String, :default => nil
11
- attribute :server_uri, :kind_of => String
12
- attribute :chef_environment, :kind_of => String, :default => '_default'
13
- attribute :node_name, :kind_of => String
14
- attribute :run_list, :kind_of => Array
15
- attribute :chef_enabled, :kind_of => [TrueClass, FalseClass], :default => false
16
- attribute :chef_retries, :kind_of => Fixnum, :default => 0
17
- attribute :copy_data_bag_secret_file, :kind_of => [TrueClass, FalseClass], :default => false
18
- attribute :data_bag_secret_file, :kind_of => String, :default => Chef::EncryptedDataBagItem::DEFAULT_SECRET_FILE
19
- attribute :default_bridge, :kind_of => String
20
- attribute :static_ip, :kind_of => String
21
- attribute :static_netmask, :kind_of => String, :default => '255.255.255.0'
22
- attribute :static_gateway, :kind_of => String
23
- attribute :default_config, :kind_of => [TrueClass, FalseClass], :default => true
24
- attribute :default_fstab, :kind_of => [TrueClass, FalseClass], :default => true
25
- attribute :container_commands, :kind_of => Array, :default => []
26
- attribute :initialize_commands, :kind_of => Array, :default => []
27
- attribute :clone, :kind_of => String
28
- attribute :template, :kind_of => String, :default => 'ubuntu'
29
- attribute :template_opts, :kind_of => Hash, :default => {}
30
- attribute :create_environment, :kind_of => Hash, :default => {}
31
-
32
- def fstab_mount(fname, &block)
33
- fstab = Chef::Resource::LxcFstab.new("lxc_fstab[#{self.name} - #{fname}]", nil)
34
- fstab.action :nothing
35
- fstab.container self.name
36
-
37
- @subresources << [fstab, block]
38
- end
39
-
40
- def interface(iname, &block)
41
- iface = Chef::Resource::LxcInterface.new("lxc_interface[#{self.name} - #{iname}]", nil)
42
- iface.container self.name
43
- iface.action :nothing
44
- @subresources << [iface, block]
45
- end
46
-
47
- def config(cname, &block)
48
- conf = Chef::Resource::LxcConfig.new("lxc_config[#{self.name} - #{cname}]", nil)
49
- conf.container self.name
50
- conf.action :nothing
51
- @subresources << [conf, block]
52
- end
53
-
54
- attr_reader :subresources
@@ -1,12 +0,0 @@
1
- actions :create, :delete, :clone
2
- default_action :create
3
-
4
- attribute :template, :kind_of => String, :default => 'ubuntu'
5
- attribute :template_opts, :kind_of => Hash, :default => {}
6
- attribute :base_container, :kind_of => String
7
-
8
- # Backing store options. Not yet in use
9
- attribute :fstype, :kind_of => String, :default => 'ext4'
10
- attribute :fssize, :kind_of => String, :default => '2G'
11
- attribute :vgname, :kind_of => String
12
- attribute :lvname, :kind_of => String
@@ -1,13 +0,0 @@
1
- actions :run
2
- default_action :run
3
-
4
- attribute :command, :kind_of => String, :required => true
5
- attribute :bind_directory, :kind_of => String
6
- attribute :base_container, :kind_of => String, :required => true
7
- attribute :background, :kind_of => [TrueClass,FalseClass], :default => false
8
- attribute :union_type, :equal_to => %w(aufs overlayfs), :default => 'overlayfs'
9
- attribute :user, :kind_of => String, :default => 'root'
10
- attribute :key, :kind_of => String, :default => '/opt/hw-lxc-config/id_rsa'
11
- attribute :host_rootfs, :kind_of => String
12
- attribute :virtual_device, :kind_of => Numeric
13
- attribute :stream_output, :kind_of => [TrueClass,FalseClass,IO]
@@ -1,12 +0,0 @@
1
- actions :create, :delete
2
- default_action :create
3
-
4
- attribute :container, :kind_of => String, :required => true
5
- attribute :file_system, :kind_of => String, :required => true
6
- attribute :mount_point, :kind_of => String, :required => true
7
- attribute :type, :kind_of => String, :required => true
8
- attribute :options, :kind_of => [String, Array]
9
- attribute :dump, :kind_of => Numeric, :default => 0
10
- attribute :pass, :kind_of => Numeric, :default => 0
11
- attribute :auto_join_rootfs_mount, :kind_of => [TrueClass,FalseClass], :default => true
12
- attribute :create_mount_point, :kind_of => [TrueClass,FalseClass], :default => true
@@ -1,13 +0,0 @@
1
- actions :create, :delete
2
- default_action :create
3
-
4
- attribute :container, :kind_of => String, :required => true
5
- attribute :device, :kind_of => String, :required => true
6
- attribute :auto, :kind_of => [TrueClass, FalseClass], :default => true
7
- attribute :dynamic, :kind_of => [TrueClass, FalseClass], :default => false
8
- attribute :address, :kind_of => String
9
- attribute :gateway, :kind_of => String
10
- attribute :up, :kind_of => String
11
- attribute :down, :kind_of => String
12
- attribute :netmask, :kind_of => [String,Numeric]
13
- attribute :ipv6, :kind_of => [TrueClass,FalseClass], :default => false
@@ -1,5 +0,0 @@
1
- actions :start, :stop, :halt, :restart, :freeze, :unfreeze
2
- default_action :start
3
-
4
- attribute :service_name, :kind_of => String
5
-
@@ -1,13 +0,0 @@
1
- log_level :info
2
- log_location "/var/log/chef-client.log"
3
-
4
- chef_server_url '<%= @server_uri %>'
5
- validation_client_name '<%= @validation_client %>'
6
- node_name '<%= @node_name %>'
7
- environment '<%= @chef_environment %>'
8
-
9
- file_backup_path "/var/lib/chef"
10
- file_cache_path "/var/cache/chef"
11
-
12
- pid_file "/var/run/chef/client.pid"
13
-
@@ -1,3 +0,0 @@
1
- <% @config.each_pair do |key, val| %>
2
- <%= key.to_s.upcase %>=<%= val.inspect %>
3
- <% end %>
@@ -1,2 +0,0 @@
1
- # Chef generated key file
2
- <%= ::File.read(@path) %>
@@ -1,5 +0,0 @@
1
- # Chef generated fstab!
2
- <% node.run_state[:lxc][:fstabs][@container].each do |line| -%>
3
- <%= line %>
4
- <% end -%>
5
-
@@ -1,27 +0,0 @@
1
- # Auto config dropped off by chef!
2
-
3
- # Always setup loopback
4
- auto lo
5
- iface lo inet loopback
6
-
7
- <% node.run_state[:lxc][:interfaces][@container].each do |net_set| -%>
8
- <% if net_set[:auto] -%>
9
- auto <%= net_set[:device] %>
10
- <% end -%>
11
- <% if net_set[:dynamic] -%>
12
- iface <%= net_set[:device] %> inet<%= '6' if net_set[:ipv6] %> dhcp
13
- <% else -%>
14
- iface <%= net_set[:device] %> inet<%= '6' if net_set[:ipv6] %> static
15
- address <%= net_set[:address] %>
16
- <% if net_set[:gateway] -%>
17
- gateway <%= net_set[:gateway] %>
18
- <% end -%>
19
- netmask <%= net_set[:netmask] %>
20
- <% if net_set[:up] -%>
21
- up <%= net_set[:up] %>
22
- <% end -%>
23
- <% if net_set[:down] -%>
24
- down <%= net_set[:down] %>
25
- <% end -%>
26
- <% end -%>
27
- <% end %>