Module: DanarchyDeploy::Services

Defined in:
lib/danarchy_deploy/services.rb,
lib/danarchy_deploy/services/init.rb,
lib/danarchy_deploy/services/mysql.rb,
lib/danarchy_deploy/services/mongodb.rb,
lib/danarchy_deploy/services/init/openrc.rb,
lib/danarchy_deploy/services/init/systemd.rb,
lib/danarchy_deploy/services/mysql/new_server.rb,
lib/danarchy_deploy/services/mysql/privileges.rb

Defined Under Namespace

Classes: Init, MongoDB, MySQL

Class Method Summary collapse

Class Method Details

.new(deployment, options) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/danarchy_deploy/services.rb', line 8

def self.new(deployment, options)
  return deployment if ! deployment[:services]
  puts "\n" + self.name

  deployment[:services].each do |service, params|
    puts "\nConfiguring service: #{service}"

    if params[:archives] && !params[:archives].empty?
      puts "\n" + self.name
      puts " > Deploying archives for #{service}"
      DanarchyDeploy::Archiver.new(params[:archives], options)
    end

    if params[:templates] && !params[:templates].empty?
      puts " > Configuring templates for #{service}"
      DanarchyDeploy::Templater.new(params[:templates], options)
    end

    if %w[mysql mariadb].include?(service.to_s)
      DanarchyDeploy::Services::MySQL.new(deployment[:os], params, options)
    end

    if %[mongodb].include?(service.to_s)
      DanarchyDeploy::Services::MongoDB.new(deployment[:os], params, options)
    end
  end

  deployment
end