My node manifests are getting rather large. Is there a way I can inline include a file into a node manifest? I''d like to break the node manifest into smaller parts. Note, this is NOT a module include I am looking for. Doug. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Mar 19, 2010, at 4:19 PM, Douglas Garstang wrote:> My node manifests are getting rather large. > > Is there a way I can inline include a file into a node manifest? I''d > like to break the node manifest into smaller parts. Note, this is NOT > a module include I am looking for.I don''t know how to do that, but this might solve your problem. I usually put all or almost all the modules to be included into base classes. Some of these classes include others, and then the nodes include them. This keeps my node definitions small. Here''s an example: class base-loadset { include aptcacher-client #Get apt updates from the apt cache include auto-updates #automatically get updates include base-accounts include base-packages include local-apt include puppet-conf } class client-base-loadset { include base-loadset include ntp-client include student-packages include oaks } class server-base-loadset { include base-loadset include ntp-server include samba-server } node ''basicserver1.domain'', ''basicserver2.domain'', { include server-base-loadset } node ''webserver1.domain'', { include server-base-loadset include apache-server } node ''client1.domain'', ''client2.domain'', { include client-base-loadset } -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
I''ve already broken it down as much as I can. The bottom class is calling the same definition 10 times to set up 10 instances of jboss on a single system, and another definition is running 10 times to setup 10 instances of tomcat on the same server (don''t blame me... it''s the way our software was built). So.... I can''t really subclass that. It would be nice for clarity to break each definition into a separate file however. Poo. Doug. On Fri, Mar 19, 2010 at 4:32 PM, Patrick <kc7zzv@gmail.com> wrote:> On Mar 19, 2010, at 4:19 PM, Douglas Garstang wrote: > >> My node manifests are getting rather large. >> >> Is there a way I can inline include a file into a node manifest? I''d >> like to break the node manifest into smaller parts. Note, this is NOT >> a module include I am looking for. > > I don''t know how to do that, but this might solve your problem. > > I usually put all or almost all the modules to be included into base classes. Some of these classes include others, and then the nodes include them. This keeps my node definitions small. Here''s an example: > > > class base-loadset { > include aptcacher-client #Get apt updates from the apt cache > include auto-updates #automatically get updates > include base-accounts > include base-packages > include local-apt > include puppet-conf > } > > class client-base-loadset { > include base-loadset > > include ntp-client > include student-packages > include oaks > } > > class server-base-loadset { > include base-loadset > > include ntp-server > include samba-server > } > > > > node > ''basicserver1.domain'', > ''basicserver2.domain'', > { > include server-base-loadset > } > > node > ''webserver1.domain'', > { > include server-base-loadset > include apache-server > } > > > node > ''client1.domain'', > ''client2.domain'', > { > include client-base-loadset > } > > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. > >-- Regards, Douglas Garstang http://www.linkedin.com/in/garstang Email: doug.garstang@gmail.com Cell: +1-805-340-5627 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Mar 19, 2010, at 4:36 PM, Douglas Garstang wrote:> I''ve already broken it down as much as I can. The bottom class is > calling the same definition 10 times to set up 10 instances of jboss > on a single system, and another definition is running 10 times to > setup 10 instances of tomcat on the same server (don''t blame me... > it''s the way our software was built). So.... I can''t really subclass > that. It would be nice for clarity to break each definition into a > separate file however. Poo. > > Doug. >I misunderstood the problem. Here''s something else that might be what you want. You can "import" a .pp file. You could put each computer in it''s own computername.pp and include them all in nodes.pp or site.pp. That''s why nodes.pp is read. This would all be in the manifests folder. For instance, putting this: import "nodes" in site.pp will do something closer to what most people think of as "include" than the puppet include. That what you want? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, Mar 19, 2010 at 4:51 PM, Patrick <kc7zzv@gmail.com> wrote:> > On Mar 19, 2010, at 4:36 PM, Douglas Garstang wrote: > >> I''ve already broken it down as much as I can. The bottom class is >> calling the same definition 10 times to set up 10 instances of jboss >> on a single system, and another definition is running 10 times to >> setup 10 instances of tomcat on the same server (don''t blame me... >> it''s the way our software was built). So.... I can''t really subclass >> that. It would be nice for clarity to break each definition into a >> separate file however. Poo. >> >> Doug. >> > > I misunderstood the problem. Here''s something else that might be what you want. You can "import" a .pp file. You could put each computer in it''s own computername.pp and include them all in nodes.pp or site.pp. That''s why nodes.pp is read. This would all be in the manifests folder. For instance, putting this: > > import "nodes" > > in site.pp will do something closer to what most people think of as "include" than the puppet include. That what you want?Patrick, Hmmm.... tried that and it''s doing something weird. I put an import "foo.pp" into my node file, and it looks like puppet is trying to auto import that foo.pp for every single node. ie, I am seeing this... Could not retrieve catalog: Puppet::Parser::AST::Resource failed with error ArgumentError: Duplicate definition: Elements::Customer[tfel0] is already defined in file /etc/puppet/manifests/nodes/fr.xxx.com/foo.pp at line 12; cannot redefine at /etc/puppet/manifests/nodes/fr.xxx.com/app07.pp:175 on node app07.fr.xxx.com The app07.pp file doesn''t even import foo.pp! It''s in app01.pp. Bizarre. Doug -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Mar 19, 2010, at 5:05 PM, Douglas Garstang wrote:> On Fri, Mar 19, 2010 at 4:51 PM, Patrick <kc7zzv@gmail.com> wrote: >> >> On Mar 19, 2010, at 4:36 PM, Douglas Garstang wrote: >> >>> I''ve already broken it down as much as I can. The bottom class is >>> calling the same definition 10 times to set up 10 instances of jboss >>> on a single system, and another definition is running 10 times to >>> setup 10 instances of tomcat on the same server (don''t blame me... >>> it''s the way our software was built). So.... I can''t really subclass >>> that. It would be nice for clarity to break each definition into a >>> separate file however. Poo. >>> >>> Doug. >>> >> >> I misunderstood the problem. Here''s something else that might be what you want. You can "import" a .pp file. You could put each computer in it''s own computername.pp and include them all in nodes.pp or site.pp. That''s why nodes.pp is read. This would all be in the manifests folder. For instance, putting this: >> >> import "nodes" >> >> in site.pp will do something closer to what most people think of as "include" than the puppet include. That what you want? > > Patrick, > > Hmmm.... tried that and it''s doing something weird. I put an import > "foo.pp" into my node file, and it looks like puppet is trying to auto > import that foo.pp for every single node. > > ie, I am seeing this... > > Could not retrieve catalog: Puppet::Parser::AST::Resource failed with > error ArgumentError: Duplicate definition: Elements::Customer[tfel0] > is already defined in file > /etc/puppet/manifests/nodes/fr.xxx.com/foo.pp at line 12; cannot > redefine at /etc/puppet/manifests/nodes/fr.xxx.com/app07.pp:175 on > node app07.fr.xxx.com > > The app07.pp file doesn''t even import foo.pp! It''s in app01.pp. Bizarre. > > DougSounds like a communications problem between us. Here''s a more complete example. Keep in mind that this isn''t making anything much simpler. It just moves it into more files. Also, every node sees every file. site.pp: #global site definitions import "nodes" #end site.pp---------------------- nodes.pp: import "computer1" import "computer2" #end node.pp---------------------- computer1.pp: node ''computer1.domain'' { include module1 include module2 } #end computer1.pp---------------------- computer2.pp: node ''computer2.domain'' { include module2 include module3 } #end computer2.pp---------------------- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 20/03/10 10:19 AM, Douglas Garstang wrote:> My node manifests are getting rather large. > > Is there a way I can inline include a file into a node manifest? I''d > like to break the node manifest into smaller parts. Note, this is NOT > a module include I am looking for.Douglas I recommend the Puppet Dashboard or External Nodes. http://projects.reductivelabs.com/projects/puppet/wiki/External_Nodes Regards James Turnbull - -- Author of: * Pro Linux System Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBS6QdDiFa/lDkFHAyAQKDMgf/er5Y0DXl8BNZP54N0SBrpMMkRX8T4vXe QQ/dX3e4X3AEArwbqeY2fi7tc1tVYpKbfNpZW74/NKFIvMkSt2H6DzkSxu+VyDf8 kLD1JugdJYCdT4iSvpxevOt1EXLHh1VN+IfF3WxxEZQXBH3s3U4wcCw21dqO/goq K6mCzOh7eQ2AhOD35O4iZwICvaOKN+KTuw3hbC5nEVnt6eHbaT1pky0O1bYBVrxc 28SzAmgBQz3jq6AMgRzKhhSQNgaW6/TFMMwQIdaTEmo20hd45h1rSBxKs8ptou5B 4pflmone+KQweSXnBfXAGv2HXIEGvGgWW2Pu95chZhJKHkY8suQZ1g==oKTt -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, Mar 19, 2010 at 5:55 PM, James Turnbull <james@lovedthanlost.net> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 20/03/10 10:19 AM, Douglas Garstang wrote: >> My node manifests are getting rather large. >> >> Is there a way I can inline include a file into a node manifest? I''d >> like to break the node manifest into smaller parts. Note, this is NOT >> a module include I am looking for. > > Douglas > > I recommend the Puppet Dashboard or External Nodes. > > http://projects.reductivelabs.com/projects/puppet/wiki/External_Nodes > > RegardsThanks, but for the simple reason you can''t revision control external nodes, they are just not feasible. Doug. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Douglas Garstang writes: > Thanks, but for the simple reason you can''t revision control external > nodes, they are just not feasible. Wait, what? You can totally implement an external node classifier that takes its data from a version-controlled source. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Another option might be with Foreman, as it keeps track (e.g. an audit trail) of changes to your nodes settings (e.g. classes, parameters etc). Ohad On Sat, Mar 20, 2010 at 2:34 PM, Steven VanDevender <stevev@uoregon.edu>wrote:> Douglas Garstang writes: > > Thanks, but for the simple reason you can''t revision control external > > nodes, they are just not feasible. > > Wait, what? You can totally implement an external node classifier that > takes its data from a version-controlled source. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 20/03/10 5:16 PM, Douglas Garstang wrote:> > Thanks, but for the simple reason you can''t revision control external > nodes, they are just not feasible. >You can easily version control an external node source. Can you expand on why you think you can''t? Have you had a look at the simple examples of classifiers on the wiki? Or as mentioned you could use Dashboard or Foreman. Regards James Turnbull - -- Author of: * Pro Linux System Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBS6T4UCFa/lDkFHAyAQJGMAf/QuygOY/vsebD0aUQltPP6mA32apaJFT8 AaykPTbKScFn+I+stBXF/qOIz24apGwbKAkKbCaaM8CEY7TZvJ5f5sZbEh72eryl dNMoxJN4Lc/tnyPKAr+LE5E0uLWW+3qQMloklwqS6fZiTUjQRmzq1nRKcu5WTj3w PKvw5wjU+J21VsFVVfW1IIX5S+khLU8YwjcXYskj6Yn5j1VKcnx+tMH/E3csXfsS TxI/nK8O3HIBmEwShpyalZQzGieYyjMpcS0Qs79EPr48aY9Ce/3UjLPb1Ifft+ub GTe6MEvUZbJuuEvHvlrFh5oj8ab120XAzFOMy0CFBYXs7y5e29ctXA==pyFr -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Sat, Mar 20, 2010 at 9:31 AM, James Turnbull <james@lovedthanlost.net> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 20/03/10 5:16 PM, Douglas Garstang wrote: >> >> Thanks, but for the simple reason you can''t revision control external >> nodes, they are just not feasible. >> > > You can easily version control an external node source. Can you > expand on why you think you can''t? Have you had a look at the > simple examples of classifiers on the wiki?Particularly the yaml one. We''re using a variant of that with files coming out of version control.> > Or as mentioned you could use Dashboard or Foreman. > > Regards > > James Turnbull > > - -- > Author of: > * Pro Linux System Administration (http://tinyurl.com/linuxadmin) > * Pulling Strings with Puppet (http://tinyurl.com/pupbook) > * Pro Nagios 2.0 (http://tinyurl.com/pronagios) > * Hardening Linux (http://tinyurl.com/hardeninglinux) > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iQEVAwUBS6T4UCFa/lDkFHAyAQJGMAf/QuygOY/vsebD0aUQltPP6mA32apaJFT8 > AaykPTbKScFn+I+stBXF/qOIz24apGwbKAkKbCaaM8CEY7TZvJ5f5sZbEh72eryl > dNMoxJN4Lc/tnyPKAr+LE5E0uLWW+3qQMloklwqS6fZiTUjQRmzq1nRKcu5WTj3w > PKvw5wjU+J21VsFVVfW1IIX5S+khLU8YwjcXYskj6Yn5j1VKcnx+tMH/E3csXfsS > TxI/nK8O3HIBmEwShpyalZQzGieYyjMpcS0Qs79EPr48aY9Ce/3UjLPb1Ifft+ub > GTe6MEvUZbJuuEvHvlrFh5oj8ab120XAzFOMy0CFBYXs7y5e29ctXA=> =pyFr > -----END PGP SIGNATURE----- > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. > >-- nigel -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.