zuul-jobs/test-playbooks/base-test-roles/configure-mirrors.yaml
James E. Blair d6ae964f47 Avoid fstrings in test-prepare-workspace-git
Fstrings are not supported in python3.5 which is in use on Xenial.
We don't claim to support Xenial, but this is an easy regression
to avoid.

Also, add test jobs for this role so that we get feedback before
copying it to the prod roles.

Also, add a xenial test job to exercise it since we still have
Xenial nodes available.

Change-Id: Ifc773aa688adb1a01cfe691b3bdca0b3086658cd
2024-08-28 09:55:55 -07:00

58 lines
1.7 KiB
YAML

- name: Test the configure-mirrors role with http
hosts: all
roles:
- role: configure-mirrors
mirror_fqdn: "{{ zuul_site_mirror_fqdn }}"
set_apt_mirrors_trusted: True
post_tasks:
- name: Set emacs package fact for gentoo
set_fact:
emacs_package: app-editors/emacs
when: ansible_distribution == 'Gentoo'
- name: Install a package to sanity check the http mirror configuration
package:
name: "{{ emacs_package | default('emacs') }}"
state: "present"
become: yes
- name: Test the configure-mirrors role with https
hosts: all
roles:
- role: configure-mirrors
mirror_fqdn: "{{ zuul_site_mirror_fqdn }}"
mirror_use_ssl: True
set_apt_mirrors_trusted: True
post_tasks:
- name: Set emacs package fact for gentoo
set_fact:
emacs_package: app-editors/emacs
when: ansible_distribution == 'Gentoo'
- name: Remove existing emacs package install
package:
name: "{{ emacs_package | default('emacs') }}"
state: "absent"
become: yes
- name: Install a package to sanity check the https mirror configuration
package:
name: "{{ emacs_package | default('emacs') }}"
state: "present"
become: yes
- name: Ensure no apt warnings
hosts: all
tasks:
- name: Check apt output
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
block:
- name: Run apt-get update
command: 'apt-get update'
register: _apt_get_output
become: yes
tags:
- skip_ansible_lint
- name: Check for warnings in output
fail:
msg: 'Warnings found in apt output'
when: _apt_get_output is regex('^W:.*$')