GithubHelp home page GithubHelp logo

Comments (6)

jdauphant avatar jdauphant commented on August 28, 2024

It's looks like an Ansible bug.

You can define manually this variable to compensate : nginx_worker_processes

from ansible-role-nginx.

mike-pt avatar mike-pt commented on August 28, 2024

yeah thats what I did as a workaround, ans this was reported as a bug before ans supposedly fixed(I'll paste the ghi for reference later, on mobile now)

but in any case not an issue on you're side so I guess it can be closed

from ansible-role-nginx.

mike-pt avatar mike-pt commented on August 28, 2024

here:
ansible/ansible#9008

It seems the fix was reverted cause it was causing more issues, I wonder if this just affects FreeBSD or all DigitalOcean vms, If I have time I might take a peak at the code that gets this value, anyway for now I'll just edit the role and define the var to a default of "1" and increase in the playbooks if needed.

from ansible-role-nginx.

Faheetah avatar Faheetah commented on August 28, 2024

Came to this from the referenced issue, FYI the root cause isn't due to an Ansible bug, though the expected output may be. You're trying to use a variable that doesn't exist. Variables can be guarded using the default() filter, and given that facts might not be available it's probably best to do so. You could either default(1) or guard against it in the template. I'd use nginx_worker_processes: "{{ ansible_processor_vcpus|default(None) }}" then use {% if nginx_worker_processes %} block in the template.

from ansible-role-nginx.

jdauphant avatar jdauphant commented on August 28, 2024

@nowayride Ok thanks, don't hesitate to submit a PR

from ansible-role-nginx.

mike-pt avatar mike-pt commented on August 28, 2024

@nowayride that sounds 100% correct.

But I'd like to add that this fact should be present on FreeBSD, I was actually looking into the code a couple of days ago but then other stuff came up, the code is just doing it wrong for FreeBSD... its looking in dmesg for string that are not present / don't reflect the cpu/threads info, or maybe it was in older versions... anyway if I get some time tomorrow I'll poke around more... looking for "SMP" in dmesg would work.

I.E.

% dmesg | grep SMP
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 SMT threads

But anyway you're point is still pretty valid for any "fact"

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.