Class: BarkingIguana::Compound::Ansible::Playbook
- Inherits:
-
Object
- Object
- BarkingIguana::Compound::Ansible::Playbook
- Defined in:
- lib/barking_iguana/compound/ansible/playbook.rb
Instance Attribute Summary collapse
-
#extra_vars_file ⇒ Object
Returns the value of attribute extra_vars_file.
-
#file ⇒ Object
Returns the value of attribute file.
-
#inventory_paths ⇒ Object
Returns the value of attribute inventory_paths.
-
#io ⇒ Object
Returns the value of attribute io.
-
#limit_pattern ⇒ Object
Returns the value of attribute limit_pattern.
-
#output_verbosity ⇒ Object
Returns the value of attribute output_verbosity.
-
#private_key_file ⇒ Object
Returns the value of attribute private_key_file.
-
#run_from ⇒ Object
Returns the value of attribute run_from.
-
#show_diff ⇒ Object
Returns the value of attribute show_diff.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
Instance Method Summary collapse
- #diff ⇒ Object
- #extra_vars(path) ⇒ Object
-
#initialize(file, run_from: nil) ⇒ Playbook
constructor
A new instance of Playbook.
- #inventory(name) ⇒ Object
- #limit(pattern) ⇒ Object
- #private_key(key_file) ⇒ Object
- #run ⇒ Object
- #stream_to(io) ⇒ Object
- #user(name) ⇒ Object
- #verbosity(n) ⇒ Object
Constructor Details
#initialize(file, run_from: nil) ⇒ Playbook
Returns a new instance of Playbook.
7 8 9 10 11 12 13 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 7 def initialize file, run_from: nil self.file = file self.run_from = run_from self.output_verbosity = 0 self.show_diff = false self.inventory_paths = [] end |
Instance Attribute Details
#extra_vars_file ⇒ Object
Returns the value of attribute extra_vars_file.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def extra_vars_file @extra_vars_file end |
#file ⇒ Object
Returns the value of attribute file.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def file @file end |
#inventory_paths ⇒ Object
Returns the value of attribute inventory_paths.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def inventory_paths @inventory_paths end |
#io ⇒ Object
Returns the value of attribute io.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def io @io end |
#limit_pattern ⇒ Object
Returns the value of attribute limit_pattern.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def limit_pattern @limit_pattern end |
#output_verbosity ⇒ Object
Returns the value of attribute output_verbosity.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def output_verbosity @output_verbosity end |
#private_key_file ⇒ Object
Returns the value of attribute private_key_file.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def private_key_file @private_key_file end |
#run_from ⇒ Object
Returns the value of attribute run_from.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def run_from @run_from end |
#show_diff ⇒ Object
Returns the value of attribute show_diff.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def show_diff @show_diff end |
#user_name ⇒ Object
Returns the value of attribute user_name.
5 6 7 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 5 def user_name @user_name end |
Instance Method Details
#diff ⇒ Object
25 26 27 28 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 25 def diff self.show_diff = !self.show_diff self end |
#extra_vars(path) ⇒ Object
20 21 22 23 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 20 def extra_vars path self.extra_vars_file = path self end |
#inventory(name) ⇒ Object
35 36 37 38 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 35 def inventory name self.inventory_paths << name self end |
#limit(pattern) ⇒ Object
50 51 52 53 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 50 def limit pattern self.limit_pattern = pattern self end |
#private_key(key_file) ⇒ Object
45 46 47 48 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 45 def private_key key_file self.private_key_file = key_file self end |
#run ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 55 def run command.run_command command.error! self ensure clean_up end |
#stream_to(io) ⇒ Object
30 31 32 33 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 30 def stream_to io self.io = io self end |
#user(name) ⇒ Object
40 41 42 43 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 40 def user name self.user_name = name self end |
#verbosity(n) ⇒ Object
15 16 17 18 |
# File 'lib/barking_iguana/compound/ansible/playbook.rb', line 15 def verbosity n self.output_verbosity = n.to_i self end |