Defined Type: python_deploy::venv
- Defined in:
- modules/python_deploy/manifests/venv.pp
Summary
Deploy Python code in a virtualenvOverview
SPDX-License-Identifier: Apache-2.0 Deploy the bits needed to be able to deploy Python code in a simple manner, basically mimicking what scap does for the repositories of Python3 software that has frozen wheels and needs to be deployed in a virtualenv. This define was born as a workaround to not be blocked by the migration of Scap to Python 3 and might or might be not used after that.
This define and scap::target are mutually exclusive, including both will results in compilation errors.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'modules/python_deploy/manifests/venv.pp', line 16
define python_deploy::venv (
String $project_name = $title,
String $deploy_user = "deploy-${title}",
Boolean $add_home_dir = false,
) {
include python_deploy
if $add_home_dir {
$home_dir = "/var/lib/${deploy_user}"
wmflib::dir::mkdir_p($home_dir)
$params = { home_dir => $home_dir }
} else {
$params = {}
}
ensure_resources('systemd::sysuser', { $deploy_user => $params })
file { "/srv/deployment/${project_name}":
ensure => directory,
owner => $deploy_user,
group => 'root',
mode => '0755',
}
}
|