Ubuntu: update Apt cache before package installation
Update Apt cache prior to all package installation tasks. Adds apt_cache_valid_time, which defaults to 3600 seconds. This allows the time for which the Apt cache is valid to be configured. Change-Id: I0ecf4f4ce9b7333d3e41c69c3f908bee83391781 Story: 2004960 Task: 41766
This commit is contained in:
parent
a9bf637cc5
commit
0c309a18c8
@ -11,6 +11,8 @@
|
|||||||
package:
|
package:
|
||||||
name: ipmitool
|
name: ipmitool
|
||||||
state: present
|
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
|
become: True
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ controller_host }}"
|
delegate_to: "{{ controller_host }}"
|
||||||
|
6
ansible/group_vars/all/apt
Normal file
6
ansible/group_vars/all/apt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
###############################################################################
|
||||||
|
# Apt package manager configuration.
|
||||||
|
|
||||||
|
# Apt cache TTL in seconds. Default is 3600.
|
||||||
|
apt_cache_valid_time: 3600
|
@ -46,6 +46,8 @@
|
|||||||
package:
|
package:
|
||||||
name: wget
|
name: wget
|
||||||
state: present
|
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
|
- name: Ensure Dell srvadmin repository is installed
|
||||||
shell: "wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash"
|
shell: "wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash"
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
package:
|
package:
|
||||||
name: python3-virtualenv
|
name: python3-virtualenv
|
||||||
state: present
|
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
|
become: True
|
||||||
|
|
||||||
- name: Ensure global virtualenv directory exists
|
- name: Ensure global virtualenv directory exists
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
package:
|
package:
|
||||||
name: python3-virtualenv
|
name: python3-virtualenv
|
||||||
state: present
|
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
|
become: True
|
||||||
|
|
||||||
- name: Ensure kolla-ansible virtualenv has the latest version of pip installed
|
- name: Ensure kolla-ansible virtualenv has the latest version of pip installed
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
package:
|
package:
|
||||||
name: "{{ bootstrap_package_dependencies }}"
|
name: "{{ bootstrap_package_dependencies }}"
|
||||||
state: present
|
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
|
become: True
|
||||||
|
|
||||||
- name: Check whether an SSH key exists
|
- name: Check whether an SSH key exists
|
||||||
|
@ -3,4 +3,6 @@
|
|||||||
package:
|
package:
|
||||||
name: "{{ dev_tools_packages }}"
|
name: "{{ dev_tools_packages }}"
|
||||||
state: present
|
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
|
become: True
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
package:
|
package:
|
||||||
name: python3-libselinux
|
name: python3-libselinux
|
||||||
state: present
|
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
|
become: True
|
||||||
|
|
||||||
- name: Check if SELinux configuration file exists
|
- name: Check if SELinux configuration file exists
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
# NOTE(mgoddard): select non-empty packages.
|
# NOTE(mgoddard): select non-empty packages.
|
||||||
name: "{{ kolla_ansible_package_dependencies | select | list }}"
|
name: "{{ kolla_ansible_package_dependencies | select | list }}"
|
||||||
state: present
|
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
|
become: True
|
||||||
|
|
||||||
- name: Ensure source code checkout parent directory exists
|
- name: Ensure source code checkout parent directory exists
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
kolla_enable_tls_internal: False
|
kolla_enable_tls_internal: False
|
||||||
kolla_enable_grafana: False
|
kolla_enable_grafana: False
|
||||||
kolla_openstack_logging_debug: False
|
kolla_openstack_logging_debug: False
|
||||||
|
apt_cache_valid_time: 3600
|
||||||
|
|
||||||
- name: Verify kolla-ansible installation
|
- name: Verify kolla-ansible installation
|
||||||
shell: ". {{ temp_path }}/venv/bin/activate && kolla-ansible -h"
|
shell: ". {{ temp_path }}/venv/bin/activate && kolla-ansible -h"
|
||||||
|
@ -188,6 +188,7 @@
|
|||||||
custom-password-1: "custom-password-1"
|
custom-password-1: "custom-password-1"
|
||||||
custom-password-2: "custom-password-2"
|
custom-password-2: "custom-password-2"
|
||||||
kolla_nova_compute_ironic_host: "controller1"
|
kolla_nova_compute_ironic_host: "controller1"
|
||||||
|
apt_cache_valid_time: 3600
|
||||||
|
|
||||||
- name: Verify kolla-ansible installation
|
- name: Verify kolla-ansible installation
|
||||||
shell: ". {{ temp_path }}/venv/bin/activate && kolla-ansible -h"
|
shell: ". {{ temp_path }}/venv/bin/activate && kolla-ansible -h"
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
kolla_enable_tls_internal: False
|
kolla_enable_tls_internal: False
|
||||||
kolla_enable_grafana: False
|
kolla_enable_grafana: False
|
||||||
kolla_openstack_logging_debug: False
|
kolla_openstack_logging_debug: False
|
||||||
|
apt_cache_valid_time: 3600
|
||||||
|
|
||||||
- name: List Python packages installed in virtualenv
|
- name: List Python packages installed in virtualenv
|
||||||
command: "{{ temp_path }}/venv/bin/pip list"
|
command: "{{ temp_path }}/venv/bin/pip list"
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
- python3-pip
|
- python3-pip
|
||||||
- python3-virtualenv
|
- python3-virtualenv
|
||||||
state: present
|
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
|
become: True
|
||||||
|
|
||||||
- name: Ensure source code checkout path exists
|
- name: Ensure source code checkout path exists
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
- name: Ensure acl package is installed
|
- name: Ensure acl package is installed
|
||||||
package:
|
package:
|
||||||
name: acl
|
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
|
become: true
|
||||||
|
|
||||||
- name: Create local .pip directory
|
- name: Create local .pip directory
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
- name: Ensure iptables is installed
|
- name: Ensure iptables is installed
|
||||||
package:
|
package:
|
||||||
name: iptables
|
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
|
become: true
|
||||||
|
|
||||||
# iptables -t nat -A POSTROUTING -o {{ interface }} -j SNAT --to-source {{ source_ip }}
|
# iptables -t nat -A POSTROUTING -o {{ interface }} -j SNAT --to-source {{ source_ip }}
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
- parted
|
- parted
|
||||||
- xfsprogs
|
- xfsprogs
|
||||||
state: present
|
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
|
become: True
|
||||||
when: swift_block_devices | length > 0
|
when: swift_block_devices | length > 0
|
||||||
|
|
||||||
|
@ -34,8 +34,9 @@
|
|||||||
include_role:
|
include_role:
|
||||||
name: ../../swift-block-devices
|
name: ../../swift-block-devices
|
||||||
vars:
|
vars:
|
||||||
swift_block_devices:
|
swift_block_devices:
|
||||||
- device: "{{ loopback.stdout }}"
|
- device: "{{ loopback.stdout }}"
|
||||||
|
apt_cache_valid_time: 3600
|
||||||
|
|
||||||
- name: Get name of fake partition
|
- name: Get name of fake partition
|
||||||
parted:
|
parted:
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
include_role:
|
include_role:
|
||||||
name: ../../swift-block-devices
|
name: ../../swift-block-devices
|
||||||
vars:
|
vars:
|
||||||
swift_block_devices:
|
swift_block_devices:
|
||||||
- /dev/fake
|
- /dev/fake
|
||||||
|
apt_cache_valid_time: 3600
|
||||||
|
|
||||||
rescue:
|
rescue:
|
||||||
- name: Flag that the error was raised
|
- name: Flag that the error was raised
|
||||||
|
@ -26,8 +26,9 @@
|
|||||||
include_role:
|
include_role:
|
||||||
name: ../../swift-block-devices
|
name: ../../swift-block-devices
|
||||||
vars:
|
vars:
|
||||||
swift_block_devices:
|
swift_block_devices:
|
||||||
- device: "{{ loopback.stdout }}"
|
- device: "{{ loopback.stdout }}"
|
||||||
|
apt_cache_valid_time: 3600
|
||||||
|
|
||||||
- name: Get name of fake partition
|
- name: Get name of fake partition
|
||||||
parted:
|
parted:
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
package:
|
package:
|
||||||
name: lvm2
|
name: lvm2
|
||||||
state: present
|
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
|
become: True
|
||||||
|
|
||||||
- name: Check for unmounted block devices
|
- name: Check for unmounted block devices
|
||||||
|
10
etc/kayobe/apt.yml
Normal file
10
etc/kayobe/apt.yml
Normal 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
|
Loading…
x
Reference in New Issue
Block a user