dtk-node-agent 0.7.7 → 0.8.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.
- checksums.yaml +5 -13
- data/README.md +21 -4
- data/bin/dtk-node-agent +17 -0
- data/lib/config/install.config +2 -2
- data/lib/dtk-node-agent/installer.rb +30 -25
- data/lib/dtk-node-agent/version.rb +18 -1
- metadata +23 -110
- data/mcollective_additions/debian.mcollective.init +0 -92
- data/mcollective_additions/plugins/README.md +0 -1
- data/mcollective_additions/plugins/v1.2/agent/discovery.rb +0 -39
- data/mcollective_additions/plugins/v1.2/agent/get_log_fragment.ddl +0 -15
- data/mcollective_additions/plugins/v1.2/agent/get_log_fragment.rb +0 -79
- data/mcollective_additions/plugins/v1.2/agent/git_access.ddl +0 -9
- data/mcollective_additions/plugins/v1.2/agent/git_access.rb +0 -79
- data/mcollective_additions/plugins/v1.2/agent/netstat.ddl +0 -9
- data/mcollective_additions/plugins/v1.2/agent/netstat.rb +0 -34
- data/mcollective_additions/plugins/v1.2/agent/puppet_apply.ddl +0 -9
- data/mcollective_additions/plugins/v1.2/agent/puppet_apply.rb +0 -630
- data/mcollective_additions/plugins/v1.2/agent/rpcutil.ddl +0 -204
- data/mcollective_additions/plugins/v1.2/agent/rpcutil.rb +0 -101
- data/mcollective_additions/plugins/v1.2/facts/pbuilder_facts.rb +0 -35
- data/mcollective_additions/plugins/v2.2/agent/action_agent.ddl +0 -9
- data/mcollective_additions/plugins/v2.2/agent/action_agent.rb +0 -47
- data/mcollective_additions/plugins/v2.2/agent/dev_manager.ddl +0 -9
- data/mcollective_additions/plugins/v2.2/agent/dev_manager.rb +0 -111
- data/mcollective_additions/plugins/v2.2/agent/discovery.rb +0 -39
- data/mcollective_additions/plugins/v2.2/agent/dtk_node_agent_git_client.rb +0 -94
- data/mcollective_additions/plugins/v2.2/agent/execute_tests.ddl +0 -9
- data/mcollective_additions/plugins/v2.2/agent/execute_tests.rb +0 -111
- data/mcollective_additions/plugins/v2.2/agent/execute_tests_v2.ddl +0 -9
- data/mcollective_additions/plugins/v2.2/agent/execute_tests_v2.rb +0 -131
- data/mcollective_additions/plugins/v2.2/agent/get_log_fragment.ddl +0 -15
- data/mcollective_additions/plugins/v2.2/agent/get_log_fragment.rb +0 -79
- data/mcollective_additions/plugins/v2.2/agent/git_access.ddl +0 -9
- data/mcollective_additions/plugins/v2.2/agent/git_access.rb +0 -61
- data/mcollective_additions/plugins/v2.2/agent/netstat.ddl +0 -9
- data/mcollective_additions/plugins/v2.2/agent/netstat.rb +0 -34
- data/mcollective_additions/plugins/v2.2/agent/ps.ddl +0 -9
- data/mcollective_additions/plugins/v2.2/agent/ps.rb +0 -37
- data/mcollective_additions/plugins/v2.2/agent/puppet_apply.ddl +0 -9
- data/mcollective_additions/plugins/v2.2/agent/puppet_apply.rb +0 -818
- data/mcollective_additions/plugins/v2.2/agent/puppet_cancel.ddl +0 -10
- data/mcollective_additions/plugins/v2.2/agent/puppet_cancel.rb +0 -78
- data/mcollective_additions/plugins/v2.2/agent/rpcutil.ddl +0 -204
- data/mcollective_additions/plugins/v2.2/agent/rpcutil.rb +0 -101
- data/mcollective_additions/plugins/v2.2/agent/ssh_agent.ddl +0 -13
- data/mcollective_additions/plugins/v2.2/agent/ssh_agent.rb +0 -97
- data/mcollective_additions/plugins/v2.2/agent/sync_agent_code.ddl +0 -10
- data/mcollective_additions/plugins/v2.2/agent/sync_agent_code.rb +0 -85
- data/mcollective_additions/plugins/v2.2/agent/tail.ddl +0 -11
- data/mcollective_additions/plugins/v2.2/agent/tail.rb +0 -67
- data/mcollective_additions/plugins/v2.2/audit/logfile.rb +0 -26
- data/mcollective_additions/plugins/v2.2/connector/r8stomp.rb +0 -238
- data/mcollective_additions/plugins/v2.2/connector/stomp.rb +0 -349
- data/mcollective_additions/plugins/v2.2/connector/stomp_em.rb +0 -191
- data/mcollective_additions/plugins/v2.2/data/agent_data.ddl +0 -22
- data/mcollective_additions/plugins/v2.2/data/agent_data.rb +0 -17
- data/mcollective_additions/plugins/v2.2/data/collective_data.ddl +0 -20
- data/mcollective_additions/plugins/v2.2/data/collective_data.rb +0 -9
- data/mcollective_additions/plugins/v2.2/data/fact_data.ddl +0 -28
- data/mcollective_additions/plugins/v2.2/data/fact_data.rb +0 -55
- data/mcollective_additions/plugins/v2.2/data/fstat_data.ddl +0 -89
- data/mcollective_additions/plugins/v2.2/data/fstat_data.rb +0 -56
- data/mcollective_additions/plugins/v2.2/discovery/flatfile.ddl +0 -11
- data/mcollective_additions/plugins/v2.2/discovery/flatfile.rb +0 -48
- data/mcollective_additions/plugins/v2.2/discovery/mc.ddl +0 -11
- data/mcollective_additions/plugins/v2.2/discovery/mc.rb +0 -30
- data/mcollective_additions/plugins/v2.2/discovery/stdin.ddl +0 -11
- data/mcollective_additions/plugins/v2.2/discovery/stdin.rb +0 -66
- data/mcollective_additions/plugins/v2.2/facts/pbuilder_facts.rb +0 -37
- data/mcollective_additions/plugins/v2.2/facts/yaml_facts.rb +0 -61
- data/mcollective_additions/plugins/v2.2/registration/agentlist.rb +0 -10
- data/mcollective_additions/plugins/v2.2/security/sshkey.ddl +0 -9
- data/mcollective_additions/plugins/v2.2/security/sshkey.rb +0 -362
- data/mcollective_additions/plugins/v2.2/util/puppetrunner.rb +0 -36
- data/mcollective_additions/plugins/v2.2/validator/array_validator.ddl +0 -7
- data/mcollective_additions/plugins/v2.2/validator/array_validator.rb +0 -9
- data/mcollective_additions/plugins/v2.2/validator/ipv4address_validator.ddl +0 -7
- data/mcollective_additions/plugins/v2.2/validator/ipv4address_validator.rb +0 -16
- data/mcollective_additions/plugins/v2.2/validator/ipv6address_validator.ddl +0 -7
- data/mcollective_additions/plugins/v2.2/validator/ipv6address_validator.rb +0 -16
- data/mcollective_additions/plugins/v2.2/validator/length_validator.ddl +0 -7
- data/mcollective_additions/plugins/v2.2/validator/length_validator.rb +0 -11
- data/mcollective_additions/plugins/v2.2/validator/regex_validator.ddl +0 -7
- data/mcollective_additions/plugins/v2.2/validator/regex_validator.rb +0 -9
- data/mcollective_additions/plugins/v2.2/validator/shellsafe_validator.ddl +0 -7
- data/mcollective_additions/plugins/v2.2/validator/shellsafe_validator.rb +0 -13
- data/mcollective_additions/plugins/v2.2/validator/typecheck_validator.ddl +0 -7
- data/mcollective_additions/plugins/v2.2/validator/typecheck_validator.rb +0 -28
- data/mcollective_additions/redhat.mcollective.init +0 -139
- data/mcollective_additions/redhat.mcollective.service +0 -14
- data/mcollective_additions/server.cfg +0 -22
- data/src/etc/logrotate.d/mcollective +0 -10
- data/src/etc/mcollective.default +0 -6
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
require 'puppet'
|
|
2
|
-
|
|
3
|
-
module MCollective
|
|
4
|
-
module Util
|
|
5
|
-
class PuppetRunner
|
|
6
|
-
|
|
7
|
-
def self.apply(puppet_definition, resource_hash)
|
|
8
|
-
if Puppet.settings.respond_to?(:initialize_global_settings)
|
|
9
|
-
Puppet.settings.initialize_global_settings
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
if Puppet.settings.respond_to?(:initialize_app_defaults)
|
|
13
|
-
Puppet.settings.initialize_app_defaults(Puppet::Settings.app_defaults_for_run_mode(Puppet.run_mode))
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
Log.info("Puppet Runner, INPUT :")
|
|
17
|
-
Log.info(puppet_definition)
|
|
18
|
-
Log.info(resource_hash.inspect)
|
|
19
|
-
Log.info("########################################################################")
|
|
20
|
-
|
|
21
|
-
pup = Puppet::Type.type(puppet_definition).new(resource_hash)
|
|
22
|
-
catalog = Puppet::Resource::Catalog.new
|
|
23
|
-
catalog.add_resource pup
|
|
24
|
-
catalog.apply()
|
|
25
|
-
|
|
26
|
-
Log.info("Puppet Runner, OUTPUT: ")
|
|
27
|
-
Log.info(Thread.current[:report_status])
|
|
28
|
-
Log.info(Thread.current[:report_info])
|
|
29
|
-
Log.info("########################################################################")
|
|
30
|
-
true
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module MCollective
|
|
2
|
-
module Validator
|
|
3
|
-
class Ipv4addressValidator
|
|
4
|
-
require 'ipaddr'
|
|
5
|
-
|
|
6
|
-
def self.validate(validator)
|
|
7
|
-
begin
|
|
8
|
-
ip = IPAddr.new(validator)
|
|
9
|
-
raise ValidatorError, "value should be an ipv4 adddress" unless ip.ipv4?
|
|
10
|
-
rescue
|
|
11
|
-
raise ValidatorError, "value should be an ipv4 address"
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module MCollective
|
|
2
|
-
module Validator
|
|
3
|
-
class Ipv6addressValidator
|
|
4
|
-
require 'ipaddr'
|
|
5
|
-
|
|
6
|
-
def self.validate(validator)
|
|
7
|
-
begin
|
|
8
|
-
ip = IPAddr.new(validator)
|
|
9
|
-
raise ValidatorError, "value should be an ipv6 adddress" unless ip.ipv6?
|
|
10
|
-
rescue
|
|
11
|
-
raise ValidatorError, "value should be an ipv6 address"
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
metadata :name => "Length",
|
|
2
|
-
:description => "Validates that the length of a string is less or equal to a specified value",
|
|
3
|
-
:author => "P. Loubser <pieter.loubser@puppetlabs.com>",
|
|
4
|
-
:license => "ASL 2.0",
|
|
5
|
-
:version => "1.0",
|
|
6
|
-
:url => "http://marionette-collective.org/",
|
|
7
|
-
:timeout => 1
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
metadata :name => "Regex",
|
|
2
|
-
:description => "Validates that a string matches a supplied regular expression",
|
|
3
|
-
:author => "P. Loubser <pieter.loubser@puppetlabs.com>",
|
|
4
|
-
:license => "ASL 2.0",
|
|
5
|
-
:version => "1.0",
|
|
6
|
-
:url => "http://marionette-collective.org/",
|
|
7
|
-
:timeout => 1
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module MCollective
|
|
2
|
-
module Validator
|
|
3
|
-
class ShellsafeValidator
|
|
4
|
-
def self.validate(validator)
|
|
5
|
-
raise ValidatorError, "value should be a String" unless validator.is_a?(String)
|
|
6
|
-
|
|
7
|
-
['`', '$', ';', '|', '&&', '>', '<'].each do |chr|
|
|
8
|
-
raise ValidatorError, "value should not have #{chr} in it" if validator.match(Regexp.escape(chr))
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module MCollective
|
|
2
|
-
module Validator
|
|
3
|
-
class TypecheckValidator
|
|
4
|
-
def self.validate(validator, validation_type)
|
|
5
|
-
raise ValidatorError, "value should be a #{validation_type.to_s}" unless check_type(validator, validation_type)
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
def self.check_type(validator, validation_type)
|
|
9
|
-
case validation_type
|
|
10
|
-
when Class
|
|
11
|
-
validator.is_a?(validation_type)
|
|
12
|
-
when :integer
|
|
13
|
-
validator.is_a?(Fixnum)
|
|
14
|
-
when :float
|
|
15
|
-
validator.is_a?(Float)
|
|
16
|
-
when :number
|
|
17
|
-
validator.is_a?(Numeric)
|
|
18
|
-
when :string
|
|
19
|
-
validator.is_a?(String)
|
|
20
|
-
when :boolean
|
|
21
|
-
[TrueClass, FalseClass].include?(validator.class)
|
|
22
|
-
else
|
|
23
|
-
false
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
#
|
|
3
|
-
# mcollective Application Server for STOMP based agents
|
|
4
|
-
#
|
|
5
|
-
# chkconfig: - 24 76
|
|
6
|
-
#
|
|
7
|
-
# description: mcollective lets you build powerful Stomp compatible middleware clients in ruby without having to worry too
|
|
8
|
-
# much about all the setup and management of a Stomp connection, it also provides stats, logging and so forth
|
|
9
|
-
# as a bonus.
|
|
10
|
-
#
|
|
11
|
-
### BEGIN INIT INFO
|
|
12
|
-
# Provides: mcollective
|
|
13
|
-
# Required-Start: $remote_fs
|
|
14
|
-
# Required-Stop: $remote_fs
|
|
15
|
-
# Short-Description: Start daemon at boot time
|
|
16
|
-
# Description: Enable service provided by daemon.
|
|
17
|
-
### END INIT INFO
|
|
18
|
-
|
|
19
|
-
mcollectived="/usr/sbin/mcollectived"
|
|
20
|
-
pidfile="/var/run/mcollectived.pid"
|
|
21
|
-
if [ -d /var/lock/subsys ]; then
|
|
22
|
-
# RedHat/CentOS/etc who use subsys
|
|
23
|
-
lockfile="/var/lock/subsys/mcollective"
|
|
24
|
-
else
|
|
25
|
-
# The rest of them
|
|
26
|
-
lockfile="/var/lock/mcollective"
|
|
27
|
-
fi
|
|
28
|
-
|
|
29
|
-
# Check that binary exists
|
|
30
|
-
if ! [ -f $mcollectived ]; then
|
|
31
|
-
echo "mcollectived binary not found"
|
|
32
|
-
exit 5
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
# Source function library.
|
|
36
|
-
. /etc/init.d/functions
|
|
37
|
-
|
|
38
|
-
if [ -f /etc/sysconfig/mcollective ]; then
|
|
39
|
-
. /etc/sysconfig/mcollective
|
|
40
|
-
fi
|
|
41
|
-
|
|
42
|
-
# Determine if we can use the -p option to daemon, killproc, and status.
|
|
43
|
-
# RHEL < 5 can't.
|
|
44
|
-
if status | grep -q -- '-p' 2>/dev/null; then
|
|
45
|
-
daemonopts="--pidfile $pidfile"
|
|
46
|
-
pidopts="-p $pidfile"
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
start() {
|
|
50
|
-
echo -n "Starting mcollective: "
|
|
51
|
-
# Only try to start if not already started
|
|
52
|
-
if ! rh_status_q; then
|
|
53
|
-
daemon ${daemonopts} ${mcollectived} --pid=${pidfile} --config="/etc/mcollective/server.cfg"
|
|
54
|
-
fi
|
|
55
|
-
# This will be 0 if mcollective is already running
|
|
56
|
-
RETVAL=$?
|
|
57
|
-
echo
|
|
58
|
-
[ $RETVAL -eq 0 ] && touch ${lockfile}
|
|
59
|
-
return $RETVAL
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
stop() {
|
|
63
|
-
echo -n "Shutting down mcollective: "
|
|
64
|
-
# If running, try to stop it
|
|
65
|
-
if rh_status_q; then
|
|
66
|
-
killproc ${pidopts} -d 10 ${mcollectived}
|
|
67
|
-
else
|
|
68
|
-
# Non-zero status either means lockfile and pidfile need cleanup (1 and 2)
|
|
69
|
-
# or the process is already stopped (3), so we can just call true to
|
|
70
|
-
# trigger the cleanup that happens below.
|
|
71
|
-
true
|
|
72
|
-
fi
|
|
73
|
-
RETVAL=$?
|
|
74
|
-
echo
|
|
75
|
-
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
|
|
76
|
-
return $RETVAL
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
restart() {
|
|
80
|
-
stop
|
|
81
|
-
start
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
reload_agents() {
|
|
85
|
-
echo -n "Reloading mcollective agents: "
|
|
86
|
-
killproc ${pidopts} ${mcollectived} -USR1
|
|
87
|
-
RETVAL=$?
|
|
88
|
-
echo
|
|
89
|
-
return $RETVAL
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
reload_loglevel() {
|
|
93
|
-
echo -n "Cycling mcollective logging level: "
|
|
94
|
-
killproc ${pidopts} ${mcollectived} -USR2
|
|
95
|
-
RETVAL=$?
|
|
96
|
-
echo
|
|
97
|
-
return $RETVAL
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
rh_status() {
|
|
101
|
-
status ${pidopts} ${mcollectived}
|
|
102
|
-
RETVAL=$?
|
|
103
|
-
return $RETVAL
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
rh_status_q() {
|
|
107
|
-
rh_status >/dev/null 2>&1
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
# See how we were called.
|
|
111
|
-
case "$1" in
|
|
112
|
-
start)
|
|
113
|
-
start
|
|
114
|
-
;;
|
|
115
|
-
stop)
|
|
116
|
-
stop
|
|
117
|
-
;;
|
|
118
|
-
restart)
|
|
119
|
-
restart
|
|
120
|
-
;;
|
|
121
|
-
condrestart)
|
|
122
|
-
rh_status_q || exit 0
|
|
123
|
-
restart
|
|
124
|
-
;;
|
|
125
|
-
reload-agents)
|
|
126
|
-
reload_agents
|
|
127
|
-
;;
|
|
128
|
-
reload-loglevel)
|
|
129
|
-
reload_loglevel
|
|
130
|
-
;;
|
|
131
|
-
status)
|
|
132
|
-
rh_status
|
|
133
|
-
;;
|
|
134
|
-
*)
|
|
135
|
-
echo "Usage: mcollectived {start|stop|restart|condrestart|reload-agents|reload-loglevel|status}"
|
|
136
|
-
RETVAL=2
|
|
137
|
-
;;
|
|
138
|
-
esac
|
|
139
|
-
exit $RETVAL
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
[Unit]
|
|
2
|
-
Description=The Marionette Collective
|
|
3
|
-
After=network.target
|
|
4
|
-
|
|
5
|
-
[Service]
|
|
6
|
-
Type=forking
|
|
7
|
-
StandardOutput=syslog
|
|
8
|
-
StandardError=syslog
|
|
9
|
-
ExecStart=/usr/sbin/mcollectived --config=/etc/mcollective/server.cfg --pidfile=/var/run/mcollective.pid
|
|
10
|
-
ExecReload=/bin/kill -USR1 $MAINPID
|
|
11
|
-
PIDFile=/var/run/mcollective.pid
|
|
12
|
-
|
|
13
|
-
[Install]
|
|
14
|
-
WantedBy=multi-user.target
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
topicprefix = /topic/
|
|
2
|
-
main_collective = mcollective
|
|
3
|
-
collectives = mcollective
|
|
4
|
-
libdir = /usr/share/mcollective/plugins
|
|
5
|
-
logfile = /var/log/mcollective.log
|
|
6
|
-
loglevel = debug
|
|
7
|
-
max_log_size = 2097152
|
|
8
|
-
daemonize = 1
|
|
9
|
-
|
|
10
|
-
# Plugins
|
|
11
|
-
securityprovider = sshkey
|
|
12
|
-
plugin.sshkey.server.send_key = /etc/mcollective/ssh/mcollective.pub
|
|
13
|
-
plugin.sshkey.server.private_key = /etc/mcollective/ssh/mcollective
|
|
14
|
-
plugin.sshkey.server.authorized_keys = /etc/mcollective/ssh/authorized_keys
|
|
15
|
-
|
|
16
|
-
connector = stomp
|
|
17
|
-
plugin.stomp.port = 6163
|
|
18
|
-
plugin.stomp.user = mcollective
|
|
19
|
-
plugin.stomp.password = marionette
|
|
20
|
-
|
|
21
|
-
# Facts
|
|
22
|
-
factsource = pbuilder
|