Merge "Ubuntu: update Apt cache before package installation"

This commit is contained in:
Zuul 2021-03-04 18:21:59 +00:00 committed by Gerrit Code Review
commit c60846507e
21 changed files with 54 additions and 6 deletions

View File

@ -11,6 +11,8 @@
package:
name: ipmitool
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True
run_once: True
delegate_to: "{{ controller_host }}"

View File

@ -0,0 +1,6 @@
---
###############################################################################
# Apt package manager configuration.
# Apt cache TTL in seconds. Default is 3600.
apt_cache_valid_time: 3600

View File

@ -46,6 +46,8 @@
package:
name: wget
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
- name: Ensure Dell srvadmin repository is installed
shell: "wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash"

View File

@ -26,6 +26,8 @@
package:
name: python3-virtualenv
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True
- name: Ensure global virtualenv directory exists

View File

@ -27,6 +27,8 @@
package:
name: python3-virtualenv
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True
- name: Ensure kolla-ansible virtualenv has the latest version of pip installed

View File

@ -6,6 +6,8 @@
package:
name: "{{ bootstrap_package_dependencies }}"
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True
- name: Check whether an SSH key exists

View File

@ -3,4 +3,6 @@
package:
name: "{{ dev_tools_packages }}"
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True

View File

@ -3,6 +3,8 @@
package:
name: python3-libselinux
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True
- name: Check if SELinux configuration file exists

View File

@ -16,6 +16,8 @@
# NOTE(mgoddard): select non-empty packages.
name: "{{ kolla_ansible_package_dependencies | select | list }}"
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True
- name: Ensure source code checkout parent directory exists

View File

@ -38,6 +38,7 @@
kolla_enable_tls_internal: False
kolla_enable_grafana: False
kolla_openstack_logging_debug: False
apt_cache_valid_time: 3600
- name: Verify kolla-ansible installation
shell: ". {{ temp_path }}/venv/bin/activate && kolla-ansible -h"

View File

@ -188,6 +188,7 @@
custom-password-1: "custom-password-1"
custom-password-2: "custom-password-2"
kolla_nova_compute_ironic_host: "controller1"
apt_cache_valid_time: 3600
- name: Verify kolla-ansible installation
shell: ". {{ temp_path }}/venv/bin/activate && kolla-ansible -h"

View File

@ -37,6 +37,7 @@
kolla_enable_tls_internal: False
kolla_enable_grafana: False
kolla_openstack_logging_debug: False
apt_cache_valid_time: 3600
- name: List Python packages installed in virtualenv
command: "{{ temp_path }}/venv/bin/pip list"

View File

@ -18,6 +18,8 @@
- python3-pip
- python3-virtualenv
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True
- name: Ensure source code checkout path exists

View File

@ -4,6 +4,8 @@
- name: Ensure acl package is installed
package:
name: acl
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: true
- name: Create local .pip directory

View File

@ -2,6 +2,8 @@
- name: Ensure iptables is installed
package:
name: iptables
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: true
# iptables -t nat -A POSTROUTING -o {{ interface }} -j SNAT --to-source {{ source_ip }}

View File

@ -15,6 +15,8 @@
- parted
- xfsprogs
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True
when: swift_block_devices | length > 0

View File

@ -34,8 +34,9 @@
include_role:
name: ../../swift-block-devices
vars:
swift_block_devices:
- device: "{{ loopback.stdout }}"
swift_block_devices:
- device: "{{ loopback.stdout }}"
apt_cache_valid_time: 3600
- name: Get name of fake partition
parted:

View File

@ -9,8 +9,9 @@
include_role:
name: ../../swift-block-devices
vars:
swift_block_devices:
- /dev/fake
swift_block_devices:
- /dev/fake
apt_cache_valid_time: 3600
rescue:
- name: Flag that the error was raised

View File

@ -26,8 +26,9 @@
include_role:
name: ../../swift-block-devices
vars:
swift_block_devices:
- device: "{{ loopback.stdout }}"
swift_block_devices:
- device: "{{ loopback.stdout }}"
apt_cache_valid_time: 3600
- name: Get name of fake partition
parted:

View File

@ -10,6 +10,8 @@
package:
name: lvm2
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_os_family == 'Debian' else omit }}"
become: True
- name: Check for unmounted block devices

10
etc/kayobe/apt.yml Normal file
View File

@ -0,0 +1,10 @@
---
###############################################################################
# Apt package manager configuration.
# Apt cache TTL in seconds. Default is 3600.
#apt_cache_valid_time:
###############################################################################
# Dummy variable to allow Ansible to accept this file.
workaround_ansible_issue_8743: yes