install-launch-node: upgrade launch env periodically

This writes the date of the pyproject.toml into a stamp file in the
venv.  If it updates, we run pip with "latest" which should update the
environment.  The normal "latest" run should ensure any changes to
launch-node get populated as usual.

This should ensure we keep things like openstackclient updated, but
just once per day.

Change-Id: I50674a25da9e1761af8daa78970c473e651791b0
This commit is contained in:
Ian Wienand 2023-04-04 08:33:31 +10:00
parent a24509a7d7
commit 19d9360b55
No known key found for this signature in database
2 changed files with 11 additions and 0 deletions

View File

@ -12,10 +12,20 @@
group: root group: root
mode: '0600' mode: '0600'
# This is used to timestamp the launch-env-req.txt file. This means
# we will run --upgrade on the venv once a day, but otherwise leave it
# alone.
- name: Install node launcher stamp
template:
src: launch-env-req.txt.j2
dest: /usr/launcher-venv/launch-env-req.txt
register: _upgrade
- name: Install node launcher - name: Install node launcher
pip: pip:
name: 'file:///home/zuul/src/opendev.org/opendev/system-config/launch' name: 'file:///home/zuul/src/opendev.org/opendev/system-config/launch'
virtualenv: '/usr/launcher-venv' virtualenv: '/usr/launcher-venv'
state: '{{ "latest" if _upgrade.changed else "present" }}'
# Admins use openstackclient on the bastion host to deal with cloud # Admins use openstackclient on the bastion host to deal with cloud
# issues. The best version to use is the one from launch node, as # issues. The best version to use is the one from launch node, as

View File

@ -0,0 +1 @@
# Update timestamp: {{ now(fmt='%Y-%m-%d') }}