abiquo-chef-agent 2.0.3 → 2.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.
- data/README.md +8 -0
- data/Rakefile +6 -3
- data/{scripts/abiquo-chef-agent.init → dist/centos/abiquo-chef-run} +18 -20
- data/dist/centos/dhclient.conf +7 -0
- data/install.sh +28 -0
- data/lib/abiquo-chef-agent.rb +1 -1
- metadata +21 -5
- data/scripts/debian/abiquo-chef-agent.conf.upstart +0 -16
- data/scripts/debian/chef-client.defaults +0 -4
data/README.md
CHANGED
@@ -3,6 +3,14 @@ abiquo-chef-agent
|
|
3
3
|
|
4
4
|
A simple boot time execution daemon that allow to execute the Chef configuration of an Abiquo virtual machine.
|
5
5
|
|
6
|
+
## Installing
|
7
|
+
|
8
|
+
Installation script currently targets a CentOS operating system. The script will install Chef and all the agent
|
9
|
+
dependencies. The installation script must be run as root:
|
10
|
+
|
11
|
+
chmod +x install.sh
|
12
|
+
./install.sh
|
13
|
+
|
6
14
|
## Contributing to abiquo-chef-agent
|
7
15
|
|
8
16
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
data/Rakefile
CHANGED
@@ -2,6 +2,8 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require './lib/abiquo-chef-agent.rb'
|
4
4
|
require 'jeweler'
|
5
|
+
require 'rdoc/task'
|
6
|
+
require 'rspec/core/rake_task'
|
5
7
|
|
6
8
|
Jeweler::Tasks.new do |gem|
|
7
9
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
@@ -19,14 +21,13 @@ Jeweler::Tasks.new do |gem|
|
|
19
21
|
gem.add_runtime_dependency 'daemons'
|
20
22
|
gem.add_runtime_dependency 'rest-client'
|
21
23
|
gem.add_runtime_dependency 'xml-simple'
|
22
|
-
|
24
|
+
gem.add_development_dependency 'rspec', '> 1.2.3'
|
23
25
|
end
|
24
26
|
|
25
27
|
Jeweler::RubygemsDotOrgTasks.new
|
26
28
|
|
27
|
-
|
29
|
+
RSpec::Core::RakeTask.new(:spec)
|
28
30
|
|
29
|
-
require 'rdoc/task'
|
30
31
|
Rake::RDocTask.new do |rdoc|
|
31
32
|
version = Abiquo::Chef::VERSION
|
32
33
|
|
@@ -35,3 +36,5 @@ Rake::RDocTask.new do |rdoc|
|
|
35
36
|
rdoc.rdoc_files.include('README*')
|
36
37
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
37
38
|
end
|
39
|
+
|
40
|
+
task :default => [:spec, :build]
|
@@ -1,36 +1,36 @@
|
|
1
|
-
#!/bin/
|
1
|
+
#!/bin/bash
|
2
|
+
#
|
3
|
+
# abiquo-chef-run Startup script for the Abiquo Chef Agent
|
2
4
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# chkconfig: - 80 01
|
6
|
-
# description: Abiquo Chef Agent
|
5
|
+
# chkconfig: - 98 02
|
6
|
+
# description: Startup script for the Abiquo Chef Agent.
|
7
7
|
|
8
8
|
### BEGIN INIT INFO
|
9
|
-
# Provides: abiquo-chef-
|
9
|
+
# Provides: abiquo-chef-run
|
10
10
|
# Required-Start: $local_fs $network $remote_fs
|
11
11
|
# Required-Stop: $local_fs $network $remote_fs
|
12
12
|
# Should-Start: $named $time
|
13
13
|
# Should-Stop: $named $time
|
14
14
|
# Short-Description: Startup script for the Abiquo Chef Agent
|
15
|
-
# Description:
|
15
|
+
# Description: Startup script for the Abiquo Chef Agent.
|
16
16
|
### END INIT INFO
|
17
17
|
|
18
|
-
# Source function library
|
19
|
-
. /etc/
|
18
|
+
# Source function library
|
19
|
+
. /etc/init.d/functions
|
20
20
|
|
21
|
-
exec="/usr/bin/abiquo-chef-
|
22
|
-
prog="abiquo-chef-
|
23
|
-
config="/etc/sysconfig/abiquo-chef-agent"
|
21
|
+
exec="/usr/bin/abiquo-chef-run"
|
22
|
+
prog="abiquo-chef-run"
|
24
23
|
|
25
24
|
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
26
25
|
|
27
|
-
|
26
|
+
pidfile=${PIDFILE-/var/run/chef/abiquo-chef-run.pid}
|
27
|
+
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
|
28
|
+
options=${OPTIONS-}
|
28
29
|
|
29
30
|
start() {
|
30
31
|
[ -x $exec ] || exit 5
|
31
|
-
#[ -f $config ] || exit 6
|
32
32
|
echo -n $"Starting $prog: "
|
33
|
-
|
33
|
+
daemon abiquo-chef-run
|
34
34
|
retval=$?
|
35
35
|
echo
|
36
36
|
[ $retval -eq 0 ] && touch $lockfile
|
@@ -39,15 +39,14 @@ start() {
|
|
39
39
|
|
40
40
|
stop() {
|
41
41
|
echo -n $"Stopping $prog: "
|
42
|
-
|
43
|
-
$exec stop
|
42
|
+
killproc -p $pidfile abiquo-chef-run
|
44
43
|
retval=$?
|
45
44
|
echo
|
46
45
|
[ $retval -eq 0 ] && rm -f $lockfile
|
47
46
|
return $retval
|
48
47
|
}
|
49
48
|
|
50
|
-
restart() {
|
49
|
+
restart () {
|
51
50
|
stop
|
52
51
|
start
|
53
52
|
}
|
@@ -62,14 +61,13 @@ force_reload() {
|
|
62
61
|
|
63
62
|
rh_status() {
|
64
63
|
# run checks to determine if the service is running or use generic status
|
65
|
-
status $prog
|
64
|
+
status -p $pidfile $prog
|
66
65
|
}
|
67
66
|
|
68
67
|
rh_status_q() {
|
69
68
|
rh_status >/dev/null 2>&1
|
70
69
|
}
|
71
70
|
|
72
|
-
|
73
71
|
case "$1" in
|
74
72
|
start)
|
75
73
|
rh_status_q && exit 0
|
@@ -0,0 +1,7 @@
|
|
1
|
+
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
|
2
|
+
|
3
|
+
send host-name "<hostname>";
|
4
|
+
request subnet-mask, broadcast-address, time-offset, routers,
|
5
|
+
domain-name, domain-name-servers, domain-search, host-name,
|
6
|
+
netbios-name-servers, netbios-scope, interface-mtu,
|
7
|
+
rfc3442-classless-static-routes, ntp-servers, vendor-encapsulated-options;
|
data/install.sh
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
if [[ ${UID} -ne 0 ]]; then
|
4
|
+
echo "${0} must be run as root"
|
5
|
+
exit 1
|
6
|
+
fi
|
7
|
+
|
8
|
+
DIST="dist/centos"
|
9
|
+
|
10
|
+
echo "Installing ntp..."
|
11
|
+
yum --quiet --assumeyes install ntp
|
12
|
+
|
13
|
+
echo "Installing Chef..."
|
14
|
+
curl -L https://www.opscode.com/chef/install.sh | bash
|
15
|
+
|
16
|
+
echo "Installing the Abiquo Chef Agent gem..."
|
17
|
+
/opt/chef/embedded/bin/gem install abiquo-chef-agent
|
18
|
+
|
19
|
+
ln -s /opt/chef/embedded/bin/abiquo-chef-run /usr/bin
|
20
|
+
cp ${DIST}/abiquo-chef-run /etc/init.d
|
21
|
+
chmod +x /etc/init.d/abiquo-chef-run
|
22
|
+
|
23
|
+
chkconfig --add abiquo-chef-run
|
24
|
+
chkconfig abiquo-chef-run on
|
25
|
+
|
26
|
+
cp ${DIST}/dhclient.conf /etc/dhcp/
|
27
|
+
|
28
|
+
echo "Done!"
|
data/lib/abiquo-chef-agent.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abiquo-chef-agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-05-
|
15
|
+
date: 2014-05-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rspec
|
@@ -158,6 +158,22 @@ dependencies:
|
|
158
158
|
- - ! '>='
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
|
+
- !ruby/object:Gem::Dependency
|
162
|
+
name: rspec
|
163
|
+
requirement: !ruby/object:Gem::Requirement
|
164
|
+
none: false
|
165
|
+
requirements:
|
166
|
+
- - ! '>'
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: 1.2.3
|
169
|
+
type: :development
|
170
|
+
prerelease: false
|
171
|
+
version_requirements: !ruby/object:Gem::Requirement
|
172
|
+
none: false
|
173
|
+
requirements:
|
174
|
+
- - ! '>'
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: 1.2.3
|
161
177
|
description: Abiquo Chef Agent
|
162
178
|
email: ruby-gems@abiquo.com
|
163
179
|
executables:
|
@@ -172,10 +188,10 @@ files:
|
|
172
188
|
- README.md
|
173
189
|
- Rakefile
|
174
190
|
- bin/abiquo-chef-run
|
191
|
+
- dist/centos/abiquo-chef-run
|
192
|
+
- dist/centos/dhclient.conf
|
193
|
+
- install.sh
|
175
194
|
- lib/abiquo-chef-agent.rb
|
176
|
-
- scripts/abiquo-chef-agent.init
|
177
|
-
- scripts/debian/abiquo-chef-agent.conf.upstart
|
178
|
-
- scripts/debian/chef-client.defaults
|
179
195
|
- spec/data/bootstrap.xml
|
180
196
|
- spec/data/bootstrap_empty_cert.xml
|
181
197
|
- spec/data/bootstrap_empty_chef.xml
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# abiquo-chef-agent - Abiquo Chef Client Wrapper
|
2
|
-
#
|
3
|
-
# Chef Client provides the Chef configuration management daemon
|
4
|
-
|
5
|
-
description "Abiquo Chef Agent"
|
6
|
-
|
7
|
-
start on (local-filesystems and net-device-up IFACE=eth0)
|
8
|
-
stop on runlevel [!2345]
|
9
|
-
|
10
|
-
pre-start script
|
11
|
-
test -x /usr/bin/abiquo-chef-run || { stop; exit 0; }
|
12
|
-
export RUBYOPT="-d"
|
13
|
-
end script
|
14
|
-
|
15
|
-
exec /usr/bin/abiquo-chef-run
|
16
|
-
|