From d3186b2c14784cfeaa6ca9051cf55b4c9e31e68b Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 29 May 2024 16:35:40 +0100 Subject: [PATCH] Allow openstack_hosts role to configure git safe.directory entries This is defaulted to '*" and will be undefined when a CI specific override is subsequently merged to the openstack-ansible repository. This also includes backport of [1] which removes curl installation due to ansible bug. Also functional jobs are temporary disabled to resolve merge conflict [1] https://review.opendev.org/c/openstack/openstack-ansible-openstack_hosts/+/904403 Needed-By: https://review.opendev.org/c/openstack/openstack-ansible/+/923632 Change-Id: I1c1dc35d8d59db4ae2b6770a620d91548a8a3734 (cherry picked from commit a8d1c8268a252cd7cc5ff0ec0988b75277a0a5fe) (cherry picked from commit fb760d2902c30e517f342955efabfc3d8a11d0b8) --- defaults/main.yml | 5 ++++- tasks/main.yml | 1 - tasks/openstack_gitconfig.yml | 10 ++++++++++ templates/gitconfig.j2 | 7 +++++++ vars/redhat-9.yml | 1 - zuul.d/project.yaml | 27 +++------------------------ 6 files changed, 24 insertions(+), 27 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 549dc1a5..8ba7494b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -186,4 +186,7 @@ openstack_hosts_package_manager_extra_conf: '' openstack_hosts_apt_pinned_packages: - package: "src:ceph" origin: "ubuntu-cloud.archive.canonical.com" - priority: 400 \ No newline at end of file + priority: 400 + +openstack_hosts_git_safe_directories: + - "*" diff --git a/tasks/main.yml b/tasks/main.yml index 2331b289..d11f2fb4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -164,4 +164,3 @@ apply: tags: - openstack_hosts-config - when: ansible_facts['hostname'] != 'aio1' diff --git a/tasks/openstack_gitconfig.yml b/tasks/openstack_gitconfig.yml index ca4c646f..cb41c8e7 100644 --- a/tasks/openstack_gitconfig.yml +++ b/tasks/openstack_gitconfig.yml @@ -29,6 +29,16 @@ value: "{{ 'git/' ~ _git_version.stdout.split(' ')[2] ~ ' (osa/' ~ lookup('env', 'OSA_VERSION') ~ '/' ~ component | default('undefined') ~ ')' }}" when: _git_version.rc == 0 +- name: Configure git safe directories + git_config: + scope: system + name: safe.directory + value: "{{ item }}" + with_items: "{{ openstack_hosts_git_safe_directories }}" + when: + - _git_version.rc == 0 + - openstack_hosts_git_safe_directories is defined + - name: Write git config when git is not installed template: src: gitconfig.j2 diff --git a/templates/gitconfig.j2 b/templates/gitconfig.j2 index 27e6d4bc..b2e6e94e 100644 --- a/templates/gitconfig.j2 +++ b/templates/gitconfig.j2 @@ -1,2 +1,9 @@ [http "https://opendev.org/"] userAgent = git/unknown (osa/{{ lookup('env', 'OSA_VERSION') }}/{{ component | default('undefined') }}) + +{% if openstack_hosts_git_safe_directories is defined %} +[safe] +{% for dir in openstack_hosts_git_safe_directories %} + directory = {{ dir }} +{% endfor %} +{% endif %} diff --git a/vars/redhat-9.yml b/vars/redhat-9.yml index cd02cac6..e0d3f322 100644 --- a/vars/redhat-9.yml +++ b/vars/redhat-9.yml @@ -52,7 +52,6 @@ _openstack_host_distro_packages: ## Bare metal base packages _openstack_host_metal_distro_packages: - cronie - - /usr/bin/curl - device-mapper-event - dstat - ebtables diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index f623b3b5..960037aa 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -15,31 +15,10 @@ - project: templates: - - openstack-ansible-deploy-hosts_metal-jobs - - openstack-ansible-deploy-hosts_distro_lxc-jobs - - openstack-ansible-upgrade-infra_lxc-jobs + # - openstack-ansible-deploy-hosts_metal-jobs + # - openstack-ansible-deploy-hosts_distro_lxc-jobs + # - openstack-ansible-upgrade-infra_lxc-jobs - check-requirements - publish-openstack-docs-pti - build-release-notes-jobs-python3 - openstack-ansible-linters-jobs - - check: - jobs: - - openstack-ansible-deploy-hosts_metal-centos-9-stream: - voting: false - - openstack-ansible-deploy-hosts_metal-rockylinux-9: - voting: false - - openstack-ansible-deploy-hosts_distro_lxc-centos-9-stream: - voting: false - - openstack-ansible-deploy-hosts_distro_lxc-rockylinux-9: - voting: false - gate: - jobs: - - openstack-ansible-deploy-hosts_metal-centos-9-stream: - voting: false - - openstack-ansible-deploy-hosts_metal-rockylinux-9: - voting: false - - openstack-ansible-deploy-hosts_distro_lxc-centos-9-stream: - voting: false - - openstack-ansible-deploy-hosts_distro_lxc-rockylinux-9: - voting: false