- name: install packages
  dnf: name={{ item }} state=installed
  with_items:
  - jenkins
  - jenkins-openid-plugin
  tags:
  - jenkins
  - jenkins/master
  - packages

- name: install jenkins launcher config file
  copy: >
    src="jenkins.conf"
    dest="/etc/sysconfig/jenkins"
  notify:
  - restart jenkins
  tags:
  - jenkins
  - jenkins/master
  - config

- name: install main jenkins config file
  copy: >
    src="config.xml"
    dest="/var/lib/jenkins/config.xml"
  notify:
  - restart jenkins
  tags:
  - jenkins
  - jenkins/master
  - config

- name: install private ssh key
  action: copy src="{{ private }}/files/jenkins/ssh/jenkins_master" dest=/etc/jenkins/id_rsa mode=400 owner=jenkins group=jenkins
  tags:
  - jenkins
  - jenkins/master
  - config

- name: enable jenkins service to start on boot
  action: service name=jenkins state=running enabled=true
  tags:
  - jenkins
  - jenkins/master
  - service
