Re: Solaris (sparc and i86) error while password change

Yeah, this re-broke sometime since Chef 10. I submitted a couple of fixes
to ohai and chef to make this work again, which will be in the 11.14.0
release.

-Cam

On Tue, Jul 15, 2014 at 2:21 PM, karthik kumar kumarkarthikn@gmail.com
wrote:

Hi,
My recipe to update root password,

user 'root' do

password '$1$xRttNfmg$kiGAjD0nRQkFXyE5432ci'

end

throws this error, BUT /etc/shadow file is updated properly

chef-solo -c client.rb -j runlist.json

Starting Chef Client, version 11.12.8

Compiling Cookbooks...

Converging 1 resources

Recipe: base::default

  • user[root] action create (up to date)

================================================================================

Error executing action create on resource 'user[root]'

================================================================================

......

Ran ["usermod", "root"] returned 2

[2014-07-15T11:01:20-07:00] FATAL: Chef::Exceptions::ChildConvergeError:
Chef run process exited unsuccessfully (exit code 1)

checking the code,
chef-11.12.8/lib/chef/provider/user/solaris.rb

def manage_user

manage_password  ->  write_shadow_file                 *# WORKS GOOD*

*super*
  *# parent's shell_out fails*

end

chef-11.12.8/lib/chef/provider/user/useradd.rb

def manage_user

.....

shell_out!(*command)                                             *#

command CONTAINS ["usermod", "root"] fails with return code non-zero*

end

I think this is same as

https://tickets.opscode.com/browse/CHEF-1707

and it says Resolution:Fixed,

Can somebody advice if I am doing anything wrong ? Is there a
workaround for this ? should I write lwrp/provider of my own ? Please
advice.

Can you advice what workaround I can do for the time being.?
On 16-Jul-2014 12:34 am, "Cameron Cope" chef@camcope.me wrote:

Yeah, this re-broke sometime since Chef 10. I submitted a couple of fixes
to ohai and chef to make this work again, which will be in the 11.14.0
release.

-Cam

On Tue, Jul 15, 2014 at 2:21 PM, karthik kumar kumarkarthikn@gmail.com
wrote:

Hi,
My recipe to update root password,

user 'root' do

password '$1$xRttNfmg$kiGAjD0nRQkFXyE5432ci'

end

throws this error, BUT /etc/shadow file is updated properly

chef-solo -c client.rb -j runlist.json

Starting Chef Client, version 11.12.8

Compiling Cookbooks...

Converging 1 resources

Recipe: base::default

  • user[root] action create (up to date)

================================================================================

Error executing action create on resource 'user[root]'

================================================================================

......

Ran ["usermod", "root"] returned 2

[2014-07-15T11:01:20-07:00] FATAL: Chef::Exceptions::ChildConvergeError:
Chef run process exited unsuccessfully (exit code 1)

checking the code,
chef-11.12.8/lib/chef/provider/user/solaris.rb

def manage_user

manage_password  ->  write_shadow_file                 *# WORKS GOOD*

*super*
  *# parent's shell_out fails*

end

chef-11.12.8/lib/chef/provider/user/useradd.rb

def manage_user

.....

shell_out!(*command)                                             *#

command CONTAINS ["usermod", "root"] fails with return code non-zero*

end

I think this is same as

https://tickets.opscode.com/browse/CHEF-1707

and it says Resolution:Fixed,

Can somebody advice if I am doing anything wrong ? Is there a
workaround for this ? should I write lwrp/provider of my own ? Please
advice.

The easiest thing would be to install the 11.14.0 release candidate.
Otherwise you'll have to hunt for an old version that works (I think it's
been broken since at least 11.6.x, but I don't know if there were any
working 11.x builds at all).

-Cam
On Jul 15, 2014 11:15 PM, "karthik kumar" kumarkarthikn@gmail.com wrote:

Can you advice what workaround I can do for the time being.?
On 16-Jul-2014 12:34 am, "Cameron Cope" chef@camcope.me wrote:

Yeah, this re-broke sometime since Chef 10. I submitted a couple of fixes
to ohai and chef to make this work again, which will be in the 11.14.0
release.

-Cam

On Tue, Jul 15, 2014 at 2:21 PM, karthik kumar kumarkarthikn@gmail.com
wrote:

Hi,
My recipe to update root password,

user 'root' do

password '$1$xRttNfmg$kiGAjD0nRQkFXyE5432ci'

end

throws this error, BUT /etc/shadow file is updated properly

chef-solo -c client.rb -j runlist.json

Starting Chef Client, version 11.12.8

Compiling Cookbooks...

Converging 1 resources

Recipe: base::default

  • user[root] action create (up to date)

================================================================================

Error executing action create on resource 'user[root]'

================================================================================

......

Ran ["usermod", "root"] returned 2

[2014-07-15T11:01:20-07:00] FATAL: Chef::Exceptions::ChildConvergeError:
Chef run process exited unsuccessfully (exit code 1)

checking the code,
chef-11.12.8/lib/chef/provider/user/solaris.rb

def manage_user

manage_password  ->  write_shadow_file                 *# WORKS

GOOD*

*super*
    *# parent's shell_out fails*

end

chef-11.12.8/lib/chef/provider/user/useradd.rb

def manage_user

.....

shell_out!(*command)                                             *#

command CONTAINS ["usermod", "root"] fails with return code non-zero*

end

I think this is same as

https://tickets.opscode.com/browse/CHEF-1707

and it says Resolution:Fixed,

Can somebody advice if I am doing anything wrong ? Is there a
workaround for this ? should I write lwrp/provider of my own ? Please
advice.

Thanks Cameron,
Just curious do you know what is the fix for this. Do you have the pull
request reference for this change ?

I checked this
https://github.com/opscode/chef/commit/c6b52cd6e1900a0127d791cbb8241e14da6fc989
got
from bug https://tickets.opscode.com/browse/CHEF-1707 the platform.rb
and solaris.rb are the same

On Wed, Jul 16, 2014 at 11:12 PM, Cameron Cope chef@camcope.me wrote:

The easiest thing would be to install the 11.14.0 release candidate.
Otherwise you'll have to hunt for an old version that works (I think it's
been broken since at least 11.6.x, but I don't know if there were any
working 11.x builds at all).

-Cam
On Jul 15, 2014 11:15 PM, "karthik kumar" kumarkarthikn@gmail.com wrote:

Can you advice what workaround I can do for the time being.?
On 16-Jul-2014 12:34 am, "Cameron Cope" chef@camcope.me wrote:

Yeah, this re-broke sometime since Chef 10. I submitted a couple of
fixes to ohai and chef to make this work again, which will be in the
11.14.0 release.

-Cam

On Tue, Jul 15, 2014 at 2:21 PM, karthik kumar kumarkarthikn@gmail.com
wrote:

Hi,
My recipe to update root password,

user 'root' do

password '$1$xRttNfmg$kiGAjD0nRQkFXyE5432ci'

end

throws this error, BUT /etc/shadow file is updated properly

chef-solo -c client.rb -j runlist.json

Starting Chef Client, version 11.12.8

Compiling Cookbooks...

Converging 1 resources

Recipe: base::default

  • user[root] action create (up to date)

================================================================================

Error executing action create on resource 'user[root]'

================================================================================

......

Ran ["usermod", "root"] returned 2

[2014-07-15T11:01:20-07:00] FATAL:
Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)

checking the code,
chef-11.12.8/lib/chef/provider/user/solaris.rb

def manage_user

manage_password  ->  write_shadow_file                 *# WORKS

GOOD*

*super*
    *# parent's shell_out fails*

end

chef-11.12.8/lib/chef/provider/user/useradd.rb

def manage_user

.....

shell_out!(*command)                                             *#

command CONTAINS ["usermod", "root"] fails with return code non-zero*

end

I think this is same as

https://tickets.opscode.com/browse/CHEF-1707

and it says Resolution:Fixed,

Can somebody advice if I am doing anything wrong ? Is there a
workaround for this ? should I write lwrp/provider of my own ? Please
advice.

User password management: CHEF-5247:

(Solaris >= 11 only) IPS provider broken: CHEF-5037:

Solaris >= 11.1 : OHAI-563 [OHAI-563] relax regex to match newer Oracle Solaris releases by ccope · Pull Request #313 · chef/ohai · GitHub

On Wed, Jul 16, 2014 at 2:24 PM, karthik kumar kumarkarthikn@gmail.com
wrote:

Thanks Cameron,
Just curious do you know what is the fix for this. Do you have the pull
request reference for this change ?

I checked this
https://github.com/opscode/chef/commit/c6b52cd6e1900a0127d791cbb8241e14da6fc989 got
from bug https://tickets.opscode.com/browse/CHEF-1707 the platform.rb
and solaris.rb are the same

On Wed, Jul 16, 2014 at 11:12 PM, Cameron Cope chef@camcope.me wrote:

The easiest thing would be to install the 11.14.0 release candidate.
Otherwise you'll have to hunt for an old version that works (I think it's
been broken since at least 11.6.x, but I don't know if there were any
working 11.x builds at all).

-Cam
On Jul 15, 2014 11:15 PM, "karthik kumar" kumarkarthikn@gmail.com
wrote:

Can you advice what workaround I can do for the time being.?
On 16-Jul-2014 12:34 am, "Cameron Cope" chef@camcope.me wrote:

Yeah, this re-broke sometime since Chef 10. I submitted a couple of
fixes to ohai and chef to make this work again, which will be in the
11.14.0 release.

-Cam

On Tue, Jul 15, 2014 at 2:21 PM, karthik kumar <kumarkarthikn@gmail.com

wrote:

Hi,
My recipe to update root password,

user 'root' do

password '$1$xRttNfmg$kiGAjD0nRQkFXyE5432ci'

end

throws this error, BUT /etc/shadow file is updated properly

chef-solo -c client.rb -j runlist.json

Starting Chef Client, version 11.12.8

Compiling Cookbooks...

Converging 1 resources

Recipe: base::default

  • user[root] action create (up to date)

================================================================================

Error executing action create on resource 'user[root]'

================================================================================

......

Ran ["usermod", "root"] returned 2

[2014-07-15T11:01:20-07:00] FATAL:
Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)

checking the code,
chef-11.12.8/lib/chef/provider/user/solaris.rb

def manage_user

manage_password  ->  write_shadow_file                 *# WORKS

GOOD*

*super*
      *# parent's shell_out fails*

end

chef-11.12.8/lib/chef/provider/user/useradd.rb

def manage_user

.....

shell_out!(*command)                                             *#

command CONTAINS ["usermod", "root"] fails with return code non-zero*

end

I think this is same as

https://tickets.opscode.com/browse/CHEF-1707

and it says Resolution:Fixed,

Can somebody advice if I am doing anything wrong ? Is there a
workaround for this ? should I write lwrp/provider of my own ? Please
advice.