Puppet Local Account Notify Issue

7 views
Skip to first unread message

Shivayogi Kamat

unread,
Sep 26, 2016, 12:31:16 AM9/26/16
to Puppet Users
user { 'acc1':
  ensure          => present,
  managehome      => true,
  password        => 'Test123',
  groups          => ['Administrators'],
  auth_membership => 'minimum',
  notify          => Exec['app config']
}

exec { 'app config':
  path        => 'c:\\program files (x86)\\app\\bin',
  command     => 'config.bat -f responsefile.rsp',
  refreshonly => true,
}

The user is getting created, but I need the local account to be used for the app configuration.

The above puppet script is executed by domain account abc\myname, and the application requires a local account to be used for the configuration.


So I have created a local account through puppet and using notify to tell exec to use the account created by the puppet. But when it is executed, the application is throwing error: need a local account or administrator

In logs the error is myname is not a local account or administrator.


I see that exec is not using the local user acc1 created by puppet.


Is there any other way wherein I can direct the exec to use a particular local user account to use for configuration.

Please advise

Martin Alfke

unread,
Sep 26, 2016, 2:47:42 AM9/26/16
to puppet...@googlegroups.com

> On 26 Sep 2016, at 06:31, Shivayogi Kamat <yogisd...@gmail.com> wrote:
>
> user { 'acc1':
> ensure => present,
> managehome => true,
> password => 'Test123',
> groups => ['Administrators'],
> auth_membership => 'minimum',
> notify => Exec['app config']
> }
>
> exec { 'app config':
> path => 'c:\\program files (x86)\\app\\bin',
> command => 'config.bat -f responsefile.rsp',
> refreshonly => true,
>
> }

The exec resource type has the user attribute:

- **user**
The user to run the command as. Note that if you
use this then any error output is not currently captured. This
is because of a bug within Ruby. If you are using Puppet to
create this user, the exec will automatically require the user,
as long as it is specified by name.

hth,
Martin

>
> The user is getting created, but I need the local account to be used for the app configuration.
>
> The above puppet script is executed by domain account abc\myname, and the application requires a local account to be used for the configuration.
>
>
>
> So I have created a local account through puppet and using notify to tell exec to use the account created by the puppet. But when it is executed, the application is throwing error: need a local account or administrator
>
> In logs the error is myname is not a local account or administrator.
>
>
>
> I see that exec is not using the local user acc1 created by puppet.
>
>
>
> Is there any other way wherein I can direct the exec to use a particular local user account to use for configuration.
>
> Please advise
>
>
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/bde11996-9c41-44b5-8cee-d8043a147ff3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages