此示例应该通过将审核参数添加或设置为 1 来更改每个标题栏中的内核行。如果只有一个标题栏,它可以正常工作,但如果有多个标题栏,则它不会执行任何操作。我错过了什么吗?
傀儡师
augeas-libs.x86_64 1.0.0-5.el6_5.1 @updates
puppet.noarch 2.7.25-2.el6 @epel-6server
puppet-server.noarch 2.7.25-2.el6 @epel-6server
ruby-augeas.x86_64 0.4.1-1.el6 @epel-6server
木偶客户端
yum list installed |grep -i "augeas|puppet"
augeas-libs.x86_64 1.0.0-10.el6 @anaconda-CentOS-201703281317.x86_64/6.9
puppet.noarch 2.7.26-2.el6 @add-ons_6.9
ruby-augeas.x86_64 0.4.1-1.el6 @epel-6server_6.9
我的班级
augeas {
'grub':
context => '/files/etc/grub.conf',
lens => 'grub.lns',
incl => '/etc/grub.conf',
changes => [
'set title[*]/kernel/audit 1',
];
}
我的 grub 文件
sudo cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg00-root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
password --encrypted $1$QWxxyxxyxxyxxyx$0eCHxd/
title CentOS (2.6.32-696.23.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-696.23.1.el6.x86_64 ro root=/dev/mapper/vg00-root rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg00/swap LANG=en_US.UTF-8 rd_LVM_LV=vg00/root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto quite rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-696.23.1.el6.x86_64.img
title CentOS 6 (2.6.32-696.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-696.el6.x86_64 ro root=/dev/mapper/vg00-root rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg00/swap LANG=en_US.UTF-8 rd_LVM_LV=vg00/root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto quite rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-696.el6.x86_64.img
Puppet Augeas 的文档暗示set
只设置单个键的值。有一个用于更改多个节点的setm
命令。
https://puppet.com/docs/puppet/5.1/types/augeas.html