1. 05 Oct, 2012 4 commits
  2. 04 Oct, 2012 18 commits
  3. 03 Oct, 2012 12 commits
  4. 02 Oct, 2012 6 commits
    • Fix gather_facts assumption that SETUP_CACHE for a host is empty · fedfd187
      We now check explicitely for 'module_setup' in the SETUP_CACHE in order to avoid skipping setup because SETUP_CACHE was populated some other way. Other modules can implement the same mechanism to test if they've already run.
      
      This closes #1206.
      Dag Wieers committed
    • Make ignored/skipped different from changed · f11ab438
      Since a skipped/ignored action is _very_ different from actual changes to a system, it always bothered me that  it was not easily distinguishable when skimming the output. This change makes ignore/skip a different color, and I chose cyan. Contemplated using dark-gray/blue, but prefered something that is readable with most terminal colors.
      Dag Wieers committed
    • Make fatal errors red · 7acc0a63
      Dag Wieers committed
    • Added a fail module in order to fail execution on certain conditions · 1d27909e
      In some cases you may want to deliberately fail the execution of a playbook. In our provisioning workflow we want to have safeguards in place to avoid provisioning systems that are already in production. Since we reboot physical and virtual systems, it is mandatory we take all the precautions to prevent accidental provisioning.
      
      So in our use-case we have the following at the very start of the provisioning playbook:
      
          ### Safeguard to protect production systems
          - local_action: fail msg="System is not ready to be staged according to CMDB"
            only_if: "'$cmdb_status' != 'to-be-staged'"
      
      and we repeat the same task in the (separate included) play that takes care of (re)booting the system using our own boot-media, so that it cannot be accidentally separately run by someone.
      Dag Wieers committed
    • Abort a play at the start when no hosts matches, or no hosts are remaining · 20c1a677
      This change makes a distinction between no_hosts_matched and no_hosts_remaining.
      
      In both cases we do not start facts-gathering, or run any tasks.
      
      In the case that there are no more hosts remaining, we abort running tasks and abort the playbook.
      
      I also cleaned up the leftovers from the previous patchsets, as these are no longer required.
      
      This closes #1187.
      
      Example playbook:
      
      ```yaml
      ---
      - hosts: emptygroup
        tasks:
        - action: command date
        - action: command false
      
      - hosts: all
        gather_facts: False
        tasks:
        - action: command ls
        - action: command false
        - action: command true
      
      - hosts: all
        tasks:
        - action: command true
        - action: command false
      
      - hosts: all
        tasks:
        - action: command pwd
      ```
      Dag Wieers committed
    • Merge pull request #1201 from dhozac/setup-once-per-node · e1b17026
      Only gather facts once per node per playbook run
      Michael DeHaan committed