Merge "Set proxy option in early dnf invocation"

This commit is contained in:
Zuul 2021-10-19 11:30:18 +00:00 committed by Gerrit Code Review
commit 615d9b8f49
2 changed files with 11 additions and 1 deletions

View File

@ -40,6 +40,9 @@
gather_facts: no
vars:
ansible_user: "{{ bootstrap_user }}"
dnf_options:
- "-y"
- "{% if 'proxy' in dnf_config %}--setopt=proxy={{ dnf_config['proxy'] }}{% endif %}"
tags:
- ensure-python
tasks:
@ -49,8 +52,9 @@
failed_when: false
register: check_python
# TODO(priteau): Support apt proxy
- name: Ensure python is installed
raw: test -e /usr/bin/apt && (sudo apt -y update && sudo apt install -y python3-minimal) || (sudo dnf -y install python3)
raw: "test -e /usr/bin/apt && (sudo apt -y update && sudo apt install -y python3-minimal) || (sudo dnf {{ dnf_options | select | join(' ') }} install python3)"
when: check_python.rc != 0
- name: Ensure the Kayobe Ansible user account exists

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Sets proxy option when using ``dnf`` during user bootstrapping, before
``dnf.conf`` is updated. This allows Kayobe to install Python 3 during host
configuration when ``dnf`` requires a proxy to operate.