riccsnet
08/16/2022, 8:19 PM$css_users = hiera('css_users', {})
$css_groups = ['wheel']
}
keys($css_users).each |$this_user| {
if !empty($css_users[$this_user][yubikey]) {
#notify { "${this_user} made it in the if defined block": }
$css_groups = ['wheel', 'yubikeyusers']
}
#notify {"value of css_groups ${this_user}: ${css_groups}": }
@user { $this_user:
ensure => present,
password => "${css_users[$this_user][password]}",
comment => "${css_users[$this_user][comment]}",
managehome => true,
groups => $css_groups,
shell => '/bin/bash',
password_max_age => '-1',
}
}
keys($css_users).each |$this_user| {
User <|title == $this_user |>
}
}
riccsnet
08/16/2022, 8:20 PM$css_users = hiera('css_users', {})
$css_groups = ['wheel']
}
keys($css_users).each |$this_user| {
if !empty($css_users[$this_user][yubikey]) {
#notify { "${this_user} made it in the if defined block": }
$css_groups = ['wheel', 'yubikeyusers']
}
#notify {"value of css_groups ${this_user}: ${css_groups}": }
@user { $this_user:
ensure => present,
password => "${css_users[$this_user][password]}",
comment => "${css_users[$this_user][comment]}",
managehome => true,
groups => $css_groups,
shell => '/bin/bash',
password_max_age => '-1',
}
}
keys($css_users).each |$this_user| {
User <|title == $this_user |>
}
}
binford2k
08/16/2022, 9:16 PMSlackbot
08/16/2022, 10:55 PMAnirudh Ramesh
08/17/2022, 12:26 AMAnirudh Ramesh
08/17/2022, 12:26 AMdimitry
08/17/2022, 2:44 AMdimitry
08/17/2022, 2:48 AMPuppet Evaluation Error: Error while evaluating a Function Call, Class[Profile::Cvmfs::Client]: expects a value for parameter 'my_variable' (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 19, column: 5) on node login1
dimitry
08/17/2022, 2:49 AMclass profile::some_user(
String $my_variable= 'some_string'
)
{
user { $my_variable:
ensure => present,
forcelocal => true,
gid => 'some_gid',
groups => 'some_group',
home => "/${my_variable}",
managehome => true,
notify => Selinux::Exec_restorecon["/${my_variable}"],
uid => 'some_uid',
}
}
)
and then used the function ensure_resources(my_user_class, $my_variable)
within another class in the same moduledimitry
08/17/2022, 2:54 AMclass profile::some_user(
String $my_variable= 'some_string'
)
{
user { $my_variable:
ensure => present,
forcelocal => true,
gid => 'some_gid',
groups => 'some_group',
home => "/${$my_variable}",
managehome => true,
notify => Selinux::Exec_restorecon["/${$my_variable}"],
uid => 'some_uid',
}
}
)
and then used the function `ensure_resources(my_user_class, $my_variable)dimitry
08/17/2022, 2:54 AMPuppet Evaluation Error: Error while evaluating a Function Call, Class[Profile::Some_Class::Client]: expects a value for parameter 'my_variable' (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 19, column: 5) on node login1
dimitry
08/17/2022, 2:54 AMdimitry
08/17/2022, 2:55 AMPuppet Evaluation Error: Error while evaluating a Function Call, Class[Profile::Some_Class::Client]: expects a value for parameter 'my_variable' (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 19, column: 5) on node login1
dimitry
08/17/2022, 2:55 AMdimitry
08/17/2022, 2:55 AMdimitry
08/17/2022, 2:56 AMclass profile::some_user(
String $my_variable= 'some_string'
)
{
user { $my_variable:
ensure => present,
forcelocal => true,
gid => 'some_gid',
groups => 'some_group',
home => "/${$my_variable}",
managehome => true,
notify => Selinux::Exec_restorecon["/${$my_variable}"],
uid => 'some_uid',
}
}
)
and then used the function `ensure_resources(my_user_class, $my_variable)dimitry
08/17/2022, 2:56 AMPuppet Evaluation Error: Error while evaluating a Function Call, Class[Profile::Some_Class::Client]: expects a value for parameter 'my_variable' (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 19, column: 5) on node login1
Slackbot
08/17/2022, 2:59 AMdimitry
08/17/2022, 2:59 AMclass profile::some_user(
String $my_variable= 'some_string'
)
{
user { $my_variable:
ensure => present,
forcelocal => true,
gid => 'some_gid',
groups => 'some_group',
home => "/${$my_variable}",
managehome => true,
notify => Selinux::Exec_restorecon["/${$my_variable}"],
uid => 'some_uid',
}
}
)
and then used the function ensure_resources(my_user_class, $my_variable)
within another class in the same moduleNickB
08/17/2022, 2:59 AM"/${my_variable}"
dimitry
08/17/2022, 2:59 AMensure_resources()
withing the where it was called and did this instead include class profile::some_user
but still complained about the same issue, what is the causedimitry
08/17/2022, 3:01 AMclass profile::some_user(
String $my_variable= 'some_string'
)
{
user { $my_variable:
ensure => present,
forcelocal => true,
gid => 'some_gid',
groups => 'some_group',
home => "/${my_variable}",
managehome => true,
notify => Selinux::Exec_restorecon["/${my_variable}"],
uid => 'some_uid',
}
}
)
and then used the function ensure_resources(my_user_class, $my_variable)
within another class in the same moduledimitry
08/17/2022, 3:02 AMSlackbot
08/17/2022, 3:03 AMdimitry
08/17/2022, 3:03 AMensure_resources()
need a hash,
I define Hash $my_variable
within Profile:Some Class:Client( Hash $my_variable
)dimitry
08/17/2022, 3:04 AMensure_resources()
need a hash,
I define Hash $my_variable
within Profile:Some Class:Client( Hash $my_variable
)NickB
08/17/2022, 3:05 AMensure_resource
dimitry
08/17/2022, 3:06 AMdimitry
08/17/2022, 3:07 AMsite.pp file
dimitry
08/17/2022, 3:09 AM