1457 shaares
94 private links
94 private links
Ever wanted to make your command or shell call in Ansible playbook idempotent and avoid those nasty yellow changed lines in run logs? Wait no more! Here's bash trick for you: - name: Put docker package on hold shell: > apt-mark showholds | grep -q docker-ce && echo -n HOLDED || apt-mark hold docker-ce register: docker_hold changed_when: docker_hold.stdout != 'HOLDED' What do we do here? 1. We execute "check" command apt-mark showholds | grep -q docker-c