| 1 |
Follow up from 2013-01-20: |
| 2 |
|
| 3 |
- (re-)create message file per object? |
| 4 |
- yes, but do not necessarily save in object space |
| 5 |
- save $anywhere |
| 6 |
|
| 7 |
- object_run |
| 8 |
- current notifications are imported into a file available at $__messages_in |
| 9 |
- after object run, everything that has been written to $__messages_out is merged into the $__messages file |
| 10 |
|
| 11 |
- functions: |
| 12 |
self.explorer.run_global_explorers(self.local.global_explorer_out_path) |
| 13 |
self.manifest.run_initial_manifest(self.local.initial_manifest) |
| 14 |
self.local.run_script(initial_manifest, env=self.env_initial_manifest(initial_manifest)) |
| 15 |
self.explorer.run_type_explorers(cdist_object) |
| 16 |
self.manifest.run_type_manifest(cdist_object) |
| 17 |
self.local.run_script(type_manifest, env=self.env_type_manifest(cdist_object)) |
| 18 |
self.code.run_gencode_local(cdist_object) |
| 19 |
self.local.run_script(script, env=env, return_output=True) |
| 20 |
self.code.run_gencode_remote(cdist_object) |
| 21 |
self.local.run_script(script, env=env, return_output=True) |
| 22 |
|
| 23 |
|
| 24 |
- message support in ... |
| 25 |
- initialmanifest - yes |
| 26 |
- explorer - no |
| 27 |
- only locally - yes |
| 28 |
|
| 29 |
- how to use notification / messaging in cdist |
| 30 |
- can be used in all local scripts: |
| 31 |
- initial manifest |
| 32 |
- type manifest |
| 33 |
- type gencode-* |
| 34 |
- order of object exeution is random or as you requested using require="" |
| 35 |
|
| 36 |
- example use: |
| 37 |
|
| 38 |
__file/gencode-local: |
| 39 |
if [ "$local_cksum" != "$remote_cksum" ]; then |
| 40 |
echo "$__remote_copy" "$source" "${__target_host}:${destination}" |
| 41 |
echo "copy" >> "$__messages_out" |
| 42 |
fi |
| 43 |
|
| 44 |
__nginx/manifest: |
| 45 |
__file /etc/nginx/sites-enabled/myfile --source "$__type/files/nginx-config" |
| 46 |
|
| 47 |
__nginx/gencode-remote: |
| 48 |
if grep -q "__file/etc/nginx/sites-enabled/myfile:copy" "$__messages_in"; then |
| 49 |
echo /etc/init.d/nginx restart |
| 50 |
fi |