dokku / ansible-dokku

Ansible modules for installing and configuring Dokku
MIT License
169 stars 44 forks source link

Skip port mappings when no changes are detected #145

Closed erikvdv1 closed 1 year ago

erikvdv1 commented 1 year ago

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 commented 1 year ago

Thanks @erikvdv1 , also this fix looks great.

As with the other PR, adding a small test would be appreciated if you can find the time.

Done

ltalirz commented 1 year ago

Thanks for fixing the layout!