This cvmfs module is designed to install, enable and configure CvmFS clients and servers.
For general details on CvmFS see http://cernvm.cern.ch/portal/filesystem
The module include two customfacts
- cvmfsversion returns the version of cvmfs installed as supplied by '/usr/bin/cvmfs2 --version'
- cvmfspartsize returns the size in megabytes of partition that contains the CVMFS_CACHE_BASE.
These facts will only be available once cvmfs is installed and so configuration of cvmfs is skipped until cvmfs has been installed on the first puppet run. Two puppet runs are required to install and then configure cvmfs.
To configure a cvmfs client to mount cvmfs repository or a domain a domain of cvmfs repositories use the following.
class{"cvmfs":
cvmfs_http_proxy => 'http://ca-proxy.example.org:3128',
cvmfs_quota_limit => 100
}
cvmfs::mount{'files.example.org:
cvmfs_server_url => 'http://web.example.org/cvmfs/files.example.org',
}or
class{"cvmfs":
cvmfs_http_proxy => 'http://ca-proxy.example.org:3128',
cvmfs_quota_limit => 100,
}
cvmfs::domain{'example.net'
cvmfs_server_url => 'http://web.example.org/cvmfs/@fqrn@'
}-
config_automounterboolean defaults to true and configures the automounter for cvmfs. -
manage_autofs_serviceboolean defaults to true, should the autofs service be maintained. -
cvmfs_quota_limitThe cvmfs quota size in megabytes. See params.pp for default. -
cvmfs_quota_ratioIf set to ration, e.g '0.8' then 0.8 of the partition size the cvmfs cache is on will be used. Setting this assumes you have allocated a partition to cvmfs cache. -
cvmfs_http_proxyList of squid servers, see params.pp for default. -
cvmfs_cache_baseLocation of the CVMFS cache base, see params.pp for default. -
cvmfs_mount_rwMount option to mount read-only or read/write, 'yes|no', see params.pp for default. -
cvmfs_follow_redirectsSets CVMFS_FOLLOW_REDIRECTS to its value, by default unset. -
cvmfs_timeoutcvmfs timeout setting, see params.pp for default. -
cvmfs_timeout_directcvmfs timeout to direct connections, see params.pp for default. -
cvmfs_nfilesNumber of open files, system setting, see params.pp for default. -
cvmfs_force_signingBoolean defaults to true, repositories must be signed. -
cvmfs_syslog_levelDefault is in params.pp -
cvmfs_tracefileCreate a tracefile at this location. -
cvmfs_debuglogCreate a debug log file at this location. -
cvmfs_max_ttlMax ttl, see params.pp for default. -
cvmfs_versionVersion of cvmfs to install , default is present. -
cvmfs_yumYum repository URL for cvmfs. -
cvmfs_yum_proxyhttp proxy for cvmfs yum package repository -
cvmfs_yum_configYum repository URL for cvmfs site configs. -
cvmfs_yum_config_enabledDefaults to false, set to true to enable. -
cvmfs_yum_testingYum repository URL for cmvfs testing repository. -
cvmfs_yum_testing_enabledDefaults to false, should the testing repository be enabled. -
cvmfs_yum_testsing_enabledTO DOC -
cvmfs_yum_gpgcheckDefaults to true, set to false to disable GPG checking (Do Not Do This) -
cvmfs_yum_gpgkeySet a custom GPG key for yum repos, you must deploy it yourself. -
cvmfs_yum_manage_repoDefaults to true, set to false to disable yum repositories management. -
cvmfs_use_geoapiTO DOC -
cvmfs_hashRather than using cvmfs::mount defined type a hash of mounts can be sepecfied. cvmfs_hash {'myrepo' => {'cvmfs_server_url' => 'http://web.example.org/cvmfs/ams.example.org/} -
cvmfs_env_variables$cvmfs_env_variables = {'CMS_LOCAL_SITE' => '' will produceexport CMS_LOCAL_SITE=<path to siteconf>in the default.local file.
Puppet databindings allows all the above settings to be set via hiera. In
this case it is not nescesary to include class{'cvmfs':}.
---
cvmfs::cvmfs_quota_limit: 100
cvmfs::cvmfs_nfiles: 20000To mount individual repositories optionally with a particular configuration on each repository. e.g
cvmfs::mount{'lhcb.example.org':
}
cvmfs::mount{'atlas.example.org':
cvmfs_timeout => 50
}
cvmfs::mount{'cms.example.org':
cvmfs_timeout => 100,
cvmfs_server_url => 'http://web.example.org/cms.cern.ch'
}namevarThe namevar is the repository name, e.g atlas.example.chcvmfs_repo_listA boolean defaults totrue. Should this repository be included in the list of repositories listed asCVMFS_REPOSITORIESwith/etc/cvmfs/default.local.cvmfs_follow_redirectsSets CVMFS_FOLLOW_REDIRECTS to its value, by default unset.- TBC
In addition to creating mounts as above the
create_resources('cvmfs::mount',{}) function is called
allowing the mounts to be specified in a hiera yaml file:
---
cvmfs::mount:
atlas.example.ch:
cvmfs_quota_limit: 10000
atlas-condb.example.ch:
{}
atlas-nightlies.example.ch:
cvmfs_server_url: http://cvmfs-atlas-nightlies.example.ch/cvmfs/atlas-nightlies.example.chwhich will enable these three mount points with the specified options.
A cvmfs domain file can be created with the cvmfs::domain type
cvmfs::domain{'example.org':
cvmfs_server_url => 'http://host1.example.org/@repo@;http://host2.example2.org/@repo@',
cvmfs_public_key => '/etc/cvmfs/keys/key1.pub,/etc/cvmfs/keys/key2.pub'
}namevarThe namevar is the domain name, e.g example.chcvmfs_follow_redirectsSets CVMFS_FOLLOW_REDIRECTS to its value, by default unset.- TBC
An optional class 'cvmfs::fsck' can be included to enable a cron job to regualarly run fsck on cvmfs systems.
class{'cvmfs::fsck':
options => '-p',
onreboot => true
}In addition a cron will be created to purge quarentine corrupted files after 30 days.
optionsWill pass parameters to thecvmfs_fsckcommand, by default none will be passed.onrebootIf set to true a @reboot job will be set to runcvmfs_fsckat boot time. Default is false.
There are currently two options to configure a stratum 0. The class method only supports one stratum one and will at some point be deprecated.
class{'cvmfs::server':
repo => 'ilc.example.org',
pubkey => 'public.example.org'
}See the docs in cvmfs::server for explanation of parameters.
A new method where each stratum 0 can be configured as an instance. The advantage here is that multiple stratum zeros can be configured per server. The previous class method will be deprecated at some future point.
cvmfs::zero{'files.example.org':
repo_store => '/mybigdisk',
spool_store => '/var/spool/cvmfs',
user => steve,
uid => 500
}clientuesrIf set will specify the user running the cvmfs_client on the server. Optinal.claim_ownership. By default false if true it enables theCVMFS_CLAIM_OWNERSHIPoption the server's client instance.groupThe group name that will manage the repository and own the files on the server.homeThe home directory of theuseraccount that owns the cvmfs repositories. The default value isrepo_store/repo/user.gidThe gid fo thegroup, it defaults to the be same as theuid, defaults to theusersetting.repo the fully qualified repository name. Defaults the *name* value of the instance. e.gexample.domain.org`.repo_storelarge disk location where the cvmfs repositories are stored. Defaults to/srv/cvmfs.nofilesThe nofiles theuseris permitted to open. Defaults to65000spool_storelocation of files internal to a cvmfs server.uidThe uid of theuseruserThe user name that will manage the repository and own the files on the server.auto_tagBoolean to setCVMFS_AUTO_TAG, defaults to false.garbage_collectionto setCVMFS_GARBAGE_COLLECTIONdefaults to false.auto_gcto setCVMFS_AUTO_GCdefaults to false.auto_gc_timespanto setCVMFS_AUTO_GC_TIMESPANdefaults to3 days ago.ignore_xdir_hardlinksboolean to set toCVMFS_IGNORE_XDIR_HARDLINKSdefaults to false.
A common case is to mount a device or nfs storage volume to use as the repo
store. In this case the mount should happen before cvmfs::zero populates the
area. For example two repositories stoed on two block device /dev/vdb and /dev/vdc.
mount{'/srv/cvmfs/files.example.org':
ensure => mounted,
device => '/dev/vdb',
options => 'rw,noatime,nodiratime,nobarrier,user_xattr'
require => File['/srv/cvmfs/files.example.org'],
before => File['/srv/cvmfs/files.example.org/data']
}
mount{'/srv/cvmfs/objects.example.org':
ensure => mounted,
device => '/dev/vdc',
options => 'rw,noatime,nodiratime,nobarrier,user_xattr'
require => File['/srv/cvmfs/objects.example.org'],
before => File['/srv/cvmfs/objects.example.org/data']
}
cvmfs::zero{'files.example.org':
user => 'steve',
uid => 200,
}
cvmfs::zero{'objects.example.org':
user => 'andrew',
uid => 201,
}
The class based stratum 0 will be deprecated at some point. The differences are:
- The new type no longer attempts to manage a symbolic link to a master key.
If desired this should be done by the addition of symbolic link outside of
cvmfs::zero. - The new type no longer supports mounting e.g nfs volumes. This myst be done externally as per the example above.
Replacing
class{'cvmfs::server':
repo => 'ilc.example.org',
pubkey => 'public.example.org',
user => 'shared',
uid => 101
}with
cvmfs::zero{'ilc.example.org':
user => shared,
uid => 101
}
file{'/etc/cvmfs/keys/ilc.example.org':
ensure => link,
target => '/etc/cvmfs/keys/public.example.org.pem',
require => Package['cvmfs']
}A stratum one can be configured for multiple repositories with a
cvmfs::one{'mice.example.org':
origin => 'http://cvmfs01.example.org/cvmfs',
keys => ['/etc/cvmfs/keys/example1.pub','/etc/cvmfs/keys/example1.pub']
}See cvmfs::one.pp for more details of parameters.
To run standalone tests
bundle install
bundle exec rake validate
bundle exec rake lint
bundle exec rake specThe acceptance tests by default use docker ensure that is working or provide beaker configuration for your own hypervisor.
bundle install
BEAKER_debug=yes BEAKER_set=centos-7-x86_64-docker bundle exec rspec spec/acceptanceApache II License for all files except automaster.aug which is copied from the http://augeas.net project. The automaster.aug file is LGPL v2+.
Steve Traylen [email protected]