Ask Your Question
1

Why does puppet resource behave differently when specifying the provider

asked 2013-01-11 06:03:52 -0500

Preston gravatar image

I was playing around with puppet and noticed this behavior.

# puppet resource file /etc/passwd
file { '/etc/passwd':
  ensure   => 'file',
  content  => '{md5}7a63b133e1a086d9f35c2014b3b09218',
  ctime    => 'Thu Jan 10 17:16:11 -0700 2013',
  group    => '0',
  mode     => '644',
  mtime    => 'Thu Jan 10 17:16:11 -0700 2013',
  owner    => '0',
  selrange => 's0',
  selrole  => 'object_r',
  seltype  => 'etc_t',
  seluser  => 'system_u',
  type     => 'file',
}

vs

# puppet resource file /etc/passwd provider=posix
file { '/etc/passwd':
  ensure   => 'file',
  selrange => 's0',
  selrole  => 'object_r',
  seltype  => 'etc_t',
  seluser  => 'system_u',
}

This is on a Linux system where the file provider should be POSIX. Why is the output different when the provider is ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-01-11 19:28:27 -0500

Stefan gravatar image

The command puppet resource can handle three different tasks and the file type is not the best one to explain them, so I'll pick the mount type:

1) If you run puppet resource mount puppet will ask every suitable provider to give a list of all mounts with all attributes. Not every provider supports that (the file provider does not)

2) If you run puppet resource mount /mnt/dvd puppet will ask every suitable provider to get the current status of a Mount[/mnt/dvd] resource. The mount provider can e.g. return

# puppet resource mount /mnt/dvd
mount ...
(more)
edit flag offensive delete link more

Comments

That makes sense! Fantastic answer.

Preston gravatar imagePreston ( 2013-01-11 20:50:33 -0500 )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

Stats

Asked: 2013-01-11 06:03:52 -0500

Seen: 737 times

Last updated: Jan 11 '13