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. Change-Id: I1c1dc35d8d59db4ae2b6770a620d91548a8a3734
This commit is contained in:
parent
a3cf1675c3
commit
a8d1c8268a
@ -212,3 +212,6 @@ openstack_hosts_systemd_networkd_networks: []
|
|||||||
openstack_hosts_systemd_networkd_prefix: openstack-net
|
openstack_hosts_systemd_networkd_prefix: openstack-net
|
||||||
openstack_hosts_systemd_services: []
|
openstack_hosts_systemd_services: []
|
||||||
openstack_hosts_systemd_slice: "openstack-hosts"
|
openstack_hosts_systemd_slice: "openstack-hosts"
|
||||||
|
|
||||||
|
openstack_hosts_git_safe_directories:
|
||||||
|
- "*"
|
||||||
|
@ -169,7 +169,6 @@
|
|||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
- openstack_hosts-config
|
- openstack_hosts-config
|
||||||
when: ansible_facts['hostname'] != 'aio1'
|
|
||||||
|
|
||||||
- name: Including openstack_hosts_systemd tasks
|
- name: Including openstack_hosts_systemd tasks
|
||||||
include_tasks: openstack_hosts_systemd.yml
|
include_tasks: openstack_hosts_systemd.yml
|
||||||
|
@ -29,6 +29,16 @@
|
|||||||
value: "{{ 'git/' ~ _git_version.stdout.split(' ')[2] ~ ' (osa/' ~ lookup('env', 'OSA_VERSION') ~ '/' ~ component | default('undefined') ~ ')' }}"
|
value: "{{ 'git/' ~ _git_version.stdout.split(' ')[2] ~ ' (osa/' ~ lookup('env', 'OSA_VERSION') ~ '/' ~ component | default('undefined') ~ ')' }}"
|
||||||
when: _git_version.rc == 0
|
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
|
- name: Write git config when git is not installed
|
||||||
template:
|
template:
|
||||||
src: gitconfig.j2
|
src: gitconfig.j2
|
||||||
|
@ -1,2 +1,9 @@
|
|||||||
[http "https://opendev.org/"]
|
[http "https://opendev.org/"]
|
||||||
userAgent = git/unknown (osa/{{ lookup('env', 'OSA_VERSION') }}/{{ component | default('undefined') }})
|
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 %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user