Changeset 367 for trunk


Ignore:
Timestamp:
Sep 17, 2018, 9:15:05 PM (6 years ago)
Author:
g7moreau
Message:
  • doc and comment
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r366 r367  
    441441#Nom: add_alias
    442442#Description: ajoute un alias pour une machine. Pour la fonctionnalité CNAME dans le DNS.
     443# Seems not finish and not functional !
    443444
    444445sub add_alias {
     
    580581   exit_on_error_option($help)
    581582      if $hostname   eq ''
    582       or $sector  eq ''
     583      or $sector     eq ''
    583584      or $alias      eq '';
    584585
     
    606607   exit_on_error_option($help)
    607608      if $hostname   eq ''
    608       or $sector  eq ''
     609      or $sector     eq ''
    609610      or $ip         eq ''
    610611      or $mac        eq ''
     
    633634   exit_on_error_option($help)
    634635      if $pool       eq ''
    635       or $sector  eq ''
     636      or $sector     eq ''
    636637      or $mac        eq ''
    637638      or $comment    eq '';
     
    642643
    643644#-------------------------------------------------------------------------------
     645# No DHCP computer, just an entry A in DNS with a real MAC
    644646
    645647sub cmd_add_static {
     
    660662   exit_on_error_option($help)
    661663      if $hostname   eq ''
    662       or $sector  eq ''
     664      or $sector     eq ''
    663665      or $ip         eq ''
    664666      or $mac        eq ''
     
    688690   exit_on_error_option($help)
    689691      if $hostname   eq ''
    690       or $sector  eq ''
     692      or $sector     eq ''
    691693      or $ip         eq ''
    692694      or $comment    eq '';
     
    705707
    706708   my $mac = join ':', 'FF', 'FF', map({sprintf("%02X", $_)} split(/\./, $ip));
    707    control_syntax_mac_address($mac)             or exit;
    708    control_exist_mac($computer_db, $mac)         or die "Error: virtual physical MAC address already exists: $mac\n";
     709   control_syntax_mac_address($mac)       or exit;
     710   control_exist_mac($computer_db, $mac)  or die "Error: virtual physical MAC address already exists: $mac\n";
    709711
    710712   push @{$computer_db->{$sector}}, { $mac => {
     
    716718      'modify_time'  => $timestamp,
    717719      'comment'      => $comment,
     720      'alias'        =>  '',
    718721      }};
    719722   print "Add the virtual computer: $hostname, IP: $ip, sector: $sector\n";
     
    905908   exit_on_error_option($help)
    906909      if $hostname   eq ''
    907       or $sector  eq ''
     910      or $sector     eq ''
    908911      or $ip         eq '';
    909912
     
    928931   exit_on_error_option($help)
    929932      if $hostname   eq ''
    930       or $sector  eq ''
     933      or $sector     eq ''
    931934      or $ip         eq '';
    932935
     
    11201123   my $computer_db = ipamdb_load($COMPUTER_YAML);
    11211124
    1122    if ($type !~ m/^ (dhcp|float|static|virtual) $/xms) {
     1125   if ($type !~ m/^ (dhcp|float|static) $/xms) {
    11231126      die "Error: bad type: $type\n";
    11241127      }
     
    17591762   exit_on_error_option($help)
    17601763      if $pool             eq ''
    1761       or $sector        eq ''
     1764      or $sector           eq ''
    17621765      or $file_pool        eq ''
    17631766      or $ipaddress_pool   eq '';
     
    34933496=head2 add-static
    34943497
     3498Add a static host in the database.
     3499No DHCP configuration will be generated,
     3500only DNS.
     3501
    34953502 ddt add-static [--hostname|-h hostname] [--sector|-s|-d sector] [--ip|-i ip] [--mac|-m mac] [--comment|-c comment]
    34963503
    34973504=head2 add-virtual
    34983505
     3506Add a static host in the database with a virtual MAC address beginning by C<FF:FF:...>.
     3507No DHCP configuration will be generated,
     3508only DNS.
     3509
    34993510 ddt add-virtual [--hostname|-h hostname] [--sector|-s|-d sector] [--ip|-i ip] [--comment|-c comment]
    35003511
Note: See TracChangeset for help on using the changeset viewer.