Class: Subspace::Commands::MaintenanceMode
- Defined in:
- lib/subspace/commands/maintenance_mode.rb
Constant Summary collapse
- PASS_THROUGH_PARAMS =
["private-key", "limit"]
Instance Method Summary collapse
-
#initialize(args, options) ⇒ MaintenanceMode
constructor
A new instance of MaintenanceMode.
- #run ⇒ Object
Methods inherited from Base
#confirm_overwrite, #copy, #dest_dir, #gem_path, #inventory, #pass_through_params, #playbook_dir, #project_name, #project_path, #require_configuration, #set_subspace_version, #template, #template!, #template_dir
Methods included from Ansible
#ansible_command, #ansible_playbook
Constructor Details
#initialize(args, options) ⇒ MaintenanceMode
Returns a new instance of MaintenanceMode.
4 5 6 7 8 |
# File 'lib/subspace/commands/maintenance_mode.rb', line 4 def initialize(args, ) @hosts = args.first @options = run end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 |
# File 'lib/subspace/commands/maintenance_mode.rb', line 10 def run on_off = @options.__hash__[:on] ? "on" : "off" = ["--diff", "-e maintenance_hosts=#{@hosts}", "--tags=maintenance_#{on_off}"] = | pass_through_params ansible_command "ansible-playbook", File.join(File.dirname(__FILE__), "../../../ansible/playbooks/maintenance_mode.yml"), * end |