1. 18 Nov, 2012 2 commits
  2. 17 Nov, 2012 15 commits
  3. 16 Nov, 2012 5 commits
  4. 15 Nov, 2012 4 commits
  5. 14 Nov, 2012 9 commits
  6. 13 Nov, 2012 5 commits
    • Do not register variable if host has been skipped · 302eeae6
      Executive summary: skipping a host corrupts a variable (when it is registered)
      
      We have a play existing out of multiple tasks that check a condition, if one of these tasks fails we want to skip all next tasks in the playbook. I noticed that if we skip a task because a certain condition is met, and this task has a register-attribute, I loose the value in the variable. Which means we cannot use that variable in subsequent tasks to evaluate because it was skipped:
      
      ```
      - action: command test -d /some/directory
        register: task
      
      - action: command test -f /some/directory/file
        register: task
        only_if: '${task.rc} == 0'
      
      - action: do something else
        only_if: '${task.rc} == 0'
      ```
      
      In the above example, if the second task is skipped (because the first failed), the third action will end with a "SyntaxError: invalid syntax" complaining about the unsubstituted ${task.rc} (even though it was set by the first task and used for skipping the second).
      
      The following play demonstrates the problem:
      
      ```
      - name: Test register on ignored tasks
        hosts: all
        gather_facts: no
      
        vars:
          skip: true
          task: { 'rc': 666 }
      
        tasks:
        - action: debug msg='skip = ${skip}, task.rc = ${task.rc}'
      
        - name: Skip this task, just to test if task has changed
          action: command ls
          register: task
          only_if: '${skip} != True'
      
        - action: debug msg='skip = ${skip}, task.rc = ${task.rc}'
      
        - name: Now use task value
          action: command echo 'Works !'
          only_if: '${task.rc} == 0'
      ```
      
      And the enclosed fix, fixes the above problem.
      Dag Wieers committed
    • Merge pull request #1611 from dhozac/no-hostvars-templating · 44af1408
      Keep hostvars from being templated
      Michael DeHaan committed
    • Merge pull request #1613 from dhozac/use-all-vars-for-hosts-template · 6793bcbe
      Use all available vars for hosts:, user: and sudo_user:
      Michael DeHaan committed
    • Merge pull request #1614 from dagwieers/missing-action-error · 2303f65a
      Print the task name (if any) when complaining
      Michael DeHaan committed
    • Merge pull request #1612 from dhozac/play-vars-list · 7a485253
      Make parameterized playbook includes work with vars as a list
      Michael DeHaan committed