ansible-role-python_venv_build/tasks/python_venv_set_facts.yml
Dmitriy Rabotyagov 3d1740bde2 Drop unneeded become overrides
We add become overrides on the task level which neglect provided by
user options in favor of quite narrow usecase. As a result, role can not
be run as a non-root user in cases where venv_build_host is not localhost

Removing become override potenially unblocks running OSA with non-root
user on hosts.

Change-Id: I663bdb1bcc60fec0d9efc55cbb1b2a0c566ab2ab
2023-10-11 15:18:43 +02:00

34 lines
1.1 KiB
YAML

---
# Copyright 2018, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Ensure local facts folder exists
file:
path: /etc/ansible/facts.d
state: directory
mode: "0755"
- name: Record the necessary facts
ini_file:
dest: "/etc/ansible/facts.d/{{ venv_facts_dest }}.fact"
section: "{{ item.section }}"
option: "{{ item.option }}"
value: "{{ item.value | string }}"
mode: "0644"
with_items: "{{ venv_facts_when_changed }}"
when:
- (_install_venv_pip_packages is defined and
_install_venv_pip_packages is mapping and
_install_venv_pip_packages is changed)