[iyunv@sh-web1 ~]# puppet agent -t
Notice: Ignoring --listen on onetime run
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for sh-web1.localdomain
Info: Applying configuration version '1505927717'
Notice: /Stage[main]/Admin/Exec[selinux]/returns: executed successfully
Notice: hostip is 11
Notice: /Stage[main]/Main/Node[sh-proxywebd]/Notify[hostip is 11]/message: defined 'message' as 'hostip is 11'
Notice: Finished catalog run in 0.26 seconds
乘法运算:
1
2
$content=7 * 4
notify {"hostip is $content":}
agent端更新:
1
2
3
4
5
6
7
8
9
10
[iyunv@sh-web1 ~]# puppet agent -t
Notice: Ignoring --listen on onetime run
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for sh-web1.localdomain
Info: Applying configuration version '1505927786'
Notice: /Stage[main]/Admin/Exec[selinux]/returns: executed successfully
Notice: hostip is 28
Notice: /Stage[main]/Main/Node[sh-proxywebd]/Notify[hostip is 28]/message: defined 'message' as 'hostip is 28'
Notice: Finished catalog run in 0.29 seconds
取余运算:
1
2
$content=7 % 4
notify {"hostip is $content":}
agent端更新:
1
2
3
4
5
6
7
8
9
10
[iyunv@sh-web1 ~]# puppet agent -t
Notice: Ignoring --listen on onetime run
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for sh-web1.localdomain
Info: Applying configuration version '1505927969'
Notice: /Stage[main]/Admin/Exec[selinux]/returns: executed successfully
Notice: hostip is 3
Notice: /Stage[main]/Main/Node[sh-proxywebd]/Notify[hostip is 3]/message: defined 'message' as 'hostip is 3'
Notice: Finished catalog run in 0.27 seconds
除法运算:
1
2
$content=7 / 4
notify {"hostip is $content":}
agent端更新:
1
2
3
4
5
6
7
8
9
10
[iyunv@sh-web1 ~]# puppet agent -t
Notice: Ignoring --listen on onetime run
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for sh-web1.localdomain
Info: Applying configuration version '1505928069'
Notice: /Stage[main]/Admin/Exec[selinux]/returns: executed successfully
Notice: hostip is 1
Notice: /Stage[main]/Main/Node[sh-proxywebd]/Notify[hostip is 1]/message: defined 'message' as 'hostip is 1'
Notice: Finished catalog run in 0.29 seconds
浮点数类型运算:
1
2
$content=7 + 0.4
notify {"hostip is $content":}
agent端更新:
1
2
3
4
5
6
7
8
9
10
[iyunv@sh-web1 ~]# puppet agent -t
Notice: Ignoring --listen on onetime run
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for sh-web1.localdomain
Info: Applying configuration version '1505927886'
Notice: /Stage[main]/Admin/Exec[selinux]/returns: executed successfully
Notice: hostip is 7.4
Notice: /Stage[main]/Main/Node[sh-proxywebd]/Notify[hostip is 7.4]/message: defined 'message' as 'hostip is 7.4'
Notice: Finished catalog run in 0.27 seconds
[iyunv@sh-web1 yum.repos.d]# puppet agent -t
Notice: Ignoring --listen on onetime run
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for sh-web1.localdomain
Info: Applying configuration version '1506077242'
Notice: /Stage[main]/Admin/Exec[selinux]/returns: executed successfully
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y list phpphp-devel' returned 1: Error: No matching Packages to list
Error: /Stage[main]/Php/Package[phpphp-devel]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y list phpphp-devel' returned 1: Error: No matching Packages to list
Notice: Finished catalog run in 1.01 seconds
[iyunv@sh-web1 ~]# puppet apply 2.pp
Notice: Scope(Class[main]): two
Notice: Compiled catalog for sh-web1.localdomain in environment production in 0.02 seconds
Notice: Finished catalog run in 0.01 seconds
[iyunv@sh-web1 ~]# puppet apply 2.pp
Notice: Scope(Class[main]): 2
Notice: Compiled catalog for sh-web1.localdomain in environment production in 0.02 seconds
Notice: Finished catalog run in 0.02 seconds