Ask Your Question
0

Detect name and password of regular user on agents

asked 2016-10-25 09:41:06 -0600

Hello, i'm trying to create a module, that will detect name and password of regular user on agents and redirect it to a variables. Is there are facts/classes that can help me with that? Please help. p.s. Im totally new in puppet

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-10-25 13:16:44 -0600

aharden gravatar image

If you want to report on what users are present on a system, you can run:

puppet resource user

And it will produce in puppet code format a list of the users present on the system. The same code can be used to ensure that the user configurations don't change if a manifest with that code is run. The code can be modified to create new users with the desired attributes.

You say you want to redirect user names and passwords to variables: for what purpose? Puppet is meant to manage system configurations: reporting is a by-product of its configuration management.

edit flag offensive delete link more
0

answered 2016-10-26 04:21:03 -0600

Hello, thank you for your answer. I need to edit configuration files of some package on ~300 nodes. There are username and password parameters in these configuration files that i must edit. So i wanna use puppet to detect username on particular node, and then append it to that conf. file or somehow copy shell script, that will do all the work.

edit flag offensive delete link more

Comments

1

The system generally stores a password hash, not the complete password. I don't know of a way that you get them unless you had the system store the passwords in a two-way structure of some kind.

DarylW gravatar imageDarylW ( 2016-10-26 08:13:51 -0600 )edit

The way I would approach this would be to store the desired passwords in an encrypted form in hieradata using hiera-eyaml, and push the desired usernames and passwords into the desired configuration files using a combination of file resources, templates, and the hiera hierarchy as required.

aharden gravatar imageaharden ( 2016-10-26 12:47:59 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-10-25 09:41:06 -0600

Seen: 27 times

Last updated: Oct 26 '16