chef [SOLVED]: Best way to verify that passenger nginx module has been successfully compiled?

chef [SOLVED]: Best way to verify that passenger nginx module has been successfully compiled?

Home Forums Automation Tools Chef Tutorials chef [SOLVED]: Best way to verify that passenger nginx module has been successfully compiled?

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #205400

    Cloudy Point
    Keymaster

    QuestionQuestion

    I have several servers chef managed each running a stack with:

    • nginx
    • phusion passenger

    I’d like to make the passenger gem upgrade process automated with the ability to conditionally skip passenger nginx module compilation meaning I don’t want the compile process to happen on every chef run, only on runs where it is determined that it is necessary (typically because passenger gem version is being upgraded, but also in cases where the passenger gem is not being upgraded but the compilation failed previously).

    Currently I check the version of passenger being run, but in cases where the gem actually installs to the correct version but the compilation fails, that idempotency check is too broad and I fail to get a compile attempt when I need one.

    What is the most accurate way to verify that the passenger nginx module has been compiled? Is there a specific file in a stable location whose existence I can check for?

    Right now my chef block looks like this:

    execute "compile passenger nginx module" do
        ruby_vers = node[:ruby][:global_version]
        passenger_vers = node[:passenger][:version]
        ruby_parent_vers = node[:ruby_parent_vers]
      command "export ORIG_PATH="$PATH"; sudo -s -E; export PATH="$ORIG_PATH"; /usr/bin/ruby /usr/lib/ruby/gems/2.4.0/gems/passenger-#{passenger_vers}/bin/passenger-install-nginx-module --auto --auto-download"
      # check for a difference between passenger version requested and passenger version running
      not_if { `passenger --version` == cur_vers }
    end
    

    #205401

    Cloudy Point
    Keymaster
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.