Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: chloeandisabel/puppet-s3fs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: MITx/puppet-s3fs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 13 commits
  • 4 files changed
  • 1 contributor

Commits on Feb 5, 2013

  1. Adding hiera lookups for default params

    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    f619a20 View commit details
  2. Fixing hiera lookup

    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    3b18b60 View commit details
  3. Looking up bucket in hiera, changing cache directory

    Changing mount options
    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    279bd18 View commit details
  4. including s3fs when mounting s3fs volume

    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    2061686 View commit details
  5. changing mount options for s3fs

    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    f9f523e View commit details
  6. Fixing mounting behavior for s3fs

    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    86ffcb1 View commit details
  7. lint cleanup, default option changes

    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    459d60d View commit details
  8. Setting recurse to true for permission change

    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    4425ea1 View commit details
  9. fixing recurse option

    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    0cfee1b View commit details
  10. adding allow_other to mount options

    John Jarvis committed Feb 5, 2013
    Copy the full SHA
    9ad508e View commit details

Commits on Feb 12, 2013

  1. updating s3fs module so that it isn't drupal specific

    John Jarvis committed Feb 12, 2013
    Copy the full SHA
    c369836 View commit details

Commits on Feb 22, 2013

  1. Copy the full SHA
    f4c5cbe View commit details

Commits on Apr 2, 2013

  1. removing libxml2-dev dependencies

    John Jarvis committed Apr 2, 2013
    Copy the full SHA
    ec858f3 View commit details
Showing with 42 additions and 95 deletions.
  1. +0 −1 manifests/dependencies.pp
  2. +22 −15 manifests/init.pp
  3. +20 −48 manifests/mount.pp
  4. +0 −31 manifests/params.pp
1 change: 0 additions & 1 deletion manifests/dependencies.pp
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
if ! defined(Package['libfuse-dev']) { package { 'libfuse-dev': ensure => installed } }
if ! defined(Package['fuse-utils']) { package { 'fuse-utils': ensure => installed } }
if ! defined(Package['libcurl4-openssl-dev']) { package { 'libcurl4-openssl-dev': ensure => installed } }
if ! defined(Package['libxml2-dev']) { package { 'libxml2-dev': ensure => installed } }
if ! defined(Package['mime-support']) { package { 'mime-support': ensure => installed } }

}
37 changes: 22 additions & 15 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -26,20 +26,24 @@
# $aws_secret_access_key => 'randomSecret',
# }
#

# http://code.google.com/p/s3fs/downloads/detail?name=s3fs-1.62.tar.gz&can=2&q=
class s3fs (
$aws_secret_access_key,
$aws_access_key_id,
$ensure = 'present',
$s3fs_package = $s3fs::params::s3fs_package,
$download_dir = $s3fs::params::download_dir,
$version = $s3fs::params::version,
$download_url = $s3fs::params::download_url,
$aws_access_key_id = hiera('aws_access_key_id'),
$aws_secret_access_key = hiera('aws_secret_access_key'),
$credentials_file = $s3fs::params::credentials_file
) inherits s3fs::params {
$s3fs_package = 's3fs',
$download_dir = '/var/tmp',
$version = '1.61',
$download_url = 'http://s3fs.googlecode.com/files',
$credentials_file = '/etc/passwd-s3fs',
) {

$credentials = inline_template("<%= @aws_access_key_id %>:<%= @aws_secret_access_key %>\n")
$credentials = inline_template(
"<%= @aws_access_key_id %>:<%= @aws_secret_access_key %>\n")

Class['s3fs::dependencies'] -> Class['s3fs']

include s3fs::dependencies

file{ 's3fs_credentials':
@@ -51,22 +55,25 @@
mode => '0640',
}

Exec['s3fs_tar_gz'] ~> Exec['s3fs_extract'] ~> Exec['s3fs_configure'] ~> Exec['s3fs_make'] ~> Exec['s3fs_install']
Exec['s3fs_tar_gz']
~> Exec['s3fs_extract']
~> Exec['s3fs_configure']
~> Exec['s3fs_make']
~> Exec['s3fs_install']

# Distribute s3fs source from within module to control version (could
# also download from Google directly):
exec { 's3fs_tar_gz':
command => "/usr/bin/curl -o ${download_dir}/s3fs-${version}.tar.gz ${download_url}/s3fs-${version}.tar.gz",
logoutput => true,
timeout => 300,
#path => '/sbin:/bin:/usr/local/bin:/usr/local/sbin',
unless => "/usr/bin/which /usr/local/bin/s3fs && /usr/local/bin/s3fs --version | grep ${version}",
}

# Extract s3fs source:
exec { 's3fs_extract':
creates => "${download_dir}/s3fs-${version}",
cwd => "${download_dir}",
cwd => "${download_dir}",
command => "tar --no-same-owner -xzf ${download_dir}/s3fs-$version.tar.gz",
logoutput => true,
timeout => 300,
@@ -93,7 +100,7 @@
timeout => 300,
refreshonly => true,
}

# Install s3fs
exec { 's3fs_install':
command => "/usr/bin/make install",
@@ -102,5 +109,5 @@
timeout => 300,
refreshonly => true,
}

}
68 changes: 20 additions & 48 deletions manifests/mount.pp
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
# Class: s3fs::mount
#
# This module installs s3fs
#
# Parameters:
#
# [*bucket*] - AWS bucket name
# [*mount_point*] - Mountpoint for bucket
# [*ensure*] - Set mountpoint values, ensure dir and mount are absent
# [*s3url*] - 'https://s3.amazonaws.com'
# [*default_acl*] - 'private'
# [*uid*] - Mountpoint and mount dir owner
# [*gid*] - Mountpoint and mount dir group
# [*mode*] - Mountpoint and moutn dir permissions
# [*atboot*] - 'true',
# [*device*] - "s3fs#${bucket}",
# [*fstype*] - 'fuse',
# [*options*] - "allow_other,uid=${uid},gid=${gid},default_acl=${default_acl},use_cache=/tmp/aws_s3_cache,url=${s3url}",
# [*remounts*] - 'false',
#
# Actions:
#
# Requires:
# Class['s3fs']
#
# Sample Usage:
#
# # S3FS
# s3fs::mount {'Testing':
# bucket => 'testvgh1',
# mount_point => '/srv/testvgh1',
# uid => '1001',
# gid => '1001',
# }
# ## S3FS
# s3fs::mount {'Testvgh':
# bucket => 'testvgh',
@@ -42,49 +11,52 @@
define s3fs::mount (
$bucket,
$mount_point,
$ensure = 'present',
$s3url = 'https://s3.amazonaws.com',
$default_acl = 'private',
$uid = '0',
$gid = '0',
$mode = '0660',
$atboot = 'true',
$device = "s3fs#${bucket}",
$fstype = 'fuse',
$remounts = 'false',
$cache = '/tmp/aws_s3_cache'
$ensure = 'present',
$default_acl = 'private',
$uid = '0',
$gid = '0',
$mode = '0660',
$atboot = true,
$fstype = 'fuse',
$remounts = false,
$cache = '/mnt/aws_s3_cache',
$group = 'root',
$owner = 'root',
$perm_recurse = true,
) {

Class['s3fs'] -> S3fs::Mount["${name}"]
Class['s3fs'] -> S3fs::Mount[$name]

# Declare this here, otherwise, uid, guid, etc.. are not initialized in the correct order.
$options = "allow_other,uid=${uid},gid=${gid},default_acl=${default_acl},use_cache=${cache},url=${s3url}"
$options = "allow_other,gid=$gid,uid=$uid,default_acl=${default_acl},use_cache=${cache}"
$device = "s3fs#${bucket}"

case $ensure {
present, defined, unmounted, mounted: {
$ensure_mount = 'mounted'
$ensure_dir = 'directory'
}
absent: {
$ensure_mount = 'absent'
$ensure_dir = 'absent'
}
default: {
fail("Not a valid ensure value: ${ensure}")
}
}

File["${mount_point}"] -> Mount["${mount_point}"]
File[$mount_point] -> Mount[$mount_point]

file { $mount_point:
recurse => $perm_recurse,
ensure => $ensure_dir,
recurse => true,
force => true,
owner => $owner,
group => $group,
mode => $mode,
}

mount{ $mount_point:
ensure => $ensure,
ensure => $ensure_mount,
atboot => $atboot,
device => $device,
fstype => $fstype,
31 changes: 0 additions & 31 deletions manifests/params.pp

This file was deleted.