Version information
Start using this module
Add this module to your Puppetfile:
mod 'leonardothibes-util', '1.1.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-util
My Standard Library for Puppet Modules.
This module provides a "standard library" of resources for developing Puppet Modules. This modules will include the following additions to Puppet:
- chmod
- chown
- compress
- extract
Functions
chmod
Change the permission of file or directory.
Examples:
util::chmod {'Changing permission for some file':
file => '/some/file.txt',
mode => 0644,
}
util::chmod {'Changing permission for some directory':
file => '/root',
mode => 0700,
}
util::chmod {'Changing permission for some directory recursively':
file => '/root',
mode => 0700,
recursive => true, # default is "false"
}
chown
Change the owner of file or directory.
Examples:
util::chown {'Changing owner for some file':
file => '/root/file.txt',
user => 'root',
}
util::chown {'Changing owner for some directory':
file => '/srv',
user => 'root',
group => 'admin',
}
util::chown {'Changing owner for some directory recursively':
file => '/root',
user => 'root',
group => 'admin',
recursive => true,
}
compress
Compres an file or directory.
The type of compression is determined for the file extension.
Examples of compressing files:
util::compress {'Compressing some file with zip utility':
from => '/tmp/vagrant-shell',
to => '/tmp/vagrant-shell.zip',
}
util::compress {'Compressing some file with gzip utility':
from => '/tmp/vagrant-shell',
to => '/tmp/vagrant-shell.gz',
}
util::compress {'Compressing some file with bzip2 utility':
from => '/tmp/vagrant-shell',
to => '/tmp/vagrant-shell.bz2',
}
Examples of compressing directories:
util::compress {'Compressing some directory with zip utility':
from => '/etc/vim',
to => '/root/vim.zip',
}
util::compress {'Compressing some directory with gzip utility':
from => '/etc/vim',
to => '/root/vim.tar.gz',
}
util::compress {'Compressing some directory with bzip2 utility':
from => '/etc/vim',
to => '/root/vim.tar.bz2',
}
extract
Extract an compressed file.
The type of extraction is determined for the file extension.
Examples of extracting files:
util::extract {'extracting some file with zip utility':
from => '/tmp/vagrant-shell.zip',
to => '/root',
}
util::extract {'extracting some file with gzip utility':
from => '/tmp/vagrant-shell.gz',
to => '/root',
}
util::extract {'extracting some file with bzip2 utility':
from => '/tmp/vagrant-shell.bz2',
to => '/root',
}
Examples of extracting directories:
util::extract {'Extracting some directory with zip utility':
from => '/root/vim.zip',
to => '/tmp',
}
util::extract {'Extracting some directory with gzip utility':
from => '/root/vim.tar.gz',
to => '/tmp',
}
util::extract {'Extracting some directory with bzip2 utility':
from => '/root/vim.tar.bz2',
to => '/tmp',
}
Contact
Principal developer: Leonardo Thibes => eu@leonardothibes.com
Support
Please log tickets and issues at our Projects site
2014-03-21 Leonardo Thibes eu@leonardothibes.com - 1.1.0
Leonardo Thibes eu@leonardothibes.com (5):
- Implementando funções de compactação de arquivos e diretórios #5
- Implementando funções de descompactação de arquivos e diretórios #6
- Implementando função Puppet::Parser::Functions::basename
- Implementando função Puppet::Parser::Functions::path
- Implementando função Puppet::Parser::Functions::is_dir
- Atualizando a documentação do README.md
2014-03-18 Leonardo Thibes eu@leonardothibes.com - 1.0.0
Leonardo Thibes eu@leonardothibes.com (4):
- Implementando a estrutura inicial do módulo
- Implementando a função "chmod" #1
- Implementando a função "chown" #2
- Adicionando uma VM de desenvolvimento do Vagrant #4
LICENSE ======= Copyright (c) 2013-2014 Leonardo Thibes TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.