Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # encoding: UTF-8
- # -*- coding: utf-8 -*-
- ---
- - name: "Experiment with structured task result registrations"
- hosts: 127.0.0.1
- tasks:
- - name: "Create the results variable"
- set_fact:
- results: {}
- - name: "Generate a first result"
- delegate_to: 127.0.0.1
- command: "echo 'First!'"
- register: task_result
- - name: "Load the first result"
- delegate_to: 127.0.0.1
- set_fact:
- results: "{{ results|combine({'first':task_result}) }}"
- - name: "Report results after first task"
- delegate_to: 127.0.0.1
- debug:
- var: results
- - name: "Generate a second result"
- delegate_to: 127.0.0.1
- command: "echo 'Second!'"
- register: task_result
- - name: "Load the second result"
- delegate_to: 127.0.0.1
- set_fact:
- results: "{{ results|combine({'second':task_result}) }}"
- - name: "Report results after combining in individual task results manually"
- delegate_to: 127.0.0.1
- debug:
- var: results
- # Local Variables:
- # mode: YAML
- # yaml-indent-offset: 2
- # indent-tabs-mode: nil
- # End:
- # vim:sw=2:ts=2:expandtab:textwidth=79:autoindent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement