Install non-root agents
You can configure non-root agents on *nix and Windows nodes. Running agents without root privileges allows teams to perform some, but not all, administrative actions in Puppet Enterprise (PE) that would otherwise require root privileges.
For example, assume a team with root privileges maintains your infrastructure’s platform, and a separate team with diminished privileges maintains your infrastructure’s applications. If the application team needs to manage their part of the infrastructure independently, they can do this by running Puppet without root privileges.
Non-root users can perform a reduced set of management tasks, including configuring
settings, configuring Facter external facts, running
puppet agent --test
, and running Puppet with non-privileged cron
jobs or a similar scheduling service. Non-root users can also
classify nodes by writing or editing manifests in directories where they have write
privileges.
By default, PE is installed with root privileges; therefore, a root user must install the agent and configure non-root access to the primary server. The root user also sets up non-root users on the primary server and relevant agent nodes.
Non-root user functionality
Non-root users can use a subset of administrative functionality. Non-root agents can't perform any operations requiring root privileges, such as installing system packages.
*nix non-root functionality
augeas
-
cron
: Can only view or set non-rootcron
jobs- If you run a
cron
job as non-root user and you use the-u
flag to sets a user with root privileges, the job fails with this error message: Notice: /Stage[main]/Main/Node[nonrootuser]/Cron[illegal_action]/ensure: created must be privileged to use -u
- If you run a
-
exec
: Cannot run as another user or group -
file
: Non-root user must have read/write privileges notify
schedule
service
ssh_authorized_key
ssh_key
Non-root users on *nix agents can inspect host
, mount
, and package
resource types with the puppet resource
<RESOURCE_TYPE>
command.
Windows non-root functionality
Windows non-root agents are limited in comparison to *nix non-root agents. While you can enforce and inspect
some resource types, you are limited to what the agent user has permission to do, which
isn't much by default. For example, you can't create a file or directory in
C:\Windows
unless the agent user has permission to do so.
Non-root users on Windows agents can enforce exec
and file
resource
types.
puppet resource <RESOURCE_TYPE>
command to inspect these
resource types:host
package
user
group
service
Install non-root *nix agents
To configure a *nix agent node to run without root privileges, a root user must install the agent, configure non-root access to the primary server, and set up non-root users on the primary server and relevant agent nodes.
sudo
.- The agent can request certificates and apply the catalog from the primary server
when a non-root user runs Puppet. As a non-root
user, try running
puppet agent -t
to test this. - The agent service is not running. Run
service puppet status
to check this. - Non-root users can collect existing facts by running
facter
on the agent. - Non-root users can define new external facts.
Install non-root Windows agents
To configure a Windows agent node to run without root privileges, a root user must install the agent, configure non-root access to the primary server, and set up non-root users on the primary server and relevant agent nodes.