- name: install packages
  yum: name={{ item }} state=installed
  with_items:
  - java-1.8.0-openjdk-devel
  # TODO: install more packages (copy from jenkins-cloud.yml)
  tags:
  - jenkins
  - jenkins/slave
  - packages

- name: create jenkins user
  action: user name=jenkins state=present createhome=yes system=no
  tags:
  - jenkins
  - jenkins/slave
  - config

- name: add jenkins ssh public key to authorized keys
  action: authorized_key user=jenkins key="{{ item }}"
  with_file:
  - "{{ private }}/files/jenkins/ssh/jenkins_master.pub"
  tags:
  - jenkins
  - jenkins/slave
  - config
