Skip to content

Commit

Permalink
new manage_requirements argument to address issue 273
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Rosenberg committed Dec 7, 2015
1 parent 303e849 commit 42afd0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ Installs and manages Python packages from requirements file.

**group** - The group that was used to create the virtualenv. This is used to create the requirements file with correct permissions if it's not present already.

**manage_requirements** - Create the requirements file if it doesn't exist. Default: true

```puppet
python::requirements { '/var/www/project1/requirements.txt' :
virtualenv => '/var/www/project1',
Expand Down
6 changes: 5 additions & 1 deletion manifests/requirements.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
# [*extra_pip_args*]
# Extra arguments to pass to pip after the requirements file
#
# [*manage_requirements*]
# Create the requirements file if it doesn't exist. Default: true
#
# [*fix_requirements_owner*]
# Change owner and group of requirements file. Default: true
#
Expand Down Expand Up @@ -71,6 +74,7 @@
$forceupdate = false,
$cwd = undef,
$extra_pip_args = '',
$manage_requirements = true,
$fix_requirements_owner = true,
$log_dir = '/tmp',
$timeout = 1800,
Expand Down Expand Up @@ -110,7 +114,7 @@

# This will ensure multiple python::virtualenv definitions can share the
# the same requirements file.
if !defined(File[$requirements]) {
if !defined(File[$requirements]) and $manage_requirements == true {
file { $requirements:
ensure => present,
mode => '0644',
Expand Down

0 comments on commit 42afd0d

Please sign in to comment.