Sha256: d6d7b42d10002585d8a46055757aeea977b752978ccefc639642a578ee068bdb

Contents?: true

Size: 830 Bytes

Versions: 12

Compression:

Stored size: 830 Bytes

Contents

module Cany::Recipes
  # @!attribute user
  #   @return [String, nil] The user name as which the web server process should
  #      executed
  # @!attribute group
  #   @return [String, nil] The group name as which the web server process should
  #      executed
  class WebServer < Cany::Recipe
    attr_accessor :user, :group
    class DSL < Cany::Recipe::DSL
      delegate :user, :group
    end

    def initialize(*args)
      @user = 'www-data'
      @group = 'www-data'
      super
    end

    def binary
      recipe(:system).configure :service_pre_scripts, {
        mkdir_run: "mkdir -p /var/run/#{spec.name}",
        chown_run: "chown #{user}:#{group} /var/run/#{spec.name}"
      }
      install_service name, ["/usr/bin/#{spec.name}"] + launch_command, user: user, group: group
      inner.binary
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cany-0.5.7 lib/cany/recipes/web_server.rb
cany-0.5.6 lib/cany/recipes/web_server.rb
cany-0.5.5 lib/cany/recipes/web_server.rb
cany-0.5.4 lib/cany/recipes/web_server.rb
cany-0.5.3 lib/cany/recipes/web_server.rb
cany-0.5.2 lib/cany/recipes/web_server.rb
cany-0.5.1 lib/cany/recipes/web_server.rb
cany-0.5.0 lib/cany/recipes/web_server.rb
cany-0.4.0 lib/cany/recipes/web_server.rb
cany-0.3.0 lib/cany/recipes/web_server.rb
cany-0.2.1 lib/cany/recipes/web_server.rb
cany-0.2.0 lib/cany/recipes/web_server.rb