github.com/mmatczuk/gohan@v0.0.0-20170206152520-30e45d9bdb69/extension/gohanscript/examples/sample1.yaml (about)

     1  vars:
     2    world: "USA"
     3    foods:
     4    - apple
     5    - orange
     6    - banana
     7    pref:
     8      Alice: apple
     9      Bob: orange
    10  tasks:
    11  - debugger:
    12  - debug: test
    13    name: debug_test
    14  - http_get: url=https://status.github.com/api/status.json
    15    register: result
    16  - debug: msg="result {{result.status_code}}"
    17  - debug: msg="test"
    18  - debug: var="foods[2]"
    19  - debug: msg="Hello \" {{ world }}"
    20  - define:
    21      name: test_func
    22      args:
    23        arg1: string
    24      body:
    25      - debug: msg="arg1={{ arg1 }}"
    26  - blocks:
    27    - debug: msg="I like {{ item }}"
    28      with_items:
    29      - apple
    30      - orange
    31      - banana
    32    - debug: msg="I like {{ item }}"
    33      with_items: $foods
    34    - debug: msg="{{ item.key }} likes {{ item.value }}"
    35      with_dict:
    36        Alice: apple
    37        Bob: orange
    38    - debug: msg="{{ item.key }} likes {{ item.value }}"
    39      with_dict: $pref
    40    - test_func: arg1="called defined func"
    41    - debug: msg="This shouldn't be called"
    42      when: 1 == 0
    43      else:
    44      - debug: msg="This should be called"
    45    - fail: msg="failed"
    46      when: 1 == 1
    47    rescue:
    48    - debug: msg="rescued {{ error }}"
    49    always:
    50    - debug: msg="Drink beer!"
    51  - debug: msg="test {{ 1 == 1 }}"
    52  - include: lib.yaml