Add default package manager config
We already have extra config for package manager. With this patch we extend existing functionality by adding optional default value, that will be concatinated with extra config. Deployers are able to set default config to empty string if want to disable that behaviour. Change-Id: Ifa40a5296969088fd8f2d07968a8d94e3bc5b2c5
This commit is contained in:
parent
2fa0318c73
commit
c4405603be
|
@ -178,6 +178,7 @@ openstack_host_ca_certificates: []
|
|||
openstack_ca_bundle_path: "{{ _openstack_ca_bundle_path }}"
|
||||
|
||||
# extra configuration for OS package manager
|
||||
openstack_hosts_package_manager_default_conf: "{{ _openstack_hosts_package_manager_default_conf | default('') }}"
|
||||
openstack_hosts_package_manager_extra_conf: ''
|
||||
|
||||
# apt pins to apply to all hosts in the deployment
|
||||
|
|
|
@ -75,10 +75,10 @@
|
|||
|
||||
- name: Add apt extra conf
|
||||
copy:
|
||||
content: "{{ openstack_hosts_package_manager_extra_conf }}"
|
||||
content: "{{ openstack_hosts_package_manager_default_conf + openstack_hosts_package_manager_extra_conf }}"
|
||||
dest: /etc/apt/apt.conf.d/99openstack-ansible
|
||||
when:
|
||||
- openstack_hosts_package_manager_extra_conf | length > 0
|
||||
- openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0
|
||||
|
||||
- name: Update Apt cache
|
||||
apt:
|
||||
|
|
|
@ -94,12 +94,12 @@
|
|||
|
||||
- name: Add dnf extra conf
|
||||
blockinfile:
|
||||
block: "{{ openstack_hosts_package_manager_extra_conf }}"
|
||||
block: "{{ openstack_hosts_package_manager_default_conf + openstack_hosts_package_manager_extra_conf }}"
|
||||
path: /etc/dnf/dnf.conf
|
||||
marker: "# {mark} OPENSTACK-ANSIBLE-OPENSTACK_HOSTS MANAGED BLOCK"
|
||||
create: yes
|
||||
when:
|
||||
- openstack_hosts_package_manager_extra_conf | length > 0
|
||||
- openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0
|
||||
|
||||
- name: Add rdo repositories via url
|
||||
get_url:
|
||||
|
|
|
@ -92,9 +92,9 @@
|
|||
|
||||
- name: Add yum extra conf
|
||||
blockinfile:
|
||||
block: "{{ openstack_hosts_package_manager_extra_conf }}"
|
||||
block: "{{ openstack_hosts_package_manager_default_conf + openstack_hosts_package_manager_extra_conf }}"
|
||||
path: /etc/yum.conf
|
||||
marker: "# {mark} OPENSTACK-ANSIBLE-OPENSTACK_HOSTS MANAGED BLOCK"
|
||||
create: yes
|
||||
when:
|
||||
- openstack_hosts_package_manager_extra_conf | length > 0
|
||||
- openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0
|
||||
|
|
|
@ -90,3 +90,6 @@ _package_repos:
|
|||
filename: "osbpo"
|
||||
|
||||
_openstack_ca_bundle_path: /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
_openstack_hosts_package_manager_default_conf: |
|
||||
APT::Install-Recommends "false";
|
||||
|
|
|
@ -91,3 +91,6 @@ _package_repos:
|
|||
filename: "uca"
|
||||
|
||||
_openstack_ca_bundle_path: /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
_openstack_hosts_package_manager_default_conf: |
|
||||
APT::Install-Recommends "false";
|
||||
|
|
Loading…
Reference in New Issue