Changeset 557


Ignore:
Timestamp:
Mar 6, 2010, 7:04:37 PM (12 years ago)
Author:
sebas@…
Message:

agregamos la funcionalidad para generar nombre a las maquinas basado en su mac address

Location:
trunk/puppet/modules/puppet-dnsmasq
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/puppet/modules/puppet-dnsmasq/README

    r556 r557  
    77        dhcp_gw            => '10.11.12.1',
    88        dhcp_nameservers   => '10.11.12.1',
    9         read_ethers        => 'yes',
     9        dhcp_script        => '/usr/local/sbin/dnsmasq-genhostname.sh',
    1010        domain             => 'mon.domaine.exemple.com',
    1111        dhcp_boot          => '/ltsp/i386/pxelinux.0,tftphostname,10.11.12.8',
  • trunk/puppet/modules/puppet-dnsmasq/manifests/init.pp

    r537 r557  
    1010    $dhcp_gw            = 'absent',
    1111    $dhcp_nameservers   = 'absent',
    12     $read_ethers        = 'absent',
     12    $dhcp_script        = 'absent',
    1313    $domain             = 'absent',
    1414    $dhcp_boot          = 'absent',
     
    2020    include dnsmasq
    2121 
    22     file { "/etc/dnsmasq.d/my.dnsmasq.conf":
    23       content => template("dnsmasq/my.dnsmasq.conf.erb"),
    24       owner   => root,
    25       group   => root,
    26       mode    => 644,
    27       require => Package["dnsmasq"],
    28       notify  => Service["dnsmasq"],
    29     }
     22    file {
     23       "/etc/dnsmasq.d/my.dnsmasq.conf":
     24           content => template("dnsmasq/my.dnsmasq.conf.erb"),
     25           owner   => root,
     26           group   => root,
     27           mode    => 644,
     28           require => Package["dnsmasq"],
     29           notify  => Service["dnsmasq"];
     30       "/etc/dnsmasq.hostsfile":
     31           ensure  => exists,
     32           owner   => root,
     33           group   => root,
     34           mode    => 755,
     35           require => Package["dnsmasq"];
     36       "/usr/local/sbin/dnsmasq-genhostname.sh":
     37           source  => "puppet:///dnsmasq/dnsmasq-genhostname.sh"
     38           owner   => root,
     39           group   => root,
     40           mode    => 755,
     41           require => File["/etc/dnsmasq.hostsfile"];
     42     }
    3043   
    3144    service { "dnsmasq":
    32       ensure => running,
    33       hasrestart => true,
    34       hasstatus => true,
    35       require => File["/etc/dnsmasq.d/my.dnsmasq.conf"],
     45        ensure => running,
     46        hasrestart => true,
     47        hasstatus => true,
     48        require => File["/etc/dnsmasq.d/my.dnsmasq.conf"],
    3649    }
    3750
  • trunk/puppet/modules/puppet-dnsmasq/templates/my.dnsmasq.conf.erb

    r536 r557  
    3131<% end -%>
    3232
    33 <% if read_ethers != 'absent' -%>
    34 # Dnsmasq will read /etc/ethers and act
    35 # on the ethernet-address/IP pairs found there just as if they had
    36 # been given as --dhcp-host options. Useful if you keep
    37 # MAC-address/host mappings there for other purposes.
    38 read-ethers
     33<% if dhcp_script != 'absent' -%>
     34# Run an executable when a DHCP lease is created or destroyed.
     35# The arguments sent to the script are "add" or "del",
     36# then the MAC address, the IP address and finally the hostname
     37# if there is one.
     38dhcp-script=<%= dhcp_script %>
    3939<% end -%>
    4040
Note: See TracChangeset for help on using the changeset viewer.