Jira (PUP-11067) Specifying purge_ssh_keys parameter for non-existing user errors out

32 views
Skip to first unread message

Valters Jansons (Jira)

unread,
May 15, 2021, 8:17:02 AM5/15/21
to puppe...@googlegroups.com
Valters Jansons created an issue
 
Puppet / Bug PUP-11067
Specifying purge_ssh_keys parameter for non-existing user errors out
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/05/15 5:16 AM
Priority: Normal Normal
Reporter: Valters Jansons

Puppet Version: 7.6.1
Puppet Server Version: N/A - reproducible via local puppet apply
OS Name/Version: Ubuntu 20.04 (LTS "Focal")


A user resource, with purge_ssh_keys parameter provided as either true or as an array of paths results in a "Failed to apply catalog" error, if the user account does not previously exist.

$ puppet apply -e 'user { "test123": ensure => present, purge_ssh_keys => true, }' --noop

Desired Behavior:

User account is created, with SSH keys as provided.
SSH key purging for user is enforced following creation.

Actual Behavior:

Notice: Compiled catalog for host.example.com in environment production in 0.02 seconds
Error: Parameter purge_ssh_keys failed on User[test123]: Munging failed for value true in class purge_ssh_keys: user test123 doesn't exist (line: 1)

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Valters Jansons (Jira)

unread,
May 16, 2021, 6:43:05 AM5/16/21
to puppe...@googlegroups.com
Valters Jansons commented on Bug PUP-11067
 
Re: Specifying purge_ssh_keys parameter for non-existing user errors out

Appears to be caused by b424130, which fixed PUP-10506.

If home parameter is skipped, Dir.home("test123") is invoked under the hood. This works well for existing accounts, however if the user account does not exist, it causes an ArgumentError "user test123 doesn't exist".

At first glance, it appears purge_ssh_keys properly handles missing files, so the home should be able to default to some safe value during initial creation (would /dev/null fallback cause issues?).

Valters Jansons (Jira)

unread,
May 16, 2021, 3:42:04 PM5/16/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
May 18, 2021, 10:41:02 AM5/18/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
May 18, 2021, 10:46:01 AM5/18/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
May 18, 2021, 10:46:02 AM5/18/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
May 19, 2021, 5:05:01 AM5/19/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
May 19, 2021, 5:05:01 AM5/19/21
to puppe...@googlegroups.com

Luchian Nemes (Jira)

unread,
May 20, 2021, 11:47:04 AM5/20/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jun 2, 2021, 5:40:03 AM6/2/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 3, 2021, 2:36:02 PM6/3/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.8.0
Fix Version/s: PUP 6.23.0

Luchian Nemes (Jira)

unread,
Jun 8, 2021, 3:00:02 AM6/8/21
to puppe...@googlegroups.com
Luchian Nemes updated an issue
Change By: Luchian Nemes
Release Notes: Bug Fix
Release Notes Summary: Prioritizes the `ensure` property of a managed user before the `purge_ssh_keys` parameter to avoid errors when the user doesn't already exist.

Christine Yoon (Jira)

unread,
Jun 21, 2021, 12:43:03 PM6/21/21
to puppe...@googlegroups.com

Christine Yoon (Jira)

unread,
Jun 21, 2021, 2:29:01 PM6/21/21
to puppe...@googlegroups.com
Christine Yoon updated an issue
Change By: Christine Yoon
Labels: community doc_reviewed doc-reviewed

Christine Yoon (Jira)

unread,
Jun 21, 2021, 4:00:02 PM6/21/21
to puppe...@googlegroups.com
Christine Yoon updated an issue
Change By: Christine Yoon
Labels: community doc docs -reviewed
Reply all
Reply to author
Forward
0 new messages