Theforeman snippets

Hi,

I would like to know how where I can import snippet through theforeman as
shown in the following blog?

etc-host snippet - Where to import or placed in ?

It seems that the blog did not indicate where or how I should deal with the
snippets?

AlanC

Hello,

not sure what you mean, read the article carefully. All the required
snippets are either in the article, or distributed with Foreman itself
(you will find all the snippets in the Provisioning Templates section of
your instance).

The etc-host snippet is used in the template using this code:

cat > /etc/hosts << EOF
<%= snippets "etc-hosts" %>
EOF
<% end -%>

That's how you use snippets.

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

Hi Lukas,

The provisioning template was set up using the blog as a reference.

With reference to the following,

cat > /etc/hosts << EOF 
<%= snippets "etc-hosts" %> 
EOF 
<% end -%> 

"cats /etc/hosts", may I know where should I place the host file in ? Is
this some where that can be done via foreman or puppet?

AlanC

Snippets are a type of template. Simply create a new template, give it a
name of "etc-hosts" and tick the "Snippet" checkbox.

HTH,
Greg

··· On 20 August 2013 10:51, AlanC wrote:

Hi Lukas,

The provisioning template was set up using the blog as a reference.

With reference to the following,

cat > /etc/hosts << EOF
<%= snippets "etc-hosts" %>
EOF
<% end -%>

“cats /etc/hosts”, may I know where should I place the host file in ? Is
this some where that can be done via foreman or puppet?

Alan,

what you see here is a provisioning (or finish) template which is
executed during provisioning phase. Therefore, yes, Foreman takes care
deploying that.

Not sure what you ask. Where should you place what? Hosts file?

LZ

··· On Tue, Aug 20, 2013 at 02:51:40AM -0700, AlanC wrote: > Hi Lukas, > > The provisioning template was set up using the blog as a reference. > > With reference to the following, > > cat > /etc/hosts < <%= snippets "etc-hosts" %> > EOF > <% end -%> > > "cats /etc/hosts", may I know where should I place the host file in ? Is > this some where that can be done via foreman or puppet? > > AlanC > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com. > To post to this group, send email to foreman-users@googlegroups.com. > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/groups/opt_out.


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman