feat: add optional umask setting for pip
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2021-07-25 15:27:44 +02:00
parent ff0e22abad
commit a6161e0217
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 21 additions and 0 deletions

View File

@ -8,6 +8,10 @@ pve_sd_packages_extra: []
pve_sd_virtualenv_command: /usr/bin/python3 -m venv
pve_sd_virtualenv: /opt/python3/pve_sd
# @var pve_sd_virtualenv_umask:description: Set a custom umask and ignore the system default settings.
# @var pve_sd_virtualenv_umask: $ "_unset_"
# @var pve_sd_virtualenv_umask:example: $ "0022"
pve_sd_user: "prometheus_adm"
pve_sd_group: "{{ pve_sd_user }}"
pve_sd_extra_groups: []
@ -18,8 +22,14 @@ pve_sd_service_stopped: False
pve_sd_log_level: info
pve_sd_log_format: console
pve_sd_output_file: /out/pve.json
pve_sd_exclude_state: []
pve_sd_exclude_vmid: []
pve_sd_service: False
pve_sd_pve_server: pve.example.com
pve_sd_pve_user: root
pve_sd_pve_password: secure

View File

@ -18,6 +18,7 @@
virtualenv: "{{ pve_sd_virtualenv }}"
virtualenv_command: "{{ pve_sd_virtualenv_command }}"
extra_args: --upgrade
umask: "{{ pve_sd_virtualenv_umask | default(omit) }}"
loop:
- pip
- setuptools
@ -27,6 +28,7 @@
name: "{{ item }}"
virtualenv: "{{ pve_sd_virtualenv }}"
virtualenv_command: "{{ pve_sd_virtualenv_command }}"
umask: "{{ pve_sd_virtualenv_umask | default(omit) }}"
environment:
TMPDIR: /opt/python3/tmp
loop: "{{ pve_sd_packages_extra }}"
@ -36,6 +38,7 @@
name: "{{ item }}"
virtualenv: "{{ pve_sd_virtualenv }}"
virtualenv_command: "{{ pve_sd_virtualenv_command }}"
umask: "{{ pve_sd_virtualenv_umask | default(omit) }}"
loop: "{{ __pve_sd_packages }}"
- name: Adjust file permissions

View File

@ -2,8 +2,16 @@
{{ ansible_managed | comment }}
PROMETHEUS_PVE_SD_LOG_LEVEL={{ pve_sd_log_level }}
PROMETHEUS_PVE_SD_LOG_FORMAT={{ pve_sd_log_format }}
PROMETHEUS_PVE_SD_OUTPUT_FILE={{ pve_sd_output_file }}
PROMETHEUS_PVE_SD_SERVICE={{ pve_sd_service | bool | lower }}
PROMETHEUS_PVE_SD_EXCLUDE_STATE={{ pve_sd_exclude_state | join(",") }}
PROMETHEUS_PVE_SD_EXCLUDE_VMID={{ pve_sd_exclude_vmid | join(",") }}
PROMETHEUS_PVE_SD_PVE_SERVER={{ pve_sd_pve_server }}
PROMETHEUS_PVE_SD_PVE_USER={{ pve_sd_pve_user }}
PROMETHEUS_PVE_SD_PVE_PASSWORD={{ pve_sd_pve_password }}
PROMETHEUS_PVE_SD_PVE_AUTH_TIMEOUT=5
PROMETHEUS_PVE_SD_PVE_VERIFY_SSL=true