ansible-dokku icon indicating copy to clipboard operation
ansible-dokku copied to clipboard

Skip port mappings when no changes are detected

Open erikvdv1 opened this issue 2 years ago • 0 comments

The dokku_ports task always completes with changed=true, even when the same ports are already set for an application.

This PR checks if the existing ports match the ports to set, if so, it completes with changed=false.

The command for checking existing ports dokku --quiet proxy:ports {app} returns a non-zero exit code when no ports are defined, so I replaced this with a call to dokku --quiet proxy:report {app}.

dokku --quiet proxy:report {app}
       Proxy enabled:                 true
       Proxy port map:                http:80:80 https:443:80
       Proxy type:                    nginx

erikvdv1 avatar Oct 13 '22 14:10 erikvdv1