Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authconfig reporting (undefined method `[]' for nil:NilClass) #33

Open
dwashko opened this issue Jan 13, 2015 · 0 comments
Open

authconfig reporting (undefined method `[]' for nil:NilClass) #33

dwashko opened this issue Jan 13, 2015 · 0 comments

Comments

@dwashko
Copy link

dwashko commented Jan 13, 2015

I'm running into a problem running authconfig on chef 12. Without any attribute overrides in place via a role or databag the recipe fails with the following error:

moc-lx00010614 Running handlers:
moc-lx00010614 [2015-01-13T14:06:21-05:00] ERROR: Running exception handlers
moc-lx00010614 Running handlers complete
moc-lx00010614 [2015-01-13T14:06:21-05:00] ERROR: Exception handlers complete
moc-lx00010614 [2015-01-13T14:06:21-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
moc-lx00010614 Chef Client failed. 0 resources updated in 2.019555788 seconds
moc-lx00010614 [2015-01-13T14:06:21-05:00] ERROR:
moc-lx00010614
moc-lx00010614 Chef::Mixin::Template::TemplateError (undefined method `[]' for nil:NilClass) on line #90:
moc-lx00010614
moc-lx00010614 88: --disablekrb5
moc-lx00010614 89: <% end -%>
moc-lx00010614 90: <% if node[:authconfig][:winbind][:enable] -%>
moc-lx00010614 91: --enablewinbind
moc-lx00010614 92: <% else -%>

If we put attribute overrides in place the error moves to a different line:

moc-lx00010614 Running handlers:
moc-lx00010614 [2015-01-13T14:03:36-05:00] ERROR: Running exception handlers
moc-lx00010614 Running handlers complete
moc-lx00010614 [2015-01-13T14:03:36-05:00] ERROR: Exception handlers complete
moc-lx00010614 [2015-01-13T14:03:36-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
moc-lx00010614 Chef Client failed. 0 resources updated in 2.205001645 seconds
moc-lx00010614 [2015-01-13T14:03:36-05:00] ERROR:
moc-lx00010614
moc-lx00010614 Chef::Mixin::Template::TemplateError (undefined method `[]' for nil:NilClass) on line #114:
moc-lx00010614
moc-lx00010614 112: --smbidmapgid=<%= node[:authconfig][:winbind][:smb][:idmapgid] %>
moc-lx00010614 113: --winbindseparator=<%= node[:authconfig][:winbind][:separator] %>
moc-lx00010614 114: --winbindtemplatehomedir=<%= node[:authconfig][:winbind][:template][:homedir] %>
moc-lx00010614 115: --winbindtemplateprimarygroup=<%= node[:authconfig][:winbind][:template][:primarygroup] %>
moc-lx00010614 116: --winbindtemplateshell=<%= node[:authconfig][:winbind][:template][:shell] %>

What appears to be the issue is line 54:

53 default['authconfig']['kerberos']['adminserver'] = 'kerberos.example.com'
54 default['authconfig']['kerberos']['passwdserver'] = node[:authconfig][:kerberos][:adminserver]

node[:authconfig][:kerberos][:adminserver] is not accessible and throws the error. Changing

 node[:authconfig][:kerberos][:adminserver]

to
default[:authconfig][:kerberos][:adminserver]

Resolves the issue.

I tried putting values in for both adminserver and passwdserver in the role but the error still occurs.

Chef server version 12
Chef-client version 12.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant