#
# This is a beaker_labcontroller role.
#
---
- name: install packages needed for beaker lab-controller
  package: name={{ item }} state=present
  with_items:
  - beaker-lab-controller
  - tftp-server

- name: Replace default labcontroller.conf file
  template:
    src: etc/beaker/labcontroller.conf.j2
    dest: /etc/beaker/labcontroller.conf
    owner: apache
    group: root
    mode: 0660
    backup: yes
    force: yes
  notify:
    - reload httpd
    - restart beaker lab controller
  tags:
    - beaker_lab_controller

- name: start required services
  service: name={{ item }} state=started enabled=yes
  with_items:
    - httpd
    - tftp.socket
    - beaker-proxy
    - beaker-provision
    - beaker-watchdog
    # beaker-transfer is left disabled, since we have no log archive server
  tags:
    - beaker_lab_controller
