module Powerplay::DSL

Constants

SPECIAL_PARAMS

Public Instance Methods

_bump() click to toggle source

bump the config stack because we are in a child node context

# File lib/ansible-powerplay/dsl.rb, line 10
def _bump
  @@config_stack.push @@config_stack.last.clone
end
_config() click to toggle source

Get the current config

# File lib/ansible-powerplay/dsl.rb, line 20
def _config
  @@config_stack.last
end
_dequeue() click to toggle source
# File lib/ansible-powerplay/dsl.rb, line 42
def _dequeue
  @@planning_queue.shift
end
_dip() click to toggle source

pop the config stack, as we have left the child node context

# File lib/ansible-powerplay/dsl.rb, line 15
def _dip
  @@config_stack.pop
end
_enqueue(book) click to toggle source
# File lib/ansible-powerplay/dsl.rb, line 38
def _enqueue book
  @@planning_queue << book
end
_global() click to toggle source
# File lib/ansible-powerplay/dsl.rb, line 30
def _global
  @@global_config
end
_peek() click to toggle source
# File lib/ansible-powerplay/dsl.rb, line 46
def _peek
  @@planning_queue.first
end
_planning() click to toggle source

do NOT modify this directly. use the API above.

# File lib/ansible-powerplay/dsl.rb, line 55
def _planning
  @@planning_queue
end
_sneak() click to toggle source
# File lib/ansible-powerplay/dsl.rb, line 50
def _sneak
  @@planning_queue.last
end
_verbosity() click to toggle source
# File lib/ansible-powerplay/dsl.rb, line 34
def _verbosity
  _global[:options][:verbose]
end
config_var(var) click to toggle source

This can be called from the powerplay, but we advise against it.

# File lib/ansible-powerplay/dsl.rb, line 26
def config_var(var)
  _config[var.to_sym].first
end
configuration(type=:vars, desc=nil, &block) click to toggle source
# File lib/ansible-powerplay/dsl.rb, line 211
def configuration(type=:vars, desc=nil, &block)
  _global[type] = DslConfiguration.new(type, desc, &block).config
end
playbooks(type=:vars, desc=nil, &block) click to toggle source
# File lib/ansible-powerplay/dsl.rb, line 215
def playbooks(type=:vars, desc=nil, &block)
  _global[:playbooks] ||= {}
  
  if Play::clopts[:play].member? type.to_s
    _global[:playbooks][type] = DslPlaybook.new type, desc, &block
  end
end