sheikh
02/01/2023, 5:14 PMbindkey "^D" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'
bind "^M" quit
How to adopt in below manifest file or any different way? Thanks
file {'/etc/screenrc':
ensure => 'file',
}
file_line {'':
path => '/etc/screenrc',
line => '',
require => File['/etc/screenrc'],
}Corporate Gadfly
02/01/2023, 6:02 PMfacter -p output, I still see the following, even though I have memory.swap.used* in the blocklist:
memory => {
swap => {
available_bytes => 3883233280,
total => "4.00 GiB",
total_bytes => 4294963200,
used_bytes => 411729920
},
system => {
available_bytes => 1616789504,
total => "11.43 GiB",
total_bytes => 12273041408,
used_bytes => 10656251904
}
}Corporate Gadfly
02/01/2023, 6:06 PM"memory.swap.used"
"memory.swap.used_bytes"
And the output from facter -p changed to:
memory => {
swap => {
available => "3.62 GiB",
total => "4.00 GiB",
total_bytes => 4294963200
},
system => {
available => "1.51 GiB",
total => "11.43 GiB",
total_bytes => 12273041408
}
}Corporate Gadfly
02/01/2023, 6:07 PM"memory.swap.used"
"memory.swap.used_bytes"
And the output from facter -p changed to:
memory => {
swap => {
available => "3.62 GiB",
total => "4.00 GiB",
total_bytes => 4294963200
},
system => {
available => "1.51 GiB",
total => "11.43 GiB",
total_bytes => 12273041408
}
}Corporate Gadfly
02/01/2023, 6:07 PM"memory.swap.used"
"memory.swap.used_bytes"
and the output from facter -p changed to:
memory => {
swap => {
available => "3.62 GiB",
total => "4.00 GiB",
total_bytes => 4294963200
},
system => {
available => "1.51 GiB",
total => "11.43 GiB",
total_bytes => 12273041408
}
}Corporate Gadfly
02/01/2023, 6:08 PM"memory.system.used",
"memory.system.used_bytes",
"memory.swap.used",
"memory.swap.used_bytes",
and the output from facter -p changed to:
memory => {
swap => {
available => "3.62 GiB",
total => "4.00 GiB",
total_bytes => 4294963200
},
system => {
available => "1.51 GiB",
total => "11.43 GiB",
total_bytes => 12273041408
}
}Corporate Gadfly
02/01/2023, 6:11 PM/etc/puppetlabs/facter/facter.conf to block unwanted facts:
facts : {
blocklist : [
"file system",
"load_averages",
"identity",
"memory.system.capacity",
"memory.system.used",
"memory.system.used_bytes",
"memory.system.available",
"memory.system.available_bytes",
"memory.swap.capacity",
"memory.swap.used",
"memory.swap.used_bytes",
"memory.swap.available",
"memory.swap.available_bytes",
"system_uptime",
]
}
Hope that helps.Corporate Gadfly
02/01/2023, 6:16 PM"memory.system.used",
"memory.system.used_bytes",
"memory.swap.used",
"memory.swap.used_bytes",
and the output from facter -p changed to:
memory => {
swap => {
available => "3.62 GiB",
total => "4.00 GiB",
total_bytes => 4294963200
},
system => {
available => "1.51 GiB",
total => "11.43 GiB",
total_bytes => 12273041408
}
}
and you can see used and used_bytes is no longer there.natemccurdy
02/01/2023, 6:18 PMnatemccurdy
02/01/2023, 6:20 PMfacter osjballiet
02/01/2023, 7:16 PMvchepkov
02/01/2023, 8:50 PMwarning:[Puppet]: Fact value '#!/bin/bash
...
with the value length: '4772' exceeds the value length limit: 4096
I think fact name instead of the whole value printed in log would be more useful. especially since that fact can have a sensitive datavchepkov
02/01/2023, 8:51 PMsheikh
02/01/2023, 8:52 PMbindkey "^D" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'
bind "^M" quit
How to adopt in below manifest file or any different way? Thanks
file { '/etc/screenrc':
ensure => file,
content => "hello\nworld\n",
}sheikh
02/01/2023, 9:23 PMsheikh
02/01/2023, 9:23 PMsheikh
02/01/2023, 9:33 PMdefscrollback 30000
bindkey "^C" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'
bindkey "^D" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'
bind "^M" quit
How to adopt in below manifest file or any different way? Thanks
file { '/etc/screenrc':
ensure => file,
append => "defscrollback 30000\nbindkey \"^C\" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'\nbindkey \"^D\" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'\nbind \"^M\" quit\n",
}sheikh
02/01/2023, 10:22 PMSlackbot
02/01/2023, 10:24 PMsheikh
02/01/2023, 10:27 PM$contents = file('/etc/screenrc')
$new_contents = "${contents}defscrollback 30000\nbindkey \"^C\" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'\nbindkey \"^D\" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'\nbind \"^M\" quit\n"
file { '/etc/screenrc':
content => $new_contents,
ensure => file,
}
Output:
# #shelltitle ' |zsh'
# #shelltitle '> |csh'
# #shelltitle '$ |bash'
defscrollback 30000
bindkey "^C" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'
bindkey "^D" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]'
bind "^M" quit
But when running manifest file again, then content added two times, how to prevent this or something to verify if same content there not add it again.
thanksSlackbot
02/01/2023, 11:18 PMCorporate Gadfly
02/02/2023, 1:04 AM"memory.system.used",
"memory.system.used_bytes",
"memory.swap.used",
"memory.swap.used_bytes",
and the output from facter -p changed to:
memory => {
swap => {
available => "3.62 GiB",
total => "4.00 GiB",
total_bytes => 4294963200
},
system => {
available => "1.51 GiB",
total => "11.43 GiB",
total_bytes => 12273041408
}
}
and you can see used and used_bytes are no longer there.sheikh
02/02/2023, 7:25 AMcanihavethisone
02/02/2023, 9:17 AMany to work:
unless (Enum[$k] in $valid_sections) {
fail("Invalid section '${k}' in '${key}' hash. Verify the section is valid and in correct CaSe")
}pig
02/02/2023, 9:45 AMscope in the template I get the following error (it doesn't matter if it has ::sensitive or not, I always get the same error):
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: A substring operation does not accept a String as a character index. Expected an Integer
It doesn't matter if I pass the variables as parameters of the epp function in the manifest, or if I use the name with the full scope of the variable, I get also the same error). The only way I can make it work is with the $::module::variable syntax (or $variable if I pass it as a parameter) but then I can't mark the value as sensitive in the epp template. Anyone can give me a hand with this please š ? (I'm using Puppet 7 too)Slackbot
02/02/2023, 9:54 AMDavid Sandilands
02/02/2023, 9:56 AMSlackbot
02/02/2023, 12:39 PMSlackbot
02/02/2023, 1:16 PMbastelfreak
02/02/2023, 1:28 PMfile { '/etc/screenrc':
content => file("${module_name}/configs/screenrc"),
}
and put the file at files/configs/screenrc in your module