Merge "install-ansible: update venv once a day"

This commit is contained in:
Zuul 2022-12-07 04:59:09 +00:00 committed by Gerrit Code Review
commit 80f08c1f49
2 changed files with 12 additions and 1 deletions

View File

@ -45,6 +45,15 @@
vars:
create_venv_path: '/usr/ansible-venv'
# The boostrap job runs this all the time, and we'd like to skip
# trying to update the venv mostly. But we also want to have things
# like ansible specify '<X' so we pick up point releases. By writing
# the current day into the requirements.txt, the template updates once
# a day, and thus we update the venv just once a day.
- name: Get current day
shell: 'date +%Y-%m-%d'
register: _date
- name: Write out requirements file
template:
src: requirements.txt.j2
@ -59,7 +68,8 @@
pip:
requirements: '/usr/ansible-venv/requirements.txt'
virtualenv: '/usr/ansible-venv'
# If the requirements.txt has changed, force things to upgrade
# Always upgrade because only called in response to
# requirements.txt changes.
extra_args: '--upgrade'
# From Ansible 2.10 >= most of the fun stuff is in collections. Clone

View File

@ -1,3 +1,4 @@
# Update timestamp: {{ _date.stdout }}
{% for r in install_ansible_requirements %}
{{ r }}
{% endfor %}