elecksee 1.0.0
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.
- data/CHANGELOG.md +2 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +18 -0
- data/README.md +48 -0
- data/bin/lxc-awesome-ephemeral +5 -0
- data/elecksee.gemspec +16 -0
- data/lib/elecksee/awesome.rb +14 -0
- data/lib/elecksee/lxc.rb +7 -0
- data/lib/elecksee/vendor/lxc/CHANGELOG.md +37 -0
- data/lib/elecksee/vendor/lxc/Gemfile +4 -0
- data/lib/elecksee/vendor/lxc/Gemfile.lock +41 -0
- data/lib/elecksee/vendor/lxc/README.md +112 -0
- data/lib/elecksee/vendor/lxc/attributes/default.rb +28 -0
- data/lib/elecksee/vendor/lxc/files/default/knife_lxc +228 -0
- data/lib/elecksee/vendor/lxc/files/default/lxc-awesome-ephemeral +495 -0
- data/lib/elecksee/vendor/lxc/libraries/lxc.rb +354 -0
- data/lib/elecksee/vendor/lxc/libraries/lxc_expanded_resources.rb +40 -0
- data/lib/elecksee/vendor/lxc/libraries/lxc_file_config.rb +84 -0
- data/lib/elecksee/vendor/lxc/libraries/monkey.rb +51 -0
- data/lib/elecksee/vendor/lxc/metadata.rb +12 -0
- data/lib/elecksee/vendor/lxc/providers/config.rb +75 -0
- data/lib/elecksee/vendor/lxc/providers/container.rb +318 -0
- data/lib/elecksee/vendor/lxc/providers/default.rb +57 -0
- data/lib/elecksee/vendor/lxc/providers/ephemeral.rb +40 -0
- data/lib/elecksee/vendor/lxc/providers/fstab.rb +30 -0
- data/lib/elecksee/vendor/lxc/providers/interface.rb +45 -0
- data/lib/elecksee/vendor/lxc/providers/service.rb +53 -0
- data/lib/elecksee/vendor/lxc/recipes/containers.rb +13 -0
- data/lib/elecksee/vendor/lxc/recipes/default.rb +58 -0
- data/lib/elecksee/vendor/lxc/recipes/install_dependencies.rb +15 -0
- data/lib/elecksee/vendor/lxc/recipes/knife.rb +37 -0
- data/lib/elecksee/vendor/lxc/resources/config.rb +19 -0
- data/lib/elecksee/vendor/lxc/resources/container.rb +54 -0
- data/lib/elecksee/vendor/lxc/resources/default.rb +12 -0
- data/lib/elecksee/vendor/lxc/resources/ephemeral.rb +13 -0
- data/lib/elecksee/vendor/lxc/resources/fstab.rb +12 -0
- data/lib/elecksee/vendor/lxc/resources/interface.rb +13 -0
- data/lib/elecksee/vendor/lxc/resources/service.rb +5 -0
- data/lib/elecksee/vendor/lxc/templates/default/client.rb.erb +13 -0
- data/lib/elecksee/vendor/lxc/templates/default/default-lxc.erb +3 -0
- data/lib/elecksee/vendor/lxc/templates/default/file_content.erb +2 -0
- data/lib/elecksee/vendor/lxc/templates/default/fstab.erb +5 -0
- data/lib/elecksee/vendor/lxc/templates/default/interface.erb +27 -0
- data/lib/elecksee/version.rb +6 -0
- data/lib/elecksee.rb +1 -0
- metadata +123 -0
|
@@ -0,0 +1,54 @@
|
|
|
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
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1,13 @@
|
|
|
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]
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
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 %>
|
data/lib/elecksee.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'elecksee/version'
|
metadata
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: elecksee
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Chris Roberts
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2013-05-13 00:00:00.000000000 Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: mixlib-shellout
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ! '>='
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '0'
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ! '>='
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '0'
|
|
30
|
+
- !ruby/object:Gem::Dependency
|
|
31
|
+
name: net-ssh
|
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
|
33
|
+
none: false
|
|
34
|
+
requirements:
|
|
35
|
+
- - ! '>='
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
38
|
+
type: :runtime
|
|
39
|
+
prerelease: false
|
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ! '>='
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0'
|
|
46
|
+
description: LXC helpers
|
|
47
|
+
email: chrisroberts.code@gmail.com
|
|
48
|
+
executables:
|
|
49
|
+
- lxc-awesome-ephemeral
|
|
50
|
+
extensions: []
|
|
51
|
+
extra_rdoc_files: []
|
|
52
|
+
files:
|
|
53
|
+
- elecksee.gemspec
|
|
54
|
+
- lib/elecksee/version.rb
|
|
55
|
+
- lib/elecksee/awesome.rb
|
|
56
|
+
- lib/elecksee/vendor/lxc/files/default/lxc-awesome-ephemeral
|
|
57
|
+
- lib/elecksee/vendor/lxc/files/default/knife_lxc
|
|
58
|
+
- lib/elecksee/vendor/lxc/metadata.rb
|
|
59
|
+
- lib/elecksee/vendor/lxc/templates/default/interface.erb
|
|
60
|
+
- lib/elecksee/vendor/lxc/templates/default/fstab.erb
|
|
61
|
+
- lib/elecksee/vendor/lxc/templates/default/client.rb.erb
|
|
62
|
+
- lib/elecksee/vendor/lxc/templates/default/file_content.erb
|
|
63
|
+
- lib/elecksee/vendor/lxc/templates/default/default-lxc.erb
|
|
64
|
+
- lib/elecksee/vendor/lxc/Gemfile
|
|
65
|
+
- lib/elecksee/vendor/lxc/attributes/default.rb
|
|
66
|
+
- lib/elecksee/vendor/lxc/README.md
|
|
67
|
+
- lib/elecksee/vendor/lxc/providers/fstab.rb
|
|
68
|
+
- lib/elecksee/vendor/lxc/providers/default.rb
|
|
69
|
+
- lib/elecksee/vendor/lxc/providers/interface.rb
|
|
70
|
+
- lib/elecksee/vendor/lxc/providers/service.rb
|
|
71
|
+
- lib/elecksee/vendor/lxc/providers/config.rb
|
|
72
|
+
- lib/elecksee/vendor/lxc/providers/ephemeral.rb
|
|
73
|
+
- lib/elecksee/vendor/lxc/providers/container.rb
|
|
74
|
+
- lib/elecksee/vendor/lxc/libraries/monkey.rb
|
|
75
|
+
- lib/elecksee/vendor/lxc/libraries/lxc_file_config.rb
|
|
76
|
+
- lib/elecksee/vendor/lxc/libraries/lxc_expanded_resources.rb
|
|
77
|
+
- lib/elecksee/vendor/lxc/libraries/lxc.rb
|
|
78
|
+
- lib/elecksee/vendor/lxc/resources/fstab.rb
|
|
79
|
+
- lib/elecksee/vendor/lxc/resources/default.rb
|
|
80
|
+
- lib/elecksee/vendor/lxc/resources/interface.rb
|
|
81
|
+
- lib/elecksee/vendor/lxc/resources/service.rb
|
|
82
|
+
- lib/elecksee/vendor/lxc/resources/config.rb
|
|
83
|
+
- lib/elecksee/vendor/lxc/resources/ephemeral.rb
|
|
84
|
+
- lib/elecksee/vendor/lxc/resources/container.rb
|
|
85
|
+
- lib/elecksee/vendor/lxc/CHANGELOG.md
|
|
86
|
+
- lib/elecksee/vendor/lxc/Gemfile.lock
|
|
87
|
+
- lib/elecksee/vendor/lxc/recipes/default.rb
|
|
88
|
+
- lib/elecksee/vendor/lxc/recipes/install_dependencies.rb
|
|
89
|
+
- lib/elecksee/vendor/lxc/recipes/knife.rb
|
|
90
|
+
- lib/elecksee/vendor/lxc/recipes/containers.rb
|
|
91
|
+
- lib/elecksee/lxc.rb
|
|
92
|
+
- lib/elecksee.rb
|
|
93
|
+
- Gemfile
|
|
94
|
+
- README.md
|
|
95
|
+
- bin/lxc-awesome-ephemeral
|
|
96
|
+
- CHANGELOG.md
|
|
97
|
+
- Gemfile.lock
|
|
98
|
+
homepage: http://github.com/chrisroberts/elecksee
|
|
99
|
+
licenses: []
|
|
100
|
+
post_install_message:
|
|
101
|
+
rdoc_options: []
|
|
102
|
+
require_paths:
|
|
103
|
+
- lib
|
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
|
+
none: false
|
|
106
|
+
requirements:
|
|
107
|
+
- - ! '>='
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '0'
|
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
|
+
none: false
|
|
112
|
+
requirements:
|
|
113
|
+
- - ! '>='
|
|
114
|
+
- !ruby/object:Gem::Version
|
|
115
|
+
version: '0'
|
|
116
|
+
requirements: []
|
|
117
|
+
rubyforge_project:
|
|
118
|
+
rubygems_version: 1.8.24
|
|
119
|
+
signing_key:
|
|
120
|
+
specification_version: 3
|
|
121
|
+
summary: LXC helpers
|
|
122
|
+
test_files: []
|
|
123
|
+
has_rdoc:
|