- name: Test the creation of the mirror-info script
  hosts: all
  roles:
    - role: mirror-info
      mirror_fqdn: "{{ zuul_site_mirror_fqdn }}"
  post_tasks:
    - name: Stat mirror script
      stat:
        path: /etc/ci/mirror_info.sh
      register: stat_result
    # note this is "sh" (not bash) just to make sure
    # it sources as POSIX
    - name: Check mirror script can be sourced
      shell: set -ex && . /etc/ci/mirror_info.sh && echo $AFS_SLUG
    - name: Check /etc/ci/mirror_info.sh
      assert:
        that:
          - stat_result.stat.exists
          - stat_result.stat.mode == '0644'