Class: Subspace::Commands::Provision
- Defined in:
- lib/subspace/commands/provision.rb
Constant Summary collapse
- PASS_THROUGH_PARAMS =
["tags", "start-at-task", "private-key", "limit"]
Instance Method Summary collapse
-
#initialize(args, options) ⇒ Provision
constructor
A new instance of Provision.
- #run ⇒ Object
Methods inherited from Base
#confirm_overwrite, #copy, #dest_dir, #gem_path, #playbook_dir, #project_path, #require_configuration, #template, #template!, #template_dir
Methods included from Ansible
Constructor Details
#initialize(args, options) ⇒ Provision
Returns a new instance of Provision.
4 5 6 7 8 |
# File 'lib/subspace/commands/provision.rb', line 4 def initialize(args, ) @environment = args.first @options = run end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/subspace/commands/provision.rb', line 10 def run = ["--diff"] PASS_THROUGH_PARAMS.each do |param_name| x = param_name.split('-')[1..-1].map(&:upcase).join('_') hash_key = (param_name.gsub('-', '_') + (x == '' ? '' : "_#{x}")).to_sym value = @options.__hash__[hash_key] if value += ["--#{param_name}", value] end end ansible_command "ansible-playbook", "#{@environment}.yml", * end |