
- name: Setup arm-packager hosts
  hosts: arm-packager
  user: root
  gather_facts: True
  tags:
   - arm-packager

  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  pre_tasks:
  - include: "{{ tasks }}/yumrepos.yml"

  roles:
  - base
  - rkhunter
  - denyhosts
  - hosts
  - fas_client
  - sudo

  tasks:
  # this is how you include other task lists
  - include: "{{ tasks }}/motd.yml"

  - name: install packager tools (yum)
    action: yum state=present pkg={{ item }}
    with_items:
    - fedora-packager
    when: ansible_distribution_major_version|int < 22
    tags:
    - packages

  - name: install packager tools (dnf)
    action: dnf state=present pkg={{ item }}
    with_items:
    - fedora-packager
    when: ansible_distribution_major_version|int > 21
    tags:
    - packages

  - name: allow packagers to use mock
    lineinfile: dest=/etc/pam.d/mock line="{{ item }} sufficient pam_succeed_if.so user ingroup packager use_uid quiet"
    with_items:
    - account
    - auth
    tags:
    - config

  handlers:
  - include: "{{ handlers }}/restart_services.yml"
