Commit 3ddcca19 authored by Christopher Huhn's avatar Christopher Huhn
Browse files

Make sure that the sys.pam.access attribute hierarchy exists

parent cd7f71e2
......@@ -6,4 +6,4 @@ description 'System Software configuration and maintenance'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
source_url 'https://github.com/GSI-HPC/sys-chef-cookbook'
issues_url 'https://github.com/GSI-HPC/sys-chef-cookbook/issues'
version '1.23.0'
version '1.23.1'
......@@ -142,12 +142,23 @@ unless (node['sys']['accounts'].empty? and node['sys']['groups'].empty?)
end
end
if account.has_key?('remote')
node.default['sys']['pam']['access'].unshift("+:#{name}:#{account['remote']} LOCAL")
if account.key?('remote')
if node['sys']['pam'].key?('access')
node.default['sys']['pam']['access'] <<
"+:#{name}:#{account['remote']} LOCAL"
else
node.default['sys']['pam']['access'] = [
"+:#{name}:#{account['remote']} LOCAL"
]
end
log "Configuring remote access rules for #{name}" do
level :debug
end
end
rescue StandardError => e
Chef::Log.error("Creation of user resource '#{name}' failed: #{e.message}")
Chef::Log.error("Creation of user resource '#{name}' failed: " +
e.message)
end
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment