Puppet Local Account Notify Issue

心不动则不痛 提交于 2019-12-12 05:09:46

问题


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.


回答1:


Specify user => 'acc1' in the exec resource: Resource Type Reference: exec: user.

So I have created a local account through puppet and using notify to tell exec to use the account created by the puppet.

The notify is a ordering and refreshing mechanic - when resource A notifies resource B, no information is carried between them other than an update to resource B is required. It doesn't specify that resource B uses resource A necessarily, it doesn't inherit any properties from the resource A.



来源:https://stackoverflow.com/questions/39653659/puppet-local-account-notify-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!