Skip to content

Commit

Permalink
Add support for check mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanser committed Apr 25, 2017
1 parent d59e73e commit b2f5009
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ test -n "$(grep -L 'WARNING' /tmp/ansible.log)" \
grep -q "changed=0.*failed=0" /tmp/ansible.log \
&& { echo "Idempotence test: pass"; } \
|| { echo "Idempotence test: fail" && exit 1; }
ansible-playbook playbook.yml --connection local --check 2>&1 | grep -q "changed=0.*failed=0" \
&& { echo "Check mode: pass"; } \
|| { echo "Check mode: fail" && exit 1; }
SCRIPT
end
end
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
command: ls /home
register: home_dirs
changed_when: false
check_mode: no

- name: ensure powerline is loaded for configured users
lineinfile:
Expand Down

0 comments on commit b2f5009

Please sign in to comment.