简体   繁体   English

子接口的network网络模块

[英]puppet network module for sub-interface

I am new in puppet and i have just installed network module from razorsedge/network but i don't know where to put ipaddress and netmask info etc. 我是木偶游戏的新手,我刚刚从razorsedge / networking安装了网络模块,但是我不知道在哪里放置ipaddressnetmask信息等。

Here is what i did 这是我所做的

[root@puppetmaster manifests]# ls -l /etc/puppet/modules/network/manifests
total 32
drwxr-xr-x 2 puppet puppet 4096 Jan 16 14:50 alias
-r--r--r-- 1 puppet puppet 1420 Jan 16 15:31 alias.pp
drwxr-xr-x 2 puppet puppet 4096 Jan 16 14:50 bond
drwxr-xr-x 2 puppet puppet 4096 Jan 16 14:50 bridge
-r--r--r-- 1 puppet puppet 2363 Aug 18 20:57 global.pp
drwxr-xr-x 2 puppet puppet 4096 Jan 16 14:50 if
-r--r--r-- 1 puppet puppet 3564 Aug 18 20:57 init.pp
-r--r--r-- 1 puppet puppet 1423 Aug 18 20:57 route.pp

I have edit file alias.pp and put following info end of the file. 我已编辑文件alias.pp ,并将以下信息放在文件末尾。

# define network::alias

network::alias { 'eth0:0':
        ensure    => 'up',
        ipaddress => '10.3.68.98',
        netmask   => '255.255.224.0'
}

my node.pp 我的node.pp

node client01 {
        include ntp
        include network::alias
}

when i am running puppet on client i am getting following error Could not find class network::alias ??? 当我在客户端上运行p时,出现以下错误Could not find class network::alias

[root@client01 ~]# puppet agent --test --noop
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class network::alias for client01 on node client01
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

what i am doing wrong? 我做错了什么?

I have edit file alias.pp and put following info end of the file. 我已编辑文件alias.pp,并将以下信息放在文件末尾。

You don't edit the alias.pp file to create an interface. 您无需编辑alias.pp文件即可创建接口。 You create a network::alias resource in your node definition: 您在节点定义中创建network :: alias资源:

node client01 {
  include ntp
  network::alias { 'eth0:0':
    ensure    => 'up',
    ipaddress => '10.3.68.98',
    netmask   => '255.255.224.0'
  }
}

network::alias is a defined resource, allowing you to create multiple instances of it. network :: alias是已定义的资源,允许您创建它的多个实例。 It's not a class that can be included. 这不是可以包含的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM