---
#
# Setup ansible-server instance
#
- name: install needed packages
  package:
    name:
      - ansible-core
      - git-core
      - ansible-collection-ansible-posix
      - ansible-collection-community-general
      - ansible-collection-community-mysql
      - ansible-collection-community-docker
      - ansible-collection-community-libvirt
      - ansible-collection-community-rabbitmq
      - ansible-collection-community-postgresql
      - ansible-collection-pulp-pulp_installer
  tags:
  - packages
  - ansible-server

- name: generate default ansible config
  template: src=ansible.cfg.j2 dest=/etc/ansible/ansible.cfg owner=root group=root mode=0644
  tags:
  - ansible-server

- name: installing the phx2 dns check script
  copy: src=dns_check.py dest=/usr/local/bin/dns_check owner=root mode=0755
  tags:
  - ansible-server

- name: install required collections
  command: ansible-galaxy install -r {{ ansible_base }}/ansible/roles/ansible-server/files/requirements.yml
  tags:
  - ansible-server
