--- # Shared by validate.yml and update.yml: the tasks_from: update entry point does not run validate.yml. The directory becomes TMPDIR of the apt # upgrade, so it must not be one that an ssh.service restart (PrivateTmp=yes) deletes, and it is created as root: a relative path, a `..` or an # odd character must stop the run before anything changes. - name: Validate the apt scratch directory ansible.builtin.assert: that: - system_baseline_apt_tmpdir is string - system_baseline_apt_tmpdir is match('^/[A-Za-z0-9._/-]+\Z') - "'..' not in system_baseline_apt_tmpdir" - system_baseline_apt_tmpdir is not match('^/(var/)?tmp(/|\Z)') fail_msg: >- system_baseline_apt_tmpdir must be an absolute path of letters, digits, . _ - and /, without .., and not /tmp, /var/tmp or a path below them. quiet: true tags: always