[MODULES-7605] The ssh_authorized_key resource should trim trailing newlines Created: 2014/08/29  Updated: 2018/08/21

Status: Accepted
Project: Modules
Component/s: sshkeys_core
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: William Van Hevelingen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: Easy, ssh, ssh_authorized_key, type_and_provider
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Platform OS


The "Key must not contain whitespace" error is incredibly frustrating. Puppet should just remove trailing newlines from the key parameter because when you go to replace the keys in Hiera vim helpfully adds a new line character.

A really gross work-around is to do this:

key    => regsubst(hiera('ssh_key'), '\n$', '');

Generated at Tue Aug 11 00:28:51 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.