- hosts: all
  roles:
    - role: bindep
      bindep_profile: test
      bindep_dir: "src/{{ zuul.project.canonical_name }}"
    - legacy-install-afs-with-puppet
    - legacy-copy-project-config-scripts

  pre_tasks:
    # NOTE(pabelanger): Needed by puppet-openafs package.
    - name: Add OpenAFS OpenStack CI build
      yum_repository:
        name: openafs
        description: OpenAFS OpenStack CI build
        baseurl: https://tarballs.openstack.org/project-config/package-afs-centos7
        gpgcheck: no
      when: ansible_distribution == "CentOS"

    # NOTE(pabelanger): Manually install EPEL dependencies as not to keep EPEL
    # enabled.
    - name: Manually install EPEL dependencies
      become: yes
      yum:
        name: "{{ item }}"
        enablerepo: epel
        state: present
      when: ansible_distribution == "CentOS"
      with_items:
        - dkms
        - kstart
        - parallel

- hosts: all
  roles:
    - role: bindep
      bindep_profile: test
      bindep_dir: "src/{{ zuul.project.canonical_name }}"
    - legacy-install-afs-with-puppet
    - legacy-copy-project-config-scripts

  pre_tasks:
    # NOTE(pabelanger): Needed by puppet-openafs package.
    - name: Add OpenAFS OpenStack CI build
      become: yes
      yum_repository:
        name: openafs
        description: OpenAFS OpenStack CI build
        baseurl: https://tarballs.openstack.org/project-config/package-afs-centos7
        gpgcheck: no
      when: ansible_distribution == "CentOS"

    # NOTE(pabelanger): Manually install EPEL dependencies as not to keep EPEL
    # enabled.
    - name: Manually install EPEL dependencies
      become: yes
      yum:
        name: "{{ item }}"
        enablerepo: epel
        state: present
      when: ansible_distribution == "CentOS"
      with_items:
        - dkms
        - kstart
        - parallel

Use become: yes for yum_repository task
Use become: yes for yum_repository task

We need to be root to add repo files.

Change-Id: Ie1e56e49fb37792c74cc6b045a8f345b95a6d755
Signed-off-by: Paul Belanger <e7139c8e6c4ea75cc1c287ce081b2dc0f3ab39ec@redhat.com>
