Set SELinux options on the File (Folder) generated by pyvenv

Open
#600 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Domain
devops

Research direction

Start at the python::pyvenv declaration and the generated file resource for /var/www/externalapi/venv. Trace how the existing venv_dir, owner, and recurse values reach that resource, then determine how seltype can be passed through without a duplicate file declaration. Done means the example applies the SELinux type through pyvenv without a redeclare error.

Written by the indexing model from the issue text.

Description

I'd like to be able to set the SELinux type on my virtualenv, but if I declare a second file directive to do this, I get a redeclare error on the next puppet run.

For example:

file {'externalapi_venv':
  recurse => true,
  path => '/var/www/externalapi/venv',
  seltype => 'httpd_sys_content_rw_t',
}
python::pyvenv { '/var/www/externalapi' :
  ensure       => present,
  version      => '38',
  systempkgs   => true,
  venv_dir     => '/var/www/externalapi/venv',
  owner        => 'jkirsop',
  require => Vcsrepo['/var/www/externalapi/code'],
}

I'm not aware of a way of setting the seltype in a 'clean' way other than doing so through the file class, and so having the ability to do this within the pyvenv class (and then have it filter down to the file class) seems like the most obvious way to me.

Dominant language
Ruby
Stars
196
Forks
372
Avg merge
1d 18m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from voxpupuli/puppet-python

All issues in voxpupuli/puppet-python

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.