Class: FissherConf::Misc
- Inherits:
-
Object
- Object
- FissherConf::Misc
- Defined in:
- lib/fissher_conf.rb
Overview
Misc methods for doing dirty work within the app.
Instance Method Summary collapse
-
#getpass(prompt = "Enter remote password: ") ⇒ String
A wrapper function used to request the password from stdin.
-
#group_hosts(grp, conf, conf_file) ⇒ Array
Method for returning hosts from hostgroup.
Instance Method Details
#getpass(prompt = "Enter remote password: ") ⇒ String
A wrapper function used to request the password from stdin.
20 21 22 |
# File 'lib/fissher_conf.rb', line 20 def getpass(prompt="Enter remote password: ") ask(prompt) {|q| q.echo = false} end |
#group_hosts(grp, conf, conf_file) ⇒ Array
Method for returning hosts from hostgroup.
30 31 32 33 34 35 36 |
# File 'lib/fissher_conf.rb', line 30 def group_hosts( grp,conf,conf_file ) if conf[:hostgroups][:"#{grp}"] conf[:hostgroups][:"#{grp}"][:hosts] else abort "Fatal: hostgroup #{grp} not defined in #{conf_file}!\n" end end |