Skip to content
Snippets Groups Projects
Commit 29d73eed authored by Pierre Riteau's avatar Pierre Riteau
Browse files

Set proxy option in early dnf invocation

If hosts need to use a proxy to install packages and python is absent,
the call to install the python package will hang, at least on CentOS.

Set proxy if it exists in dnf_config using a command-line option. Later
uses of dnf will be after dnf.conf has been updated.

Change-Id: Ic949577afd3ea07306cebf224637a08a1ecce0f5
Story: 2009274
Task: 43528
parent f11c73ff
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
gather_facts: no gather_facts: no
vars: vars:
ansible_user: "{{ bootstrap_user }}" ansible_user: "{{ bootstrap_user }}"
dnf_options:
- "-y"
- "{% if 'proxy' in dnf_config %}--setopt=proxy={{ dnf_config['proxy'] }}{% endif %}"
tags: tags:
- ensure-python - ensure-python
tasks: tasks:
...@@ -49,8 +52,9 @@ ...@@ -49,8 +52,9 @@
failed_when: false failed_when: false
register: check_python register: check_python
# TODO(priteau): Support apt proxy
- name: Ensure python is installed - 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 when: check_python.rc != 0
- name: Ensure the Kayobe Ansible user account exists - name: Ensure the Kayobe Ansible user account exists
......
---
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.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment