Giter Club home page Giter Club logo

Comments (11)

alessfg avatar alessfg commented on August 18, 2024

Thanks for creating this issue!

I think this is happening because all modules are installed using Ansible's package module, but to work with NGINX in FreeBSD you need to use ports and the portinstall module.

Let me do some further research and get back to you.

Cheers,
Alessandro.

from ansible-role-nginx.

alessfg avatar alessfg commented on August 18, 2024

So, on FreeBSD, when you install the default nginx port you choose which modules to install when running make. Doing this in an automated way is not trivial, with the best solution probably being to implement a way to create a build options file at runtime that then gets read when building the nginx port.

Alternatively, for now, a workaround would be to manually modify the value at https://github.com/nginxinc/ansible-role-nginx/blob/master/tasks/opensource/install-oss.yml#L26 from nginx to nginx-full, and not enable modules on the role. The nginx-full port builds pretty much all modules, which you should then be able to normally load from your NGINX configuration file.

from ansible-role-nginx.

vladp avatar vladp commented on August 18, 2024

since this role uses nginx packag from your repository, would it be possible get your repository to host all the binaries of plugins for a given os (eg freebsd, openbsd) and then the role would pull out of there?
Meaning that you would have to build it (using the ports tree, as you noted, but then host the resulting packages). This way individual users do not have to build it.

(sorry if I am misunderstanding this).

from ansible-role-nginx.

alessfg avatar alessfg commented on August 18, 2024

In FreeBSD the NGINX open source packages are hosted in the ports collection, and that's something that I do not foresee will change in the foreseeable future. There's some potential fixes, like I mentioned in the previous comment, but it'll take some time before a decision is made about how to best proceed.

from ansible-role-nginx.

vladp avatar vladp commented on August 18, 2024

ah, ok. I understand now. Basically for FreeBSD (and openBSD) this role, will actually build nginx on the target host.

from ansible-role-nginx.

vladp avatar vladp commented on August 18, 2024

Your workaround also should me to solve: uknown directive 'stream' error.
That I keep getting on FreeBSD 12.

Installing nginx-full on FreeBSD seems to be a requirement overall, because the 'stream' module is also not avialable in 'nginx' standard build (the stream module is assumed to be available in the role -- because it allows to specify stream_enable option)

Unfortunately using nginx-full fails for me..


 Found a package of 'www/nginx│
-full': /usr/ports/packages/All/nginx-full-1.16.0_2,2.txz (nginx-full-1.16.0_2,2)\n---> │
 Located a package version 1.16.0_2,2 (/usr/ports/packages/All/nginx-full-1.16.0_2,2.txz│
)\n--->  Installing 'nginx-full-1.16.0_2,2' from a package\n--->  Installing the new ver│
sion via the package\nInstalling nginx-full-1.16.0_2,2...\r\npkg: Missing dependency 'Im│
ageMagick6'\r\n\r\nFailed to install the following 1 package(s): /usr/ports/packages/All│
/nginx-full-1.16.0_2,2.txz\r\n\t! www/nginx-full\t(pkg_add failed)\n"}           

at this stage it seems that getting this work on FreeBSD is quite a bit beyond my skillset.
Will have to eliminate right now FreeBSD from the supported hosts for the system I am working on.

Thx for all your help sofar.

from ansible-role-nginx.

alessfg avatar alessfg commented on August 18, 2024

Sorry for all the trouble you are running into @vladp. FreeBSD support is still very much in an early development phase, so thanks for bearing with us!

That is a very interesting find indeed too, it may be worth changing the default port to nginx-full in that case, at least for the time being.

from ansible-role-nginx.

vladp avatar vladp commented on August 18, 2024

Thank you, yes -- it seems that doing nginx-full for FreeBSD would solve lots of the module issues.
The trouble for me was that when building nginx-full from Ports, it seems that lots of packages needed to be installed prior to that port to build.

Normally FreeBSD would download recursively the source for packages it needed, but it did not (so first it was missing ImageMagick6, then when installed it using package module, it started complaining that apache24 needed to be installed... and so on).

Overall it meant that either package system was not working to figure out source dependencies, recursively... or something else. Plus, I realized, that nginx-full requires so many depedencies (including X system, wayland) -- that it would take hours if not a day to building nginx-full and resulting system (at least in my case would run out of space allocated for the target host).

Which is why, I thought, that if nginx-full was, indeed, needed -- it had to come from a binary package (eg using ' pkg install nginx-full' from FreeBSD official binary package repol (or may be you repo in the future ) -- rather than building it.

from ansible-role-nginx.

alessfg avatar alessfg commented on August 18, 2024

Oh I see. Well, you can always install NGINX from FreeBSD's package repository, but it tends to be a couple versions behind mainline. Nonetheless (#87) also adds the option to choose between a ports or package install. Hopefully that should add more options.

from ansible-role-nginx.

vbotka avatar vbotka commented on August 18, 2024

Which is why, I thought, that if nginx-full was, indeed, needed -- it had to come from a binary package (eg using ' pkg install nginx-full' from FreeBSD official binary package repol (or may be you repo in the future ) -- rather than building it.

FWIW. Use portinstall/portupgrade. This will install the dependencies and will use packages if available.

portinstall --upward-recursive --use-packages www/nginx-full

This role will install www/nginx by default. It can be configured to install www/nginx-full. For example:

- hosts: test_03
  connection: ssh
  remote_user: admin
  become: yes
  become_user: root
  become_method: sudo

  vars:
    nginx_version: '-full'
    # nginx_version: ''
    nginx_debug_output: true
    nginx_bsd_update_ports: false
    nginx_bsd_install_packages: true
    nginx_bsd_portinstall_use_packages: true
    nginx_modules:
      njs: false
      perl: false
      waf: false
      geoip: false
      image_filter: false
      rtmp: false
      xslt: false

  roles:
    - ansible-role-nginx

from ansible-role-nginx.

alessfg avatar alessfg commented on August 18, 2024

The latest release (0.13.0) should address this issue. Feel free to reopen the issue if it's still not working!

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.