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