Comments (8)
I think cleaning up old nginx config files could be added. It would work like this:
- set a
delete: True
key in server configuration - rerun the playbook, so that Ansible deletes symlinks to the configs, configs themselves and reloads nginx
- remove the server configuration from inventory
This will allow you do do something like:
nginx_servers: [ '{{ nginx_old_server }}', '{{ nginx_new_server }}' ]
nginx_old_server:
name: [ 'example.com' ]
enabled: False
delete: True
nginx_new_server:
name: [ 'example.com' ]
enabled: True
I think this should remain idempotent as well. I will look into it in the near future.
from ansible-nginx.
Makes sense to me. Prior to this we were also using Jinja2 templating for our webserver.conf files and then just manually creating the symlink. Your approach works really well but I didn't see a way to trigger options based on a variable. Basically the ability to build something like:
location ~ ^/.*/_mapping {
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
{% if kibana_password_protect_all %}
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd;
{% endif %}
}
from ansible-nginx.
nginx_server_kibana:
location:
'~ ^/.*/_mapping': |
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
{% if kibana_password_protect_all %}
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd;
{% endif %}
Yes, the text block config style is that simple :-) Here's another example: https://github.com/debops/ansible-phpipam/blob/master/vars/main.yml#L44-L50
from ansible-nginx.
@zahlenofzahlen BTW, we have debops.redis
, debops.elasticsearch
, I haven't decided yet between fluentd and LogStash, what do you use? Either way, is your Kibana role open source? :-)
from ansible-nginx.
I'm using debops.nginx and debops.elasticsearch and just modifying https://github.com/geerlingguy/ansible-role-kibana to work with with it. I put in a few things to specify Kibana version, etc. But that's pretty much it. Unfortunately I don't have any of it open source.
from ansible-nginx.
@zahlenofzahlen Interesting to hear about debops.elasticsearch
, can you describe your setup? This role was tested extensively locally, but haven't been tried in a real cluster, we are interested in the results.
from ansible-nginx.
Well at this point we are developing small reproducible environments so it's not a true cluster. It's just elasticsearch, kibana, and ElasticHQ. If we get the go ahead I might be able to release a debops playbook for graphite/grafana. I haven't started building that yet. It would have elasticsearch as a dependency. We haven't done any real testing with Elasticsearch and honestly if it's not 100% right that's fine as we can afford some manually tweaking after the fact.
from ansible-nginx.
@zahlenofzahlen Your issues have been fixed by dd113d7 and cd5eb63, cheers. :-)
from ansible-nginx.
Related Issues (20)
- Log files in different directory HOT 1
- it is impossible to set *_log: off; HOT 2
- The nginx.org flavor key has expired HOT 1
- SSL redirect from non www to www HOT 2
- Disabling server_welcome and server_localhost cause missing var error HOT 1
- Welcome url scheme template not being parsed correctly... moustaches in deployed file HOT 7
- Consider to disable `nginx_hsts_preload` by default HOT 2
- Setting Referrer-Policy to no-referrer breaks applications HOT 4
- Mod security plugin? HOT 2
- Redesign Content Security Policy support HOT 3
- Pheonix Elixir Upstreams ? HOT 13
- Download nginx package via https HOT 2
- Security headers only printed when ssl is enabled HOT 4
- "undefined variable" in task "Create default welcome page if enabled". HOT 2
- Default try_files means 404 wonβt be hit if an index.html is at the root
- IPv6 DNS-resolver causes nginx to fail HOT 2
- client_max_body_size configuration HOT 1
- default nginx_flavor HOT 1
- custom vhost log HOT 1
- nginx Role Error on Remove all configuration symlinks during config reset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-nginx.