External Nodes
Version 1 (Ohad Levy, 09/08/2009 04:58 am)
| 1 | 1 | Torque can act as a classifier to Puppet through the external nodes interface. |
|
|---|---|---|---|
| 2 | 1 | ||
| 3 | 1 | h1. Import your environment and classes setup |
|
| 4 | 1 | ||
| 5 | 1 | First of all, you probably want to let Torque know about your setup, its recommended to automatically import your Environments and classes by: |
|
| 6 | 1 | ||
| 7 | 1 | <pre> |
|
| 8 | 1 | rake puppet:import:puppet_classes RAILS_ENV=production |
|
| 9 | 1 | </pre> |
|
| 10 | 1 | ||
| 11 | 1 | If you prefer, you may manually add classes through the setting page, however, the class names must match Puppet classes. |
|
| 12 | 1 | ||
| 13 | 1 | ||
| 14 | 1 | h1. Define classes and variables per host |
|
| 15 | 1 | ||
| 16 | 1 | You can define per host, classes and variables(parameters), simply create/edit a host, and select its classes. |
|
| 17 | 1 | if you see an empty list, make sure that you do have classes (as define in the step above). |
|
| 18 | 1 | ||
| 19 | 1 | If you want to add variables(parameters), simply add them in the same page as a set name and value. |
|
| 20 | 1 | ||
| 21 | 1 | h1. Host Groups |
|
| 22 | 1 | ||
| 23 | 1 | Torque allows you to group classes, into common groups similar to node inheritances in puppet |
|
| 24 | 1 | Each group can contain many classes, and variables. |
|
| 25 | 1 | ||
| 26 | 1 | If you wish to override the parameters for a specific host, create a parameter with the same name in the host level, |
|
| 27 | 1 | Torque will override the values defined in the group level. |
|
| 28 | 1 | ||
| 29 | 1 | ||
| 30 | 1 | h1. Other places you can define parameters |
|
| 31 | 1 | ||
| 32 | 1 | It is also possible to define default (common)) parameters for all of your hosts (setting -> Global parameters). |
|
| 33 | 1 | Additionally, you can also define them on the domain level (settings -> Domain -> Domain Parameters) |
|
| 34 | 1 | ||
| 35 | 1 | *The order where the parameters are processed is: |
|
| 36 | 1 | Global, Domain, Host Group and Node, the last occurrence of the parameter will be the one used. |
|
| 37 | 1 | * |
|
| 38 | 1 | ||
| 39 | 1 | h1. Example puppet script |
|
| 40 | 1 | ||
| 41 | 1 | under the <b>extras/externalnodes</b> directory you would find an example script to query Torque DB. |
|
| 42 | 1 | ||
| 43 | 1 | You would need to setup puppet to use external nodes |
|
| 44 | 1 | <pre> external_nodes = /etc/puppet/node.rb |
|
| 45 | 1 | node_terminus = exec</pre> |
|
| 46 | 1 | For additional info please see "Puppet documentation":http://reductivelabs.com/trac/puppet/wiki/ExternalNodes |
|
| 47 | 1 | ||
| 48 | 1 | h1. Verify your setup |
|
| 49 | 1 | ||
| 50 | 1 | You may also click on the YAML link to see the output that would be used for puppet external nodes. |
