NickB
08/17/2022, 3:12 AMclass bar(
String $param = 'value',
)
{
class { 'foo':
<foo's params>
}
}
NickB
08/17/2022, 3:13 AMclass bar(
String $param = 'value',
) {
class { 'foo':
<foo's params>
}
NickB
08/17/2022, 3:13 AMclass bar(
String $param = 'value',
)
{
class { 'foo':
<foo's params>
}
}
NickB
08/17/2022, 3:13 AMclass bar(
String $param = 'value',
)
{
class { 'foo':
<foo's params>
}
}
dimitry
08/17/2022, 3:28 AMdimitry
08/17/2022, 3:29 AMclass bar(
String $param = 'value',
)
{
class { 'foo':
<foo's $params>
}
}
dimitry
08/17/2022, 3:30 AMdimitry
08/17/2022, 3:34 AMclass profille::some_stuff(String $reference_to_user_class){
}
class user: {
user { 'you':
uid => 'some_value',
gid => 'some_gid',
group => 'some_group',
home => '/you'
}
}
dimitry
08/17/2022, 3:34 AMclass profille::some_stuff
dimitry
08/17/2022, 3:40 AMNickB
08/17/2022, 3:42 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use classes and types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how some of this stuff works and files are laid out.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, there must be something strange going on in some other manifest that’s trying to use this class, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here. There should be no other user
resources with the same title (in the example above, whatever the value of $my_user
is), including using ensure_resource
with that name (unless you provide the exact parameters declared in the other place you are using that resource, but I would probably just avoid using ensure_resource unless you really need it).NickB
08/17/2022, 3:43 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to get up to speed on all this. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how the Puppet language works.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, you’ve got some duplicate declarations (resources with the same name) going on in some other manifest, perhaps.NickB
08/17/2022, 3:55 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use these types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how the Puppet language works.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, you’ve got some duplicate declarations (resources with the same name) going on in some other manifest, perhaps.NickB
08/17/2022, 3:57 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use these types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how the Puppet language works.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, you’ve got some duplicate declarations (resources with the same name) going on in some other manifest, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here.NickB
08/17/2022, 3:58 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use classes and types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how the Puppet language works.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, you’ve got some duplicate declarations (resources with the same name) going on in some other manifest, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here.dimitry
08/17/2022, 3:59 AMNickB
08/17/2022, 3:59 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use classes and types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how the Puppet language works.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, you’ve got some duplicate declarations (resources with the same name) going on in some other manifest, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here. There should be no other user
resources with the same title (in this case, whatever the value of $my_user
is), including using ensure_resource
with that name.NickB
08/17/2022, 4:00 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use classes and types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how some of this stuff works and files are laid out.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, you’ve got some duplicate declarations (resources with the same name) going on in some other manifest, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here. There should be no other user
resources with the same title (in this case, whatever the value of $my_user
is), including using ensure_resource
with that name.NickB
08/17/2022, 4:03 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use classes and types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how some of this stuff works and files are laid out.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, you’ve got some duplicate declarations (resources with the same name) going on in some other manifest, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here. There should be no other user
resources with the same title (in the example above, whatever the value of $my_user
is), including using ensure_resource
with that name.NickB
08/17/2022, 4:04 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use classes and types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how some of this stuff works and files are laid out.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, there must be something strange going on in some other manifest that’s trying to use this class, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here. There should be no other user
resources with the same title (in the example above, whatever the value of $my_user
is), including using ensure_resource
with that name.NickB
08/17/2022, 4:09 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use classes and types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how some of this stuff works and files are laid out.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, there must be something strange going on in some other manifest that’s trying to use this class, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here. There should be no other user
resources with the same title (in the example above, whatever the value of $my_user
is), including using ensure_resource
with that name (unless you provide the exact parameters declared in the other place you are using that resource, but I probably just avoid using ensure_resource).NickB
08/17/2022, 4:09 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use classes and types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how some of this stuff works and files are laid out.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, there must be something strange going on in some other manifest that’s trying to use this class, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here. There should be no other user
resources with the same title (in the example above, whatever the value of $my_user
is), including using ensure_resource
with that name (unless you provide the exact parameters declared in the other place you are using that resource, but I would probably just avoid using ensure_resource).NickB
08/17/2022, 4:10 AMuser
is not a class, it’s a resource type. I’d suggest scouring https://puppet.com/docs/puppet/7/puppet_language.html to see how to use classes and types. Also, https://puppet.com/try-puppet/puppet-learning-vm/ is a bit more Puppet Enterprise-based, but you can get an idea of how some of this stuff works and files are laid out.
class profile::some_stuff(
String $my_user = 'default_username',
)
{
user { $my_user:
home => "/${my_user}",
}
}
Should work. If it doesn’t, there must be something strange going on in some other manifest that’s trying to use this class, perhaps. What you had before seemed right besides the typo, so there must be other manifests in play here. There should be no other user
resources with the same title (in the example above, whatever the value of $my_user
is), including using ensure_resource
with that name (unless you provide the exact parameters declared in the other place you are using that resource, but I would probably just avoid using ensure_resource unless you really need it).dimitry
08/17/2022, 4:12 AMclass some::other::class( has $user){
...
# Creates the resource if it does not exist, update if needed otherwise do nothing
ensure_resources(profile::some_user, $user)
}
Define after second class above
class 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',
}
}
dimitry
08/17/2022, 4:13 AMNickB
08/17/2022, 4:14 AMclass some::other::class(
String $user,
) {
class { 'profile::some_user':
my_variable => $user,
}
}
NickB
08/17/2022, 4:14 AMclass some::other::class(
String $user,
) {
class { 'profile::some_user':
my_variable => $user,
}
}
NickB
08/17/2022, 4:15 AMnode mynode {
class { 'some::other::class':
user => 'the_user_i_want_to_create',
}
}
NickB
08/17/2022, 4:27 AMnode mynode {
class { 'some::other::class':
user => 'the_user_i_want_to_create',
}
}
NickB
08/17/2022, 4:34 AMensure_resource('class', 'profile::some_user', { my_variable => $user })
would probably work in your main class