From 10943580334cc654ecb61cc446ef7c1f61abe38c Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Wed, 26 Aug 2020 12:46:08 +0200 Subject: [PATCH] Move dnf.yml earlier in host configure workflow Since kayobe is installing python3-pip in pip.yml - and dnf proxy is set later, it fails on no-direct-internet systems. Change-Id: I93f29ec4334829bfec107ba7aa6df05a47d2ab96 Story: 2008067 Task: 40750 Depends-On: https://review.opendev.org/748587 Depends-On: https://review.opendev.org/750804 --- ansible/dnf.yml | 2 ++ kayobe/cli/commands.py | 24 +++++++++---------- kayobe/tests/unit/cli/test_commands.py | 6 ++--- .../bugfix-dnf-proxy-cd934867c3d64388.yaml | 5 ++++ 4 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 releasenotes/notes/bugfix-dnf-proxy-cd934867c3d64388.yaml diff --git a/ansible/dnf.yml b/ansible/dnf.yml index 3a106c13f..c31ed272c 100644 --- a/ansible/dnf.yml +++ b/ansible/dnf.yml @@ -1,6 +1,8 @@ --- - name: Ensure DNF repos are configured hosts: seed-hypervisor:seed:overcloud + vars: + ansible_python_interpreter: /usr/libexec/platform-python tags: - dnf tasks: diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index b4a2a6009..011e8f2c0 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -406,11 +406,11 @@ class SeedHypervisorHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, * Allocate IP addresses for all configured networks. * Add the host to SSH known hosts. * Configure a user account for use by kayobe for SSH access. + * Configure package repos. + * Configure a PyPI mirror. * Optionally, create a virtualenv for remote target hosts. * Optionally, wipe unmounted disk partitions (--wipe-disks). * Configure user accounts, group associations, and authorised SSH keys. - * Configure a PyPI mirror. - * Configure package repos. * Configure the host's network interfaces. * Set sysctl parameters. * Configure timezone. @@ -448,11 +448,11 @@ class SeedHypervisorHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, playbooks = _build_playbook_list( "ssh-known-host", "kayobe-ansible-user", - "pip", "kayobe-target-venv") + "dnf", "pip", "kayobe-target-venv") if parsed_args.wipe_disks: playbooks += _build_playbook_list("wipe-disks") playbooks += _build_playbook_list( - "users", "dnf", "dev-tools", "network", "sysctl", "timezone", + "users", "dev-tools", "network", "sysctl", "timezone", "mdadm", "luks", "lvm", "seed-hypervisor-libvirt-host") self.run_kayobe_playbooks(parsed_args, playbooks, limit="seed-hypervisor") @@ -560,11 +560,11 @@ class SeedHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, * Allocate IP addresses for all configured networks. * Add the host to SSH known hosts. * Configure a user account for use by kayobe for SSH access. + * Configure package repos. + * Configure a PyPI mirror. * Optionally, create a virtualenv for remote target hosts. * Optionally, wipe unmounted disk partitions (--wipe-disks). * Configure user accounts, group associations, and authorised SSH keys. - * Configure a PyPI mirror. - * Configure package repos. * Disable SELinux. * Configure the host's network interfaces. * Set sysctl parameters. @@ -599,11 +599,11 @@ class SeedHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, # Run kayobe playbooks. playbooks = _build_playbook_list( "ssh-known-host", "kayobe-ansible-user", - "pip", "kayobe-target-venv") + "dnf", "pip", "kayobe-target-venv") if parsed_args.wipe_disks: playbooks += _build_playbook_list("wipe-disks") playbooks += _build_playbook_list( - "users", "dnf", "dev-tools", "disable-selinux", "network", + "users", "dev-tools", "disable-selinux", "network", "sysctl", "ip-routing", "snat", "disable-glean", "timezone", "mdadm", "luks", "lvm", "docker-devicemapper", "kolla-ansible-user", "kolla-pip", "kolla-target-venv") @@ -931,11 +931,11 @@ class OvercloudHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, * Allocate IP addresses for all configured networks. * Add the host to SSH known hosts. * Configure a user account for use by kayobe for SSH access. + * Configure package repos. + * Configure a PyPI mirror. * Optionally, create a virtualenv for remote target hosts. * Optionally, wipe unmounted disk partitions (--wipe-disks). * Configure user accounts, group associations, and authorised SSH keys. - * Configure a PyPI mirror. - * Configure package repos. * Disable SELinux. * Configure the host's network interfaces. * Set sysctl parameters. @@ -968,11 +968,11 @@ class OvercloudHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, # Kayobe playbooks. playbooks = _build_playbook_list( "ssh-known-host", "kayobe-ansible-user", - "pip", "kayobe-target-venv") + "dnf", "pip", "kayobe-target-venv") if parsed_args.wipe_disks: playbooks += _build_playbook_list("wipe-disks") playbooks += _build_playbook_list( - "users", "dnf", "dev-tools", "disable-selinux", "network", + "users", "dev-tools", "disable-selinux", "network", "sysctl", "disable-glean", "disable-cloud-init", "timezone", "mdadm", "luks", "lvm", "docker-devicemapper", "kolla-ansible-user", "kolla-pip", "kolla-target-venv") diff --git a/kayobe/tests/unit/cli/test_commands.py b/kayobe/tests/unit/cli/test_commands.py index 8293fcf6f..aebb7edf3 100644 --- a/kayobe/tests/unit/cli/test_commands.py +++ b/kayobe/tests/unit/cli/test_commands.py @@ -317,11 +317,11 @@ class TestCase(unittest.TestCase): utils.get_data_files_path("ansible", "ssh-known-host.yml"), utils.get_data_files_path( "ansible", "kayobe-ansible-user.yml"), + utils.get_data_files_path("ansible", "dnf.yml"), utils.get_data_files_path("ansible", "pip.yml"), utils.get_data_files_path( "ansible", "kayobe-target-venv.yml"), utils.get_data_files_path("ansible", "users.yml"), - utils.get_data_files_path("ansible", "dnf.yml"), utils.get_data_files_path("ansible", "dev-tools.yml"), utils.get_data_files_path("ansible", "network.yml"), utils.get_data_files_path("ansible", "sysctl.yml"), @@ -485,11 +485,11 @@ class TestCase(unittest.TestCase): utils.get_data_files_path("ansible", "ssh-known-host.yml"), utils.get_data_files_path( "ansible", "kayobe-ansible-user.yml"), + utils.get_data_files_path("ansible", "dnf.yml"), utils.get_data_files_path("ansible", "pip.yml"), utils.get_data_files_path( "ansible", "kayobe-target-venv.yml"), utils.get_data_files_path("ansible", "users.yml"), - utils.get_data_files_path("ansible", "dnf.yml"), utils.get_data_files_path("ansible", "dev-tools.yml"), utils.get_data_files_path( "ansible", "disable-selinux.yml"), @@ -1003,11 +1003,11 @@ class TestCase(unittest.TestCase): utils.get_data_files_path("ansible", "ssh-known-host.yml"), utils.get_data_files_path( "ansible", "kayobe-ansible-user.yml"), + utils.get_data_files_path("ansible", "dnf.yml"), utils.get_data_files_path("ansible", "pip.yml"), utils.get_data_files_path( "ansible", "kayobe-target-venv.yml"), utils.get_data_files_path("ansible", "users.yml"), - utils.get_data_files_path("ansible", "dnf.yml"), utils.get_data_files_path("ansible", "dev-tools.yml"), utils.get_data_files_path( "ansible", "disable-selinux.yml"), diff --git a/releasenotes/notes/bugfix-dnf-proxy-cd934867c3d64388.yaml b/releasenotes/notes/bugfix-dnf-proxy-cd934867c3d64388.yaml new file mode 100644 index 000000000..e4e60d235 --- /dev/null +++ b/releasenotes/notes/bugfix-dnf-proxy-cd934867c3d64388.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix an issue when dnf proxy is set and python3-pip package fails during + host configure.