Closed hackartisan closed 6 days ago
The current role has a tasks file with a single task that "cleans up" the config. It removes the entire config directory. The role includes that file only when the variable nginx_cleanup_config
is set to true
- that var is set to false
in the role defaults.
Do we want that task to run every time we upload new configs? So that each time the playbook runs (unless it runs with -t SSL
) , it would delete the config directory and upload all configs from scratch? If so, we can put it in the upload_config.yml
tasks file, before the upload task, and tag it with tags: update_conf
.
If we only want that task to run occasionally, we can update the README and playbooks to document the existing behavior: "To remove all existing config files before uploading, pass -e nginx_cleanup_config=true
when you run the playbook."
Per @tpendragon we can use the synchronize module with delete
.
Add a test for this new behavior. Probably needs a pre-task in molecule/default/converge.yml that adds an extraneous file, then a test in molecule/default/verify.yml that checks to be sure the file disappears when the playbook runs.
Test for this as part of #3439
Related to #4654 - I think that PR should fix/close this ticket, except we are not testing for this behavior yet.
e.g. if an old config is removed from ansible it should also be removed from the remote server.
Current behavior is that the old config is still there after the playbook has been run.