Skip to content

Allow to generate custom locations in load_balancer mode #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 19, 2018
Merged

Allow to generate custom locations in load_balancer mode #72

merged 9 commits into from
Nov 19, 2018

Conversation

0x28d
Copy link
Contributor

@0x28d 0x28d commented Nov 13, 2018

Enable setting custom locations in load_balancer mode by vars

nginx_http_template:
  default:
    template_file: http/default.conf.j2
    conf_file_name: default.conf
    conf_file_location: /etc/nginx/conf.d/
    port: 8081
    server_name: localhost
    error_page: /usr/share/nginx/html
    ssl:
      cert: ssl/default.crt
      key: ssl/default.key
    web_server:
      html_file_location: /usr/share/nginx/html
      html_file_name: index.html
      http_demo_conf: false
    load_balancer:
      locations:
        backend:
          location: /
          proxy_pass: backend
      health_check_plus: false
    upstreams:
      upstream1:
        name: backend
        lb_method: least_conn
        zone_name: backend
        zone_size: 64k
        sticky_cookie: false
        servers:
          server1:
            address: localhost
            port: 8081
            weight: 1
            health_check: max_fails=1 fail_timeout=10s

@alessfg
Copy link
Member

alessfg commented Nov 13, 2018

Thanks for the new PR @0x28d! Could you also implement custom locations in the web_server mode? And could you also update the README including the new vars you introduced? (Forgot to bring this up in the last PR you submitted 😄 )

@alessfg alessfg assigned alessfg and 0x28d and unassigned alessfg Nov 13, 2018
@alessfg alessfg added the enhancement Enhance/improve an existing feature label Nov 13, 2018
@0x28d
Copy link
Contributor Author

0x28d commented Nov 14, 2018

Thanks for the new PR @0x28d! Could you also implement custom locations in the web_server mode? And could you also update the README including the new vars you introduced? (Forgot to bring this up in the last PR you submitted smile )

Done! :)

@0x28d
Copy link
Contributor Author

0x28d commented Nov 14, 2018

But now as I see tests are fail in TravisCI, but locally configuration generate with no errors.

@alessfg
Copy link
Member

alessfg commented Nov 14, 2018

Yeah don't worry about TravisCI, the latest Debian Stretch Docker image seems to be causing Ansible to fail when using the apt_key module 🤷‍♂️ .

There's one more thing that'd be great if you could add to the README before I merge. Namely, updating the Role Variables section here with the new content you introduced in defaults/main.yml 😄

@0x28d
Copy link
Contributor Author

0x28d commented Nov 16, 2018

Yeah don't worry about TravisCI, the latest Debian Stretch Docker image seems to be causing Ansible to fail when using the apt_key module man_shrugging .

There's one more thing that'd be great if you could add to the README before I merge. Namely, updating the Role Variables section here with the new content you introduced in defaults/main.yml smile

README.md update done! :)

About TravisCI, I'm worried about this job: https://travis-ci.org/nginxinc/ansible-role-nginx/jobs/455135988
Locally I can't repeat it, everything is ok on "Dynamically Generate NGINX HTTP Configuration Files".

@alessfg
Copy link
Member

alessfg commented Nov 16, 2018

That would be related to the nginx-template.yml test in https://github.com/nginxinc/ansible-role-nginx/blob/master/tests/playbooks/nginx-template.yml. You should be able to change the variables easily enough to make the test pass 😄

@0x28d
Copy link
Contributor Author

0x28d commented Nov 19, 2018

That would be related to the nginx-template.yml test in https://github.com/nginxinc/ansible-role-nginx/blob/master/tests/playbooks/nginx-template.yml. You should be able to change the variables easily enough to make the test pass smile

Yes, I was inattentive. Test tests/playbooks/nginx-template.yml already updated, tests passed! :)

@alessfg alessfg merged commit 39dd5a2 into nginx:master Nov 19, 2018
@alessfg
Copy link
Member

alessfg commented Nov 19, 2018

Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance/improve an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants