Sha256: 684cd866724e12d25e96d5428ec2025d910ca41078b90d2ef1db5bf2e0613036

Contents?: true

Size: 587 Bytes

Versions: 33

Compression:

Stored size: 587 Bytes

Contents

class Subspace::Commands::MaintenanceMode < Subspace::Commands::Base
  PASS_THROUGH_PARAMS = ["private-key", "limit"]

  def initialize(args, options)
    @hosts = args.first
    @options = options
    run
  end

  def run
    on_off = @options.__hash__[:on] ? "on" : "off"
    ansible_options = ["--diff", "-e maintenance_hosts=#{@hosts}", "--tags=maintenance_#{on_off}"]
    ansible_options = ansible_options | pass_through_params
    ansible_command "ansible-playbook",  File.join(File.dirname(__FILE__), "../../../ansible/playbooks/maintenance_mode.yml"), *ansible_options
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
subspace-3.0.12 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.11 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.10 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.9 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.6 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.5 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.4 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.3 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.2 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.0 lib/subspace/commands/maintenance_mode.rb
subspace-2.5.10 lib/subspace/commands/maintenance_mode.rb
subspace-3.0.0.rc1 lib/subspace/commands/maintenance_mode.rb
subspace-2.5.9 lib/subspace/commands/maintenance_mode.rb
subspace-2.5.8 lib/subspace/commands/maintenance_mode.rb
subspace-2.5.7 lib/subspace/commands/maintenance_mode.rb
subspace-2.5.6 lib/subspace/commands/maintenance_mode.rb
subspace-2.5.5 lib/subspace/commands/maintenance_mode.rb
subspace-2.5.4 lib/subspace/commands/maintenance_mode.rb
subspace-2.5.3 lib/subspace/commands/maintenance_mode.rb
subspace-2.5.2 lib/subspace/commands/maintenance_mode.rb