Git Product home page Git Product logo

Comments (6)

alessfg avatar alessfg commented on July 1, 2024 1

Sorry for the extra delay dealing with this! I have an idea on how to achieve this but it might have to wait until an upcoming templating refactor gets finished.

from ansible-role-nginx-config.

alessfg avatar alessfg commented on July 1, 2024

Hi @rolandjitsu! There's no way to restore/undo changes made to any of the default NGINX configuration files (nginx.confand conf.d/default.conf) using the role.

However, your previous configuration file should be backed up any time you deploy a new template. In which case you can simply delete the templated file you have right now, change the file name of the backup to nginx.conf, and run nginx -s reload to achieve a seamless reload. Otherwise, you can grab the default nginx.conf from a different location (eg by deploying an NGINX Docker container), and use the nginx_main_upload_* parameters to push the default nginx.conf to your target host. And as final option, you can always delete NGINX and redeploy your role.

All that being said, I think your feature request makes sense. I'll add it to the backlog 😄

from ansible-role-nginx-config.

rolandjitsu avatar rolandjitsu commented on July 1, 2024

@alessfg thanks for getting back to me.

There's no way to restore/undo changes made to any of the default NGINX configuration files (nginx.confand conf.d/default.conf) using the role.

Ok, I understand.

However, your previous configuration file should be backed up any time you deploy a new template. In which case you can simply delete the templated file you have right now, change the file name of the backup to nginx.conf, and run nginx -s reload to achieve a seamless reload. Otherwise, you can grab the default nginx.conf from a different location (eg by deploying an NGINX Docker container), and use the nginx_main_upload_* parameters to push the default nginx.conf to your target host. And as final option, you can always delete NGINX and redeploy your role.

I was also thinking about that, I just didn't want to do this manually for every host.

All that being said, I think your feature request makes sense. I'll add it to the backlog

Sounds great, looking forward to it.

from ansible-role-nginx-config.

alessfg avatar alessfg commented on July 1, 2024

Bumping this to 0.16.0 since properly implementing an undo option would also have to implement a rollback feature and the latter will take some extra development time.

from ansible-role-nginx-config.

alessfg avatar alessfg commented on July 1, 2024

As of the latest release, if you run the role with nginx_config_main_template_enable set to true but leave the nginx_config_main_template defaults, you should be able to recreate a close to the default original nginx.conf file. I think that's good enough?

from ansible-role-nginx-config.

alessfg avatar alessfg commented on July 1, 2024

Closing this for the time being since I think the current solution is pretty close to the original intent of this issue. Feel free to reopen the issue if that's not the case! 😄

from ansible-role-nginx-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.