Ask Your Question
0

what is the exact location of sysidcfg.erb template file for creating solaris zones with puppet

asked 2015-04-08 14:03:48 -0500

crpeck gravatar image

I'm attempting to defines zones in Puppet under Solaris 11.2, according to the docs that I can find i can create a template for the sysidcfg file and reference it. However, I cannot figure out where the template file goes, does it do in the Puppet master or the client, I've tried both. Can you give me a full path and which system to place this file on? Thanks From puppet describe zone:

- **sysidcfg**
The text to go into the `sysidcfg` file when the zone is first
booted.  The best way is to use a template:
# $confdir/modules/site/templates/sysidcfg.erb
    system_locale=en_US
    timezone=GMT
    terminal=xterms
    security_policy=NONE
    root_password=<%= password %>
    timeserver=localhost
    name_service=DNS {domain_name=<%= domain %> name_server=<%=
nameserver %>}
    network_interface=primary {hostname=<%= realhostname %>
      ip_address=<%= ip %>
      netmask=<%= netmask %>
      protocol_ipv6=no
      default_route=<%= defaultroute %>}
    nfs4_domain=dynamic

And then call that:
zone { myzone:
      ip           => "bge0:192.168.0.23",
      sysidcfg     => template("site/sysidcfg.erb"),
      path         => "/opt/zones/myzone",
      realhostname => "fully.qualified.domain.name"
    }

The `sysidcfg` only matters on the first booting of the zone,
so Puppet only checks for it at that time.
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-04-08 21:25:46 -0500

GregLarkin gravatar image

updated 2015-04-08 21:26:43 -0500

The template file (.erb) goes into the templates/ subdirectory of a module that you create. You can read about how the module directories are structured here: https://docs.puppetlabs.com/puppet/la...

Puppet code always lives on the Puppet master, not on any Puppet agent node.

In order to use the zone resource in a module named zonemanager, it might look like this:

#
# This class lives in <moduledir>/zonemanager/manifests/init.pp
#
class zonemanager {
  zone { 'zone 1':
    ensure => running,
    autoboot => true,
    ... other attributes ...
    # The template file lives in <moduledir>/zonemanager/templates/sysidcfg.erb
    sysidcfg => template('zonemanager/sysidcfg.erb'),
  }
}

As the zone resource documentation shows, the sysidcfg.erb file can contain several variables that will be evaluated as the file is configured and used to boot the zone.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-04-08 14:03:48 -0500

Seen: 335 times

Last updated: Apr 08 '15