https://bugs.koozali.org/show_bug.cgi?id=12797

bunkobugsy <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |IN_PROGRESS

--- Comment #2 from bunkobugsy <[email protected]> ---
find /etc/e-smith -name "*update-ifcfg*"
/etc/e-smith/events/actions/update-ifcfg
/etc/e-smith/events/bootstrap-console-save/S05update-ifcfg
/etc/e-smith/events/console-save/S05update-ifcfg
/etc/e-smith/events/network-create/S05update-ifcfg
/etc/e-smith/events/network-delete/S05update-ifcfg
/etc/e-smith/events/service-expand/S10update-ifcfg
/etc/e-smith/events/smeserver-service_control-update'/S10update-ifcfg

same seen on https://src.koozali.org/explore/code?q=update-ifcfg&fuzzy=true

so event_link("update-ifcfg-1", $event, "11") should make it run after
update-ifcfg event that also handles cleanup if interface name changed

cat /etc/e-smith/events/actions/update-ifcfg-1
#!/usr/bin/perl -w
use esmith::ConfigDB;
use esmith::templates;
use strict;
my $c = esmith::ConfigDB->open_ro() ||
    die "Couldn't open ConfigDB";
my $ip = $c->get('samba')->prop('SambaIP') || '';
if ($ip ne '') {
my $nic = $c->get('InternalInterface')->prop('Name') || '';
if ($nic ne '') {
    esmith::templates::processTemplate({
        MORE_DATA => { THIS_DEVICE => $nic },
        TEMPLATE_PATH => '/etc/sysconfig/network-scripts/ifcfg-ethX-1',
        OUTPUT_FILENAME => "/etc/sysconfig/network-scripts/ifcfg-$nic:1"
    });
    };
};

cat /etc/e-smith/templates/etc/sysconfig/network-scripts/ifcfg-ethX-1/all
{
    die "Need to pass THIS_DEVICE in MORE_DATA\n" unless (defined
$THIS_DEVICE);
    return "DEVICE=$THIS_DEVICE:1\n" .
    "ONPARENT=on\n" .
    "IPADDR=$samba{SambaIP}\n" .
    "NETMASK=$LocalNetmask";
}

onparent has the advantage that virtual interface will follow onboot of parent
https://wiki.centos.org/TipsAndTricks(2f)VirtualIPAddresses.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Mail for each SME Contribs bug report
To unsubscribe, e-mail [email protected]
Searchable archive at https://lists.contribs.org/mailman/public/contribteam/

Reply via email to