Giter Club home page Giter Club logo

Comments (5)

alessfg avatar alessfg commented on July 18, 2024 2

Hi @adrianovieira!

  1. it creates unrequested default.conf
$ ls -l /etc/nginx/conf.d/
total 12
-rw-r--r--. 1 root root 1093 Dez  4 13:01 default.conf
-rw-r--r--. 1 root root   80 Fev 13 13:46 www1.example.com.conf
-rw-r--r--. 1 root root   80 Fev 13 13:49 www2.example.com.conf

This is a known issue, right now the role doesn't delete previous existing configuration files (see #93). We'll prioritize adding this feature.

  1. it doesn't insert a root path
$ cat /etc/nginx/conf.d/www2.example.com.conf 
# Ansible managed
server {
   listen 80;
   server_name www2.example.com;
}

There's no low level root parameter. You can set a root path by using the html_file_location parameter at https://github.com/nginxinc/ansible-role-nginx/blob/master/defaults/main.yml#L175. However you make a good point that sometimes you want to use root in the server context instead of the location context. We'll try to get that parameter added asap too.

from ansible-role-nginx.

alessfg avatar alessfg commented on July 18, 2024 2

Are you pulling from Ansible Galaxy? If so these changes won't be reflected until we publish a new release. For now I'd recommend cloning this repo directly.

from ansible-role-nginx.

gdzien avatar gdzien commented on July 18, 2024

Hello,

My name is Grzegorz and I will work with you on solving issue you are facing.
At a first glance it seems that what you are doing should yield expected result, unfortunately I am unable to say what has gone wrong in your case without error message you are getting.

Can you please share messages returned by ansible when trying to use this role?

Sincerely,
Grzegorz Dzień

from ansible-role-nginx.

adrianovieira avatar adrianovieira commented on July 18, 2024

Hi!

Thank you by helping me.

This tests was done using your galaxy version (ansible-galaxy install nginxinc.nginx)

an inventory sample:

  vars:
    nginx_enable: true
    nginx_branch: stable

    nginx_http_template_enable: true
    nginx_http_template:
      www1:
        template_file: http/default.conf.j2
        conf_file_name: www1.example.com.conf
        conf_file_location: /etc/nginx/conf.d/
        server_name: www1.example.com
        port: 80
        root: /usr/share/nginx/html/www1

      www2:
        template_file: http/default.conf.j2
        conf_file_name: www2.example.com.conf
        conf_file_location: /etc/nginx/conf.d/
        server_name: www2.example.com
        port: 80
        root: /usr/share/nginx/html/www2
  1. it creates unrequested default.conf
$ ls -l /etc/nginx/conf.d/
total 12
-rw-r--r--. 1 root root 1093 Dez  4 13:01 default.conf
-rw-r--r--. 1 root root   80 Fev 13 13:46 www1.example.com.conf
-rw-r--r--. 1 root root   80 Fev 13 13:49 www2.example.com.conf
  1. it doesn't insert a root path
$ cat /etc/nginx/conf.d/www2.example.com.conf 
# Ansible managed
server {
    listen 80;
    server_name www2.example.com;
}

from ansible-role-nginx.

adrianovieira avatar adrianovieira commented on July 18, 2024

Hi!

Well done.

Thank you.

PS: it still creates an unrequested default.conf

from ansible-role-nginx.

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.