dapp 0.32.10 → 0.33.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/bin/dapp +1 -23
  3. data/config/en/net_status.yml +7 -0
  4. data/lib/dapp.rb +3 -3
  5. data/lib/dapp/dapp.rb +13 -0
  6. data/lib/dapp/dapp/dappfile.rb +2 -2
  7. data/lib/dapp/dapp/deps/base.rb +5 -37
  8. data/lib/dapp/dapp/deps/common.rb +25 -0
  9. data/lib/dapp/dapp/deps/gitartifact.rb +2 -25
  10. data/lib/dapp/dapp/deps/toolchain.rb +1 -23
  11. data/lib/dapp/dapp/logging/base.rb +3 -3
  12. data/lib/dapp/dapp/ruby2go.rb +96 -0
  13. data/lib/dapp/dapp/sentry.rb +0 -1
  14. data/lib/dapp/dapp/shellout/base.rb +4 -2
  15. data/lib/dapp/dimg/build/stage/artifact_base.rb +7 -6
  16. data/lib/dapp/dimg/build/stage/base.rb +37 -7
  17. data/lib/dapp/dimg/build/stage/from.rb +1 -1
  18. data/lib/dapp/dimg/builder/ansible.rb +1 -209
  19. data/lib/dapp/dimg/builder/base.rb +0 -5
  20. data/lib/dapp/dimg/builder/none.rb +1 -34
  21. data/lib/dapp/dimg/builder/ruby2go.rb +51 -0
  22. data/lib/dapp/dimg/builder/shell.rb +1 -25
  23. data/lib/dapp/dimg/cli/command/dimg/bp.rb +10 -15
  24. data/lib/dapp/dimg/cli/command/dimg/build.rb +0 -5
  25. data/lib/dapp/dimg/config/directive/docker/base.rb +1 -1
  26. data/lib/dapp/dimg/dapp/command/build_context/export.rb +1 -1
  27. data/lib/dapp/dimg/dapp/command/build_context/import.rb +1 -1
  28. data/lib/dapp/dimg/dapp/command/cleanup_repo.rb +59 -90
  29. data/lib/dapp/dimg/dapp/command/common.rb +60 -74
  30. data/lib/dapp/dimg/dapp/command/mrproper.rb +2 -17
  31. data/lib/dapp/dimg/dapp/command/stages/cleanup_local.rb +9 -6
  32. data/lib/dapp/dimg/dimg.rb +26 -43
  33. data/lib/dapp/dimg/docker_registry/base/authorization.rb +1 -16
  34. data/lib/dapp/dimg/git_artifact.rb +142 -21
  35. data/lib/dapp/dimg/git_repo/base.rb +11 -0
  36. data/lib/dapp/dimg/git_repo/local.rb +14 -0
  37. data/lib/dapp/dimg/git_repo/remote.rb +25 -34
  38. data/lib/dapp/dimg/image/argument.rb +12 -58
  39. data/lib/dapp/dimg/image/stage.rb +202 -43
  40. data/lib/dapp/kube/kubernetes/client.rb +0 -6
  41. data/lib/dapp/kube/kubernetes/manager/deployment.rb +18 -30
  42. data/lib/dapp/version.rb +1 -1
  43. metadata +8 -8
  44. data/lib/dapp/dimg/builder/ansible/assets.rb +0 -349
  45. data/lib/dapp/dimg/exception/introspect_image.rb +0 -7
  46. data/lib/dapp/dimg/image/docker.rb +0 -144
@@ -35,12 +35,6 @@ module Dapp
35
35
  '/apis/batch/v1' => [:job, ],
36
36
  '/apis/batch/v1beta1' => [:cronjob, ],
37
37
  },
38
- '1.11' => {
39
- '/api/v1' => [:service, :replicationcontroller, :pod, :podtemplate, ],
40
- '/apis/apps/v1' => [:daemonset, :deployment, :replicaset, :statefulset, ],
41
- '/apis/batch/v1' => [:job, ],
42
- '/apis/batch/v1beta1' => [:cronjob, ],
43
- },
44
38
  'stable' => {
45
39
  '/api/v1' => [:service, :replicationcontroller, :pod, :podtemplate, ],
46
40
  '/apis/batch/v1' => [:job, ],
@@ -50,11 +50,12 @@ module Dapp
50
50
 
51
51
  dapp.log_step("[#{Time.now}] Poll deployment '#{d.name}' status")
52
52
  dapp.with_log_indent do
53
- dapp.log_info("Replicas: #{_field_value_for_log(d.status['replicas'])}")
54
- dapp.log_info("Updated replicas: #{_field_value_for_log(d.status['updatedReplicas'])}")
55
- dapp.log_info("Available replicas: #{_field_value_for_log(d.status['availableReplicas'])}")
56
- dapp.log_info("Unavailable replicas: #{_field_value_for_log(d.status['unavailableReplicas'])}")
53
+ dapp.log_info("Target replicas: #{_field_value_for_log(d.replicas)}")
54
+ dapp.log_info("Updated replicas: #{_field_value_for_log(d.status['updatedReplicas'])} / #{_field_value_for_log(d.replicas)}")
55
+ dapp.log_info("Available replicas: #{_field_value_for_log(d.status['availableReplicas'])} / #{_field_value_for_log(d.replicas)}")
57
56
  dapp.log_info("Ready replicas: #{_field_value_for_log(d.status['readyReplicas'])} / #{_field_value_for_log(d.replicas)}")
57
+ dapp.log_info("Old deployment.kubernetes.io/revision: #{_field_value_for_log(@revision_before_deploy)}")
58
+ dapp.log_info("Current deployment.kubernetes.io/revision: #{_field_value_for_log(d_revision)}")
58
59
  end
59
60
 
60
61
  rs = nil
@@ -83,16 +84,6 @@ module Dapp
83
84
  end
84
85
 
85
86
  if rs
86
- dapp.with_log_indent do
87
- dapp.log_step("Current ReplicaSet '#{rs.name}' status")
88
- dapp.with_log_indent do
89
- dapp.log_info("Replicas: #{_field_value_for_log(rs.status['replicas'])}")
90
- dapp.log_info("Fully labeled replicas: #{_field_value_for_log(rs.status['fullyLabeledReplicas'])}")
91
- dapp.log_info("Available replicas: #{_field_value_for_log(rs.status['availableReplicas'])}")
92
- dapp.log_info("Ready replicas: #{_field_value_for_log(rs.status['readyReplicas'])} / #{_field_value_for_log(d.replicas)}")
93
- end
94
- end
95
-
96
87
  # Pod'ы связанные с активным ReplicaSet
97
88
  rs_pods = dapp.kubernetes.pod_list['items']
98
89
  .map {|spec| Kubernetes::Client::Resource::Pod.new(spec)}
@@ -177,14 +168,19 @@ module Dapp
177
168
  end # with_log_indent
178
169
  end
179
170
 
180
- # break only when rs is not nil
181
-
182
- if d_revision && d.replicas && d.replicas == 0
183
- break
184
- end
185
-
186
- if d_revision && d.replicas && rs
187
- break if is_deployment_ready(d) && is_replicaset_ready(d, rs)
171
+ if d_revision && d.replicas
172
+ if d.replicas == 0
173
+ break
174
+ else
175
+ break if begin
176
+ d.status['updatedReplicas'] &&
177
+ d.status['availableReplicas'] &&
178
+ d.status['readyReplicas'] &&
179
+ (d.status['updatedReplicas'] >= d.replicas) &&
180
+ (d.status['availableReplicas'] >= d.replicas) &&
181
+ (d.status['readyReplicas'] >= d.replicas)
182
+ end
183
+ end
188
184
  end
189
185
 
190
186
  sleep 5
@@ -193,14 +189,6 @@ module Dapp
193
189
  end
194
190
  end
195
191
 
196
- def is_deployment_ready(d)
197
- d.status.key?("readyReplicas") && d.status["readyReplicas"] >= d.replicas
198
- end
199
-
200
- def is_replicaset_ready(d, rs)
201
- rs.status.key?("readyReplicas") && rs.status["readyReplicas"] >= d.replicas
202
- end
203
-
204
192
  private
205
193
 
206
194
  def _field_value_for_log(value)
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = "0.32.10"
2
+ VERSION = "0.33.0"
3
3
  BUILD_CACHE_VERSION = 31
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.10
4
+ version: 0.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2018-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -234,14 +234,14 @@ dependencies:
234
234
  requirements:
235
235
  - - "~>"
236
236
  - !ruby/object:Gem::Version
237
- version: '2.0'
237
+ version: '1.7'
238
238
  type: :development
239
239
  prerelease: false
240
240
  version_requirements: !ruby/object:Gem::Requirement
241
241
  requirements:
242
242
  - - "~>"
243
243
  - !ruby/object:Gem::Version
244
- version: '2.0'
244
+ version: '1.7'
245
245
  - !ruby/object:Gem::Dependency
246
246
  name: rake
247
247
  requirement: !ruby/object:Gem::Requirement
@@ -489,6 +489,7 @@ files:
489
489
  - lib/dapp/dapp/dapp_config.rb
490
490
  - lib/dapp/dapp/dappfile.rb
491
491
  - lib/dapp/dapp/deps/base.rb
492
+ - lib/dapp/dapp/deps/common.rb
492
493
  - lib/dapp/dapp/deps/gitartifact.rb
493
494
  - lib/dapp/dapp/deps/toolchain.rb
494
495
  - lib/dapp/dapp/git_artifact.rb
@@ -498,6 +499,7 @@ files:
498
499
  - lib/dapp/dapp/logging/paint.rb
499
500
  - lib/dapp/dapp/logging/process.rb
500
501
  - lib/dapp/dapp/option_tags.rb
502
+ - lib/dapp/dapp/ruby2go.rb
501
503
  - lib/dapp/dapp/sentry.rb
502
504
  - lib/dapp/dapp/shellout/base.rb
503
505
  - lib/dapp/dapp/shellout/streaming.rb
@@ -535,13 +537,13 @@ files:
535
537
  - lib/dapp/dimg/build/stage/setup/setup.rb
536
538
  - lib/dapp/dimg/builder.rb
537
539
  - lib/dapp/dimg/builder/ansible.rb
538
- - lib/dapp/dimg/builder/ansible/assets.rb
539
540
  - lib/dapp/dimg/builder/base.rb
540
541
  - lib/dapp/dimg/builder/chef.rb
541
542
  - lib/dapp/dimg/builder/chef/berksfile.rb
542
543
  - lib/dapp/dimg/builder/chef/cookbook.rb
543
544
  - lib/dapp/dimg/builder/chef/cookbook_metadata.rb
544
545
  - lib/dapp/dimg/builder/none.rb
546
+ - lib/dapp/dimg/builder/ruby2go.rb
545
547
  - lib/dapp/dimg/builder/shell.rb
546
548
  - lib/dapp/dimg/cli/cli.rb
547
549
  - lib/dapp/dimg/cli/command/base.rb
@@ -639,7 +641,6 @@ files:
639
641
  - lib/dapp/dimg/error/rugged.rb
640
642
  - lib/dapp/dimg/error/tar_writer.rb
641
643
  - lib/dapp/dimg/exception/base.rb
642
- - lib/dapp/dimg/exception/introspect_image.rb
643
644
  - lib/dapp/dimg/exception/registry.rb
644
645
  - lib/dapp/dimg/filelock.rb
645
646
  - lib/dapp/dimg/git_artifact.rb
@@ -649,7 +650,6 @@ files:
649
650
  - lib/dapp/dimg/git_repo/remote.rb
650
651
  - lib/dapp/dimg/image/argument.rb
651
652
  - lib/dapp/dimg/image/dimg.rb
652
- - lib/dapp/dimg/image/docker.rb
653
653
  - lib/dapp/dimg/image/scratch.rb
654
654
  - lib/dapp/dimg/image/stage.rb
655
655
  - lib/dapp/dimg/lock/base.rb
@@ -744,7 +744,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
744
744
  version: 2.5.0
745
745
  requirements: []
746
746
  rubyforge_project:
747
- rubygems_version: 2.7.6
747
+ rubygems_version: 2.7.7
748
748
  signing_key:
749
749
  specification_version: 4
750
750
  summary: Build docker packaged apps using chef or shell
@@ -1,349 +0,0 @@
1
- module Dapp
2
- module Dimg
3
- class Builder::Ansible::Assets
4
- class << self
5
- def ansible_cfg(inventory, callback_plugins, become_exe, local_tmp, remote_tmp)
6
- %{
7
- [defaults]
8
- inventory = #{inventory}
9
- transport = local
10
- ; do not generate retry files in ro volumes
11
- retry_files_enabled = False
12
- ; more verbose stdout like ad-hoc ansible command from flant/ansible fork
13
- callback_plugins = #{callback_plugins}
14
- stdout_callback = dapp
15
- ; force color
16
- force_color = 1
17
- module_compression = 'ZIP_STORED'
18
- local_tmp = #{local_tmp}
19
- remote_tmp = #{remote_tmp}
20
- ; keep ansiballz for debug
21
- ;keep_remote_files = 1
22
- [privilege_escalation]
23
- become = yes
24
- become_method = sudo
25
- become_exe = #{become_exe}
26
- become_flags = -E -H
27
- }
28
- end
29
-
30
- def hosts(python_path)
31
- %{
32
- localhost ansible_raw_live_stdout=yes ansible_script_live_stdout=yes ansible_python_interpreter=#{python_path}
33
- }
34
- end
35
-
36
- # Python script! Do not enable string interpolation!
37
- def dapp_py
38
- %q{
39
- # (c) 2018, Ivan Mikheykin <ivan.mikheykin@flant.com>
40
- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
41
-
42
- # Make coding more python3-ish
43
- from __future__ import (absolute_import, division, print_function)
44
- __metaclass__ = type
45
-
46
-
47
- DOCUMENTATION = '''
48
- callback: dapp
49
- type: stdout
50
- short_description: live output for raw and script with dapp specific additions
51
- version_added: "2.4"
52
- description:
53
- - Solo mode with live stdout for raw and script tasks
54
- - Dapp specific error messages
55
- requirements:
56
- - set as stdout callback in configuration
57
- '''
58
-
59
- #from ansible.plugins.callback.live import CallbackModule as CallbackModule_live
60
- # live.py moved to dapp
61
- from callback.live import CallbackModule as CallbackModule_live
62
- from ansible import constants as C
63
-
64
- import os
65
- import json
66
-
67
- class CallbackModule(CallbackModule_live):
68
-
69
- CALLBACK_VERSION = 2.0
70
- CALLBACK_TYPE = 'stdout'
71
- CALLBACK_NAME = 'dapp'
72
-
73
- def __init__(self):
74
- self.super_ref = super(CallbackModule, self)
75
- self.super_ref.__init__()
76
-
77
- def v2_runner_on_failed(self, result, ignore_errors=False):
78
- self.super_ref.v2_runner_on_failed(result, ignore_errors)
79
-
80
- # get config sections from dapp
81
- # task config text is in a last tag
82
- # doctext is in a file DAPP_DUMP_CONFIG_DOC_PATH
83
- self._display_dapp_config(result._task)
84
-
85
- def _read_dump_config_doc(self):
86
- # read content from file in DAPP_DUMP_CONFIG_DOC_PATH env
87
- if 'DAPP_DUMP_CONFIG_DOC_PATH' not in os.environ:
88
- return ''
89
- dump_path = os.environ['DAPP_DUMP_CONFIG_DOC_PATH']
90
- res = ''
91
- try:
92
- fh = open(dump_path, 'r')
93
- res = json.load(fh) #.read()
94
- fh.close()
95
- except:
96
- pass
97
-
98
- return res
99
-
100
- # dapp_stage_name commented for consistency with dappfile-yml behaviour
101
- def _display_dapp_config(self, task):
102
- tags = task.tags
103
- dump_config_section_key = ''
104
- #dapp_stage_name = ''
105
- if len(tags) > 0:
106
- # stage name appended before dump
107
- #dapp_stage_name = tags[-2]
108
- # last tag is dump of section
109
- dump_config_section_key = tags[-1]
110
-
111
- dump_config = self._read_dump_config_doc()
112
- dump_config_doc = dump_config['dump_config_doc']
113
- dump_config_section = dump_config['dump_config_sections'][dump_config_section_key]
114
- self._display.display("\n\n%s\n%s" % (dump_config_section, dump_config_doc), color=C.COLOR_DEBUG)
115
-
116
- }
117
- end
118
-
119
- def crypt_py
120
- %q{
121
- def crypt(word, salt):
122
- return "FAKE_CRYPT"
123
- }
124
- end
125
-
126
- def live_py
127
- %{
128
- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
129
- # (c) 2017 Ansible Project
130
- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
131
-
132
- # Make coding more python3-ish
133
- from __future__ import (absolute_import, division, print_function)
134
- __metaclass__ = type
135
-
136
- DOCUMENTATION = '''
137
- callback: live
138
- type: stdout
139
- short_description: screen output for solo mode
140
- version_added: historical
141
- description:
142
- - Solo mode with live stdout for raw and script tasks with fallback to minimal
143
- '''
144
-
145
- from ansible.plugins.callback import CallbackBase
146
- from ansible import constants as C
147
- from ansible.vars.manager import strip_internal_keys
148
-
149
- import json, re
150
-
151
-
152
- class CallbackModule(CallbackBase):
153
-
154
- '''
155
- This is the default callback interface, which simply prints messages
156
- to stdout when new callback events are received.
157
- '''
158
-
159
- CALLBACK_VERSION = 2.0
160
- CALLBACK_TYPE = 'stdout'
161
- CALLBACK_NAME = 'live'
162
-
163
- # name for this tasks can be generated from free_form
164
- FREE_FORM_MODULES = ('raw', 'script', 'command', 'shell')
165
- #ERROR! this task 'debug' has extra params, which is only allowed in the following modules: command, win_command, shell, win_shell, script, include, include_vars, include_tasks, include_role, import_tasks, import_role, add_host, group_by, set_fact, raw, meta
166
-
167
- def __init__(self):
168
- super(CallbackModule, self).__init__()
169
- self._play = None
170
-
171
- def _task_header(self, task, msg):
172
- name = task.name
173
- if not name:
174
- if task.action in self.FREE_FORM_MODULES:
175
- name = task.args.get('_raw_params', '')
176
- if task.action == 'file':
177
- name = task.args.get('path')
178
- if task.action == 'copy':
179
- name = task.args.get('dest')
180
- if task.action == 'group':
181
- name = task.args.get('name')
182
- if task.action == 'user':
183
- name = task.args.get('name')
184
- if task.action == 'get_url':
185
- name = task.args.get('url')
186
- if task.action == 'getent':
187
- db = task.args.get('database')
188
- key = task.args.get('key')
189
- name = '%s %s' % (db, key)
190
- if task.action == 'apt':
191
- name = task.args.get('name')
192
- if task.action == 'composer':
193
- name = task.args.get('command', 'install')
194
- name = re.sub(r'\s+', r' ', name)
195
- if len(name) > 25 :
196
- name = '%s...' % name[0:22]
197
- return u'%s [%s] %s' % (task.action, name, msg)
198
-
199
- def _display_command_generic_msg(self, task, result, caption, color):
200
- ''' output the result of a command run '''
201
-
202
- self._display.display("%s | rc=%s >>" % (self._task_header(task, caption), result.get('rc', -1)), color)
203
- msg = result.get('msg')
204
- if msg:
205
- self._display.display(msg, color)
206
- # prevent dublication in case of live_stdout
207
- if not result.get('live_stdout', False):
208
- stdout = result.get('stdout', None)
209
- if stdout:
210
- self._display.display("stdout was:", color=C.COLOR_HIGHLIGHT)
211
- self._display.display(stdout)
212
- stderr = result.get('stderr', '')
213
- if stderr:
214
- self._display.display("stderr was:", color=C.COLOR_HIGHLIGHT)
215
- self._display.display(stderr, color=C.COLOR_ERROR)
216
-
217
-
218
- def _display_debug_msg(self, task, result):
219
- color = C.COLOR_OK
220
- if task.args.get('msg'):
221
- self._display.display("debug msg", color=C.COLOR_HIGHLIGHT)
222
- self._display.display(result.get('msg', ''), color)
223
- if task.args.get('var'):
224
- self._display.display("debug var \'%s\'" % task.args.get('var'), color=C.COLOR_HIGHLIGHT)
225
- var_obj = result.get(task.args.get('var'), '')
226
- if isinstance(var_obj, str):
227
- if 'IS NOT DEFINED' in var_obj:
228
- color = C.COLOR_ERROR
229
- path = task.get_path()
230
- if path:
231
- self._display.display(u"task path: %s" % path, color=C.COLOR_DEBUG)
232
- self._display.display(var_obj, color)
233
- else:
234
- self._display.display(json.dumps(var_obj, indent=4), color)
235
-
236
- # TODO remove stdout here if live_stdout!
237
- # TODO handle results for looped tasks
238
- def _dump_results(self, result, indent=None, sort_keys=True, keep_invocation=False):
239
-
240
- if not indent and (result.get('_ansible_verbose_always') or self._display.verbosity > 2):
241
- indent = 4
242
-
243
- # All result keys stating with _ansible_ are internal, so remove them from the result before we output anything.
244
- abridged_result = strip_internal_keys(result)
245
-
246
- # remove invocation unless specifically wanting it
247
- if not keep_invocation and self._display.verbosity < 3 and 'invocation' in result:
248
- del abridged_result['invocation']
249
-
250
- # remove diff information from screen output
251
- if self._display.verbosity < 3 and 'diff' in result:
252
- del abridged_result['diff']
253
-
254
- # remove exception from screen output
255
- if 'exception' in abridged_result:
256
- del abridged_result['exception']
257
-
258
- # remove msg, failed, changed
259
- if 'msg' in abridged_result:
260
- del abridged_result['msg']
261
- if 'failed' in abridged_result:
262
- del abridged_result['failed']
263
- if 'changed' in abridged_result:
264
- del abridged_result['changed']
265
-
266
- if len(abridged_result) > 0:
267
- return json.dumps(abridged_result, indent=indent, ensure_ascii=False, sort_keys=sort_keys)
268
-
269
- return ''
270
-
271
- def v2_playbook_on_play_start(self, play):
272
- self._play = play
273
-
274
- # command [copy artifacts] started
275
- # stdout
276
- # ...
277
- # command [copy artifacts] OK/FAILED/CHANGED
278
- # STDERR: if failed
279
- # ...
280
- #
281
- def v2_playbook_on_task_start(self, task, is_conditional):
282
- self._display.v("TASK action=%s args=%s" % (task.action, json.dumps(task.args, indent=4)))
283
-
284
- if task.action == 'debug':
285
- return
286
-
287
- if self._play.strategy != 'free':
288
- self._display.display(self._task_header(task, "started"), color=C.COLOR_HIGHLIGHT)
289
-
290
- def v2_runner_on_ok(self, result):
291
- self._display.v("TASK action=%s OK => %s" % (result._task.action, json.dumps(result._result, indent=4)))
292
-
293
- self._clean_results(result._result, result._task.action)
294
- self._handle_warnings(result._result)
295
-
296
- task = result._task
297
-
298
- if task.action == 'debug':
299
- self._display_debug_msg(result._task, result._result)
300
- elif task.action in self.FREE_FORM_MODULES:
301
- self._display_command_generic_msg(result._task, result._result, "SUCCESS", C.COLOR_OK)
302
- else:
303
- if 'changed' in result._result and result._result['changed']:
304
- self._display.display("%s => %s" % (self._task_header(result._task, "SUCCESS"), self._dump_results(result._result, indent=4)), color=C.COLOR_CHANGED)
305
- #self._display.display(self._task_header(task, "OK")"%s | SUCCESS => %s" % (result._host.get_name(), self._dump_results(result._result, indent=4)), color=C.COLOR_CHANGED)
306
- #self._display.display("%s | SUCCESS => %s" % (result._host.get_name(), ), color=C.COLOR_CHANGED)
307
- else:
308
- self._display.display("%s => %s" % (self._task_header(result._task, "SUCCESS"), self._dump_results(result._result, indent=4)), color=C.COLOR_OK)
309
- #self._display.display("%s | SUCCESS => %s" % (result._host.get_name(), self._dump_results(result._result, indent=4)), color=C.COLOR_OK)
310
-
311
- def v2_runner_on_failed(self, result, ignore_errors=False):
312
- self._display.v("TASK action=%s FAILED => %s" % (result._task.action, json.dumps(result._result, indent=4)))
313
-
314
- self._handle_exception(result._result)
315
- self._handle_warnings(result._result)
316
-
317
- task = result._task
318
-
319
- if task.action in self.FREE_FORM_MODULES:
320
- self._display_command_generic_msg(result._task, result._result, "FAILED", C.COLOR_ERROR)
321
- #elif result._task.action in C.MODULE_NO_JSON and 'module_stderr' not in result._result:
322
- # self._display.display(self._command_generic_msg(result._host.get_name(), result._result, "FAILED"), color=C.COLOR_ERROR)
323
- else:
324
- self._display.display(self._task_header(result._task, "FAILED"), color=C.COLOR_ERROR)
325
- if 'msg' in result._result:
326
- self._display.display(result._result['msg'], color=C.COLOR_ERROR)
327
- # clean system values from result and return a json
328
- dump_result = self._dump_results(result._result, indent=4)
329
- if dump_result:
330
- self._display.display("Task result => %s" % (self._dump_results(result._result, indent=4)), color=C.COLOR_ERROR)
331
-
332
-
333
- def v2_runner_on_skipped(self, result):
334
- self._display.display("%s | SKIPPED" % (result._host.get_name()), color=C.COLOR_SKIP)
335
-
336
- def v2_runner_on_unreachable(self, result):
337
- self._display.display("%s | UNREACHABLE! => %s" % (result._host.get_name(), self._dump_results(result._result, indent=4)), color=C.COLOR_UNREACHABLE)
338
-
339
- def v2_on_file_diff(self, result):
340
- if 'diff' in result._result and result._result['diff']:
341
- self._display.display(self._get_diff(result._result['diff']))
342
-
343
- }
344
- end
345
-
346
- end # << self
347
- end # Builder::Ansible::Assets
348
- end # Dimg
349
- end # Dapp