How to prevent ‘changed’ flag when ‘register’-ing a variable?

It’s described in official documentation here.

tasks:
  - name: test for nginx
    command: dpkg -s nginx-common
    register: nginx_installed
    changed_when: false

Leave a Comment