Skip to content

Instantly share code, notes, and snippets.

@amarao
Created August 6, 2019 14:32
Show Gist options
  • Save amarao/2b211c342926f4c0f8275840b72ed5bc to your computer and use it in GitHub Desktop.
Save amarao/2b211c342926f4c0f8275840b72ed5bc to your computer and use it in GitHub Desktop.
check for check_mode for ansible
- hosts: localhost
gather_facts: false
tasks:
- name: check_mode=true check_mode_supported=false
command: date
check_mode: true
- name: check_mode=false check_mode_supported=false
command: date
check_mode: false
- name: check_mode=absent check_mode_supported=false
command: date
- name: check_mode=true check_mode_supported=true
file: path=/tmp/foo state=touch
check_mode: true
- name: check_mode=false check_mode_supported=true
file: path=/tmp/foo state=touch
check_mode: false
- name: check_mode=absent check_mode_supported=true
file: path=/tmp/foo state=touch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment