Jira (PUP-11631) Purging SSH keys on a user resource fails when alias is used

29 views
Skip to first unread message

Jarret Lavallee (Jira)

unread,
Sep 23, 2022, 1:08:02 PM9/23/22
to puppe...@googlegroups.com
Jarret Lavallee created an issue
 
Puppet / Improvement PUP-11631
Purging SSH keys on a user resource fails when alias is used
Issue Type: Improvement Improvement
Affects Versions: PUP 6.28.0
Assignee: Unassigned
Components: Types and Providers
Created: 2022/09/23 10:07 AM
Priority: Normal Normal
Reporter: Jarret Lavallee

When using the purge_ssh_keys parameter on a user resource with an alias metaparameter, the catalog application will fail when purging unmanaged ssh keys. The following error is shown.

Error: /Stage[main]/Main/Node[default]/User[username]: Failed to generate additional resources using 'generate': Parameter alias failed on Ssh_authorized_key[us...@example.com]: Munging failed for value ["useralias"] in class alias: Cannot add aliases without a catalog

The metaparameters are passed into the resource used to purge ssh_authorized_keys when using the user resource. Since this happens in the type, and not during catalog compilation, the agent cannot alias the resources to be purged and fails catalog application.

This is likely due to this https://github.com/puppetlabs/puppet/blob/6.28.0/lib/puppet/type/user.rb#L815

res[name] = param.value if param.metaparam?

Should that be restricted to only send metaparameters that can be used at application?

Reproduction:
1. Use any current puppetserver stack
2. Create the following resource

user {'username':
  ensure => present,
  managehome => true,
  alias => 'useralias',
  purge_ssh_keys => true
}

3. Run the agent to create the user
4. Add an ssh key to the ~username/.ssh/authorizedkeys
5. Run the agent to observe the error.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Jarret Lavallee (Jira)

unread,
Sep 23, 2022, 1:09:02 PM9/23/22
to puppe...@googlegroups.com
Jarret Lavallee updated an issue
Change By: Jarret Lavallee
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 49722

Alvin Rodis (Jira)

unread,
Sep 23, 2022, 1:09:02 PM9/23/22
to puppe...@googlegroups.com

Jarret Lavallee (Jira)

unread,
Sep 23, 2022, 1:09:03 PM9/23/22
to puppe...@googlegroups.com

Michael Hashizume (Jira)

unread,
Sep 27, 2022, 4:21:01 PM9/27/22
to puppe...@googlegroups.com
Michael Hashizume updated an issue
Change By: Michael Hashizume
Labels: jira_escalated needs-validation

Josh Cooper (Jira)

unread,
Oct 4, 2022, 4:42:03 PM10/4/22
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-11631
 
Re: Purging SSH keys on a user resource fails when alias is used

Puppet should copy all metaparameters from the parent resource to its generated children, except for any that are compiler specific. PUP-10688 is a related, but opposite problem where the tag metaparameter is not copied to child resources.

Josh Cooper (Jira)

unread,
Oct 4, 2022, 4:44:04 PM10/4/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Oct 4, 2022, 4:45:03 PM10/4/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Affects Version/s: PUP 7.19.0

Josh Cooper (Jira)

unread,
Oct 4, 2022, 4:48:04 PM10/4/22
to puppe...@googlegroups.com

Morgan Rhodes (Jira)

unread,
Oct 19, 2022, 5:47:01 PM10/19/22
to puppe...@googlegroups.com

Morgan Rhodes (Jira)

unread,
Oct 19, 2022, 5:48:03 PM10/19/22
to puppe...@googlegroups.com
Morgan Rhodes updated an issue
Change By: Morgan Rhodes
Labels: jira_escalated needs-validation

Morgan Rhodes (Jira)

unread,
Oct 20, 2022, 1:47:02 PM10/20/22
to puppe...@googlegroups.com

Michael Hashizume (Jira)

unread,
Oct 27, 2022, 3:12:02 PM10/27/22
to puppe...@googlegroups.com

Morgan Rhodes (Jira)

unread,
Nov 9, 2022, 1:06:02 PM11/9/22
to puppe...@googlegroups.com
Morgan Rhodes updated an issue
Change By: Morgan Rhodes
Sprint: Phoenix 2022-11-09 , Phoenix 2022-11-23

Parker Leach (Jira)

unread,
Dec 7, 2022, 4:18:03 PM12/7/22
to puppe...@googlegroups.com
Parker Leach updated an issue
Change By: Parker Leach
Labels: docs_reviewed jira_escalated
Reply all
Reply to author
Forward
0 new messages