foreman-tasks 0.7.19 → 0.7.20
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 +4 -4
- data/README.md +3 -1
- data/app/helpers/foreman_tasks/tasks_helper.rb +1 -0
- data/app/models/foreman_tasks/task/dynflow_task.rb +6 -0
- data/extra/dynflow-executor.example +77 -0
- data/lib/foreman_tasks/tasks/export_tasks.rake +1 -1
- data/lib/foreman_tasks/version.rb +1 -1
- data/test/helpers/foreman_tasks/tasks_helper_test.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d050fd7d55d78ed330c5da74b31f7a340f652d85
|
4
|
+
data.tar.gz: 35e4c705611f00c5323dcdcca943d41a71dc988a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 962203d2e16abf60f2b3b491bc3e14a1c229241609ff0701b3a736058d4bcd257ec2ec0174ffabdd938e7e1da60264ae118fc399ebd1d1f550d1d28142db0265
|
7
|
+
data.tar.gz: 612fa5a8838f36dd8b5cb4ad2321791ecf450d6bc5c6872092ad730f94a8da36ff660b3644887377307cebe0b070e9dc267d32e2562f933651c0816a71e84d3c
|
data/README.md
CHANGED
@@ -32,7 +32,9 @@ Add the following to bundler.d/Gemfile.local.rb in your Foreman installation dir
|
|
32
32
|
|
33
33
|
$ gem 'foreman-tasks'
|
34
34
|
|
35
|
-
Then run `bundle install` and `foreman-rake db:migrate` from the same directory
|
35
|
+
Then run `bundle install` and `foreman-rake db:migrate` from the same directory. Note that you must start the
|
36
|
+
dynflow executor (background processor) manually. You can find example service script in
|
37
|
+
extra/dynflow-executor.example in this repository.
|
36
38
|
|
37
39
|
--------------
|
38
40
|
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# Author: Riley Shott
|
2
|
+
# https://gist.github.com/Ginja/fb123759d48b04b5f338
|
3
|
+
# dynflow-executor - starts or stops the Dynflow executor for Foreman tasks
|
4
|
+
#
|
5
|
+
# chkconfig: 345 99 20
|
6
|
+
# description: dynflow-executor is a rake task that comes with \
|
7
|
+
# the foreman-tasks gem
|
8
|
+
# processname: dynflow-executor
|
9
|
+
# pidfile: /usr/local/foreman/tmp/pids/dynflow_executor_monitor.pid
|
10
|
+
# pidfile: /usr/local/foreman/tmp/pids/dynflow_executor.pid
|
11
|
+
|
12
|
+
# Source function library.
|
13
|
+
. /etc/rc.d/init.d/functions
|
14
|
+
|
15
|
+
foreman_user='foreman'
|
16
|
+
rvm='/usr/local/.rvm/bin/rvm'
|
17
|
+
gemset='ruby-2.1.5@foreman-1.9.1'
|
18
|
+
foreman_app_path='/usr/local/foreman'
|
19
|
+
dynflow_executor="$(cd $foreman_app_path && $rvm $gemset do bundle show foreman-tasks)/bin/dynflow-executor"
|
20
|
+
rvm_do_dynflow="RAILS_ENV=production ${rvm} ${gemset} do ${dynflow_executor}"
|
21
|
+
prog=$(basename $dynflow_executor)
|
22
|
+
|
23
|
+
[ -f /etc/sysconfig/dynflow-executor ] && . /etc/sysconfig/dynflow-executor
|
24
|
+
|
25
|
+
start() {
|
26
|
+
[ -x $dynflow_executor ] || exit 5
|
27
|
+
echo -n $"Starting $prog: "
|
28
|
+
su - $foreman_user -c "cd ${foreman_app_path} && ${rvm_do_dynflow} start"
|
29
|
+
RETVAL=$?
|
30
|
+
if [ $RETVAL -eq 0 ]
|
31
|
+
then success
|
32
|
+
else failure
|
33
|
+
fi
|
34
|
+
echo
|
35
|
+
return $RETVAL
|
36
|
+
}
|
37
|
+
|
38
|
+
stop() {
|
39
|
+
echo -n $"Stopping $prog: "
|
40
|
+
cd "${foreman_app_path}"
|
41
|
+
su - $foreman_user -c "cd ${foreman_app_path} && ${rvm_do_dynflow} stop"
|
42
|
+
RETVAL=$?
|
43
|
+
if [ $RETVAL -eq 0 ]
|
44
|
+
then success
|
45
|
+
else failure
|
46
|
+
fi
|
47
|
+
echo
|
48
|
+
return $RETVAL
|
49
|
+
}
|
50
|
+
|
51
|
+
status() {
|
52
|
+
pgrep -f -u $foreman_user dynflow_executor -l
|
53
|
+
}
|
54
|
+
|
55
|
+
restart() {
|
56
|
+
stop
|
57
|
+
sleep 2
|
58
|
+
start
|
59
|
+
}
|
60
|
+
|
61
|
+
case "$1" in
|
62
|
+
start)
|
63
|
+
$1
|
64
|
+
;;
|
65
|
+
stop)
|
66
|
+
$1
|
67
|
+
;;
|
68
|
+
status)
|
69
|
+
$1
|
70
|
+
;;
|
71
|
+
restart)
|
72
|
+
$1
|
73
|
+
;;
|
74
|
+
*)
|
75
|
+
echo $"Usage: $0 {start|stop|status|restart}"
|
76
|
+
exit 2
|
77
|
+
esac
|
@@ -15,6 +15,9 @@ module ForemanTasks
|
|
15
15
|
format_task_input(@task, true).must_equal("Create user 'Anonymous Admin'")
|
16
16
|
end
|
17
17
|
|
18
|
+
it 'displays the dash if task is nil' do
|
19
|
+
format_task_input(nil, true).must_equal('-')
|
20
|
+
end
|
18
21
|
end
|
19
22
|
|
20
23
|
describe 'when formatting input' do
|
@@ -37,5 +40,7 @@ module ForemanTasks
|
|
37
40
|
format_task_input(@task, true).must_equal("Create #{response}")
|
38
41
|
end
|
39
42
|
end
|
43
|
+
|
44
|
+
end
|
40
45
|
end
|
41
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynflow
|
@@ -185,6 +185,7 @@ files:
|
|
185
185
|
- deploy/foreman-tasks.init
|
186
186
|
- deploy/foreman-tasks.service
|
187
187
|
- deploy/foreman-tasks.sysconfig
|
188
|
+
- extra/dynflow-executor.example
|
188
189
|
- foreman-tasks.gemspec
|
189
190
|
- lib/foreman-tasks.rb
|
190
191
|
- lib/foreman_tasks.rb
|