Skip to content

Latest commit

 

History

History
1288 lines (723 loc) · 31.4 KB

REFERENCE.md

File metadata and controls

1288 lines (723 loc) · 31.4 KB

Reference

Table of Contents

Classes

  • rsync: Provides an rsync client library with a stub exec for certain edge cases
  • rsync::selinux: This will configure selinux for rsync
  • rsync::server: Sets up a fully functioning rsync server.
  • rsync::server::global: Setup the global section of /etc/rsyncd.conf. See rsyncd.conf(5) for details of parameters not listed below.

Defined types

  • rsync::push: This is simply a call to rsync::retrieve with $pull set to false. It's present for clarity and hopefully won't break any dependency chains if
  • rsync::retrieve: Retrieve a file over the rsync protocol
  • rsync::server::section: Set up a 'section' of /etc/rsyncd.conf pertaining to a particular rsync share. See rsyncd.conf(5) for descriptions of most variables.

Resource types

  • rsync: Run an rsync command; almost all options are directly from the rsync man page. Though we've done what we can to mimize SELinux impact. If yo

Classes

rsync

Provides an rsync client library with a stub exec for certain edge cases

Parameters

The following parameters are available in the rsync class:

sebool_anon_write

Data type: Boolean

Allow anonymous rsync users to write to shares

  • Share spaces must be labeled as public_content_rw_t
  • Only functional if selinux is not disabled

Default value: false

sebool_client

Data type: Boolean

Allow rsync to act as a client

  • Only functional if selinux is not disabled

Default value: true

sebool_export_all_ro

Data type: Boolean

Allow rsync to export of anything on the system as read only

  • Only functional if selinux is not disabled

Default value: true

sebool_full_access

Data type: Boolean

Allow rsync management of ALL files on the system

  • Only functional if selinux is not disabled

Default value: false

sebool_use_nfs

Data type: Boolean

Allow rsync servers to share nfs files systems

  • Only functional if selinux is not disabled
  • Only applies to El6
  • WARNING: Will be removed in version 7 of this module

Default value: false

sebool_use_cifs

Data type: Boolean

Allow rsync servers to share cifs files systems

  • Only functional if selinux is not disabled
  • Only applies to El6
  • WARNING: Will be removed in version 7 of this module

Default value: false

package_ensure

Data type: String

The ensure status of the package to be managed

Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })

rsync::selinux

This will configure selinux for rsync

rsync::server

The main idea behind this was to work around limitations of the native Puppet fileserving type.

Most usual options are supported, but there are far too many to tackle all of them at once.

This mainly daemonizes rsync and keeps it running. It will also subscribe it to the stunnel service if it has been declared.

Parameters

The following parameters are available in the rsync::server class:

stunnel

Data type: Boolean

Use Stunnel to encrypt this connection. It is highly recommended to leave this enabled.

Default value: simplib::lookup('simp_options::stunnel', { default_value => true })

stunnel_port

Data type: Simplib::Port

The port upon which Stunnel should listen for connections.

Default value: 8730

listen_address

Data type: Simplib::IP

The IP Address upon which to listen. Set to 0.0.0.0 to listen on all addresses.

Default value: '0.0.0.0'

drop_rsyslog_noise

Data type: Boolean

Ensure that any noise from rsync is dropped. The only items that will be retained will be startup, shutdown, and remote connection activities. Anything from 127.0.0.1 will be dropped as useless.

Default value: true

firewall

Data type: Boolean

If true, use the SIMP iptables class to manage firewall rules for this module.

Default value: simplib::lookup('simp_options::firewall', { default_value => false })

trusted_nets

Data type: Simplib::Netlist

A list of networks and/or hostnames that are allowed to connect to this service.

Default value: simplib::lookup('simp_options::trusted_nets', { default_value => ['127.0.0.1'] })

package_ensure

Data type: String

The ensure status of the package to be managed

Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })

package

Data type: String

The rsync daemon package

rsync::server::global

Setup the global section of /etc/rsyncd.conf.

See rsyncd.conf(5) for details of parameters not listed below.

Parameters

The following parameters are available in the rsync::server::global class:

motd_file

Data type: Optional[Stdlib::Absolutepath]

The path to the default MOTD file that should be displayed upon connection

Default value: undef

pid_file

Data type: Stdlib::Absolutepath

The path to the service PID file

Default value: '/var/run/rsyncd.pid'

syslog_facility

Data type: String

A valid syslog facility to use for logging

Default value: 'daemon'

port

Data type: Simplib::Port

The port upon which to listen for client connections

Default value: 873

address

Data type: Simplib::IP

The IP address upon which to listen for connections

  • Leave this at 127.0.0.1 if using stunnel

Default value: '127.0.0.1'

trusted_nets

Data type: Simplib::Netlist

The networks to allow to connect to this service

Default value: simplib::lookup('simp_options::trusted_nets', { default_value => ['127.0.0.1'] })

tcpwrappers

Data type: Boolean

Use tcpwrappers to secure the rsync service

Default value: simplib::lookup('simp_options::tcpwrappers', { default_value => false })

Defined types

rsync::push

This is simply a call to rsync::retrieve with $pull set to false. It's present for clarity and hopefully won't break any dependency chains if you use it.

See the documentation for rsync::retrieve for details.

Parameters

The following parameters are available in the rsync::push defined type:

source_path

Data type: String

target_path

Data type: String

rsync_server

Data type: Simplib::Host

proto

Data type: String

Default value: 'rsync'

rsync_path

Data type: Stdlib::Absolutepath

Default value: '/usr/bin/rsync'

preserve_perms

Data type: Boolean

Default value: true

preserve_acl

Data type: Boolean

Default value: true

preserve_xattrs

Data type: Boolean

Default value: true

preserve_owner

Data type: Boolean

Default value: true

preserve_group

Data type: Boolean

Default value: true

preserve_devices

Data type: Boolean

Default value: false

exclude

Data type: Array[String]

Default value: ['.svn/','.git/']

rsync_timeout

Data type: Integer[0]

Default value: 2

logoutput

Data type: Variant[Boolean,String]

Default value: 'on_failure'

delete

Data type: Boolean

Default value: false

bwlimit

Data type: Optional[Integer[0]]

Default value: undef

copy_links

Data type: Boolean

Default value: false

size_only

Data type: Boolean

Default value: false

no_implied_dirs

Data type: Boolean

Default value: true

user

Data type: Optional[String]

Default value: undef

pass

Data type: Optional[String]

Default value: undef

rsubscribe

Data type: Optional[Catalogentry]

Default value: undef

rnotify

Data type: Optional[Catalogentry]

Default value: undef

rsync::retrieve

Retrieve a file over the rsync protocol

  • See also
    • rsync(1)

Parameters

The following parameters are available in the rsync::retrieve defined type:

source_path

Data type: String

The path on the rsync server from which to retrieve files

  • This will, most likely, not start with a forward slash
target_path

Data type: String

The path to which to write on the client system

rsync_server

Data type: Variant[Simplib::Host, Simplib::Host::Port]

The host to which to connect

Default value: simplib::lookup('simp_options::rsync::server')

proto

Data type: String

The protocol to use

  • This will go before the :// in the rsync connection string
  • You probably won't change this

Default value: 'rsync'

rsync_path

Data type: Stdlib::Absolutepath

The path to the 'rsync' command

Default value: '/usr/bin/rsync'

preserve_perms

Data type: Boolean

Preserve the file permissions from the server

Default value: true

preserve_acl

Data type: Boolean

Preserve the file ACLs from the server

Default value: true

preserve_xattrs

Data type: Boolean

Preserve the extended attributes from the server

Default value: true

preserve_owner

Data type: Boolean

Preserve the file owner from the server

Default value: true

preserve_group

Data type: Boolean

Preserve the file group from the server

Default value: true

preserve_devices

Data type: Boolean

Preserve device special IDs from the server

Default value: false

exclude

Data type: Array[String]

Paths and globs to exclude from transfers

Default value: ['.svn/','.git/']

rsync_timeout

Data type: Integer[0]

The number of seconds to wait for a transfer to begin before timing out

Default value: 2

logoutput

Data type: String

Log the output of the rsync run at the provided trigger

Default value: 'on_failure'

delete

Data type: Boolean

Delete local files that do not exist on the remote server

Default value: false

bwlimit

Data type: Optional[String]

The bandwidth limit for the connection

Default value: simplib::lookup('rsync::bwlimit', { 'default_value' => undef })

copy_links

Data type: Boolean

Preserve symlinks during the transfer

Default value: false

size_only

Data type: Boolean

Only compare files by size to determine if they need a transfer

Default value: false

no_implied_dirs

Data type: Boolean

Don't send implied directories with relative pathnames

Default value: true

user

Data type: Optional[String]

The username to use when connecting to the server

Default value: undef

pass

Data type: Optional[String]

The password to use when connecting to the server

  • If left blank, and a username is provided, the simplib::passgen() function will be used to look up the password

Default value: undef

pull

Data type: Boolean

Pull files from the remote server

  • If set to false, will push files to the server instead of pulling them from the server

Default value: true

rnotify

Data type: Optional[Catalogentry]

Wrap a notify so that this process will send a Puppet notification to a resource after completion

  • Use like the regular Puppet notify meta-parameter

Default value: undef

rsubscribe

Data type: Optional[Catalogentry]

Wrap a subscribe so that this process will subscribe to a Puppet resource after completion

  • Use like the regular Puppet subscribe meta-parameter

Default value: undef

rsync::server::section

Set up a 'section' of /etc/rsyncd.conf pertaining to a particular rsync share.

See rsyncd.conf(5) for descriptions of most variables.

Parameters

The following parameters are available in the rsync::server::section defined type:

name

The arbitrary name of this configuration section

path

Data type: Stdlib::Absolutepath

The directory to make available to clients

auth_users

Data type: Optional[Array[String]]

A list of usernames that are allowed to connect to this section

  • simplib::passgen() will be used to generated random passwords for these users, if they do not already exist in the system
  • Ignored if user_pass is set.

Default value: undef

user_pass

Data type: Optional[Array[String]]

An optional array of username:password combinations to be added to the secrets file

  • Not recommended. Instead, use auth_users to let the simplib::passgen() function generate your passwords
  • Entries in this Array should be of the following form: username:password

Default value: undef

comment

Data type: Optional[String]

A comment for the section

Default value: undef

use_chroot

Data type: Boolean

Use a chroot for this service

Default value: false

max_connections

Data type: Integer[0]

The maximum number of connections allowed

Default value: 0

max_verbosity

Data type: Integer[0]

The logging verbosity that the daemon should use for connections to this service

Default value: 1

lock_file

Data type: Stdlib::Absolutepath

The path to the lock file for this service

Default value: '/var/run/rsyncd.lock'

read_only

Data type: Boolean

Do not allow clients to write to this share

Default value: true

write_only

Data type: Boolean

Only allow clients to write to this share

Default value: false

list

Data type: Boolean

List this share when clients ask for a list of available modules

Default value: false

uid

Data type: String

The user ID that transfers should take place as

  • This user must have access to all of the relevant files

Default value: 'root'

gid

Data type: String

The group ID that transfers should take place as

  • Must have access to all of the relevant files

Default value: 'root'

outgoing_chmod

Data type: String

A symbolic chmod that will be applied to files that are transferred outbound

Default value: 'o-w'

ignore_nonreadable

Data type: Boolean

Completely ignore any file that is not readable by the user

Default value: true

transfer_logging

Data type: Boolean

Enable per-file logging of transfers

Default value: true

log_format

Data type: String

Format used for logging file transfers when transfer logging is enabled

Default value: "'%o %h [%a] %m (%u) %f %l'"

dont_compress

Data type: Array[String]

Filenames and globs that should not be compressed upon transfer

Default value:

[
    '*.gz',
    '*.tgz',
    '*.zip',
    '*.z',
    '*.rpm',
    '*.deb',
    '*.iso',
    '*.bz2',
    '*.tbz',
    '*.rar',
    '*.jar',
    '*.pdf',
    '*.sar',
    '*.war'
  ]
hosts_allow

Data type: Variant[Enum['*'], Simplib::Netlist]

Hosts that should be allowed to connect to this share

  • Set to ['127.0.0.1'] if using stunnel for the overall system
  • May also be set to the String * to allow all hosts

Default value: simplib::lookup('simp_options::trusted_nets', { 'default_value' => ['127.0.0.1'] })

hosts_deny

Data type: Variant[Enum['*'], Simplib::Netlist]

Hosts to explicitly deny from connection to this share

  • Should be set to the String * as it is overridden by $hosts_allow

Default value: '*'

Resource types

rsync

Run an rsync command; almost all options are directly from the rsync man page.

Though we've done what we can to mimize SELinux impact. If you have the situation where your Puppet server's rsync space does not have SELinux attributes but your client is Permissive or Enforcing. Then you will most certainly see error messages of the type that extended attributes have changed.

Your best bet is to ensure that your Puppet server runs in at least Permissive mode. If you need to refresh your rsync data attributes, then running 'fixfiles -R simp-rsync restore'.

Properties

The following properties are available in the rsync type.

action

Valid values: push, pull

Whether to push or pull from rsync server. Defaults to pull

Default value: pull

Parameters

The following parameters are available in the rsync type.

bwlimit

KB/s to limit I/O bandwidth to

compress

Valid values: true, false

Whether or not to compress content prior to transfer. Defaults to true.

Default value: true

contimeout

Connection timeout in seconds.

copy_links

Valid values: true, false

Whether to copy links as symlinks. Defaults to false

Default value: false

delete

Valid values: true, false

Whether to delete files that do not exist on server. Defaults to false

Default value: false

exclude

Exclude files matching PATTERN. Multiple values may be specified as an array. Defaults to ['.svn/','.git/']

Default value: ['.svn/','.git/']

hard_links

Valid values: true, false

Preserve hard links. Defaults to true.

Default value: true

ignore_selinux

Valid values: true, false

If this is set to 'true' then this type will ignore SELinux errors. If set to false, then an SELinux permissions copy error is a complete failure state.

Default value: true

iotimeout

I/O timeout in seconds.

logoutput

Valid values: true, false, on_failure

Whether to log output. Defaults to logging output at the loglevel for the exec resource. Use on_failure to only log the output when the command reports an error. Values are true, false, on_failure, and any legal log level.

Default value: on_failure

name

namevar

The globally unique name of the resource. Has no effect on provider functionality.

no_implied_dirs

Valid values: true, false

Do not send implied dirs. Defaults to true

Default value: true

pass

The password to use. Only used if a username is specified If you want the password to be auto-generated, you can use the SIMP 'simplib::passgen' function.

$user = 'foo'

rsync::retrieve { "foo": source => 'bar', target => '/tmp/foo', server => 'puppet', user => $user, password => simplib::passgen($user) }

password

The password to use. Only used if a username is specified If you want the password to be auto-generated, you can use the SIMP 'simplib::passgen' function.

$user = 'foo'

rsync::retrieve { "foo": source => 'bar', target => '/tmp/foo', server => 'puppet', user => $user, password => simplib::passgen($user) }

path

The fully qualified path to the rsync executable

preserve_acl

Valid values: true, false

Whether or not to preserve ACL. Defaults to true.

Default value: true

preserve_devices

Valid values: true, false

Whether or not to preserve device files. Defaults to false.

Default value: false

preserve_group

Valid values: true, false

Whether or not to preserve group. Defaults to true.

Default value: true

preserve_owner

Valid values: true, false

Whether or not to preserve owner. Defaults to true.

Default value: true

preserve_perms

Valid values: true, false

Whether or not to preserve permissions. Defaults to true.

Default value: true

preserve_xattrs

Valid values: true, false

Whether or not to preserve extended attributes. Defaults to true.

Default value: true

proto

The protocol to use in connecting to the rsync server. Defaults to "rsync"

protocol

The protocol to use in connecting to the rsync server. Defaults to "rsync"

provider

The specific backend to use for this rsync resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

recurse

Valid values: true, false

Whether or not to recursively copy. Defaults to true.

Default value: true

rsync_path

The fully qualified path to the rsync executable

rsync_server

The hostname or IP of the rsync server

rsync_timeout

Alias for :timeout

server

The hostname or IP of the rsync server

size_only

Valid values: true, false

Whether to skip files that match in size. Defaults to true

Default value: false

source

The fully qualified source path on the rsync server

source_path

The fully qualified source path on the rsync server

target

The fully qualified target path on the rsync client

target_path

The fully qualified target path on the rsync client

timeout

Connection timeout in seconds. Note: This is different from what the man page states due to backward compatibility issues. Use iotimeout for the man page compatible timeout value.

user

The username to use