--- /dev/null
+---
+
+- hosts: jenkins
+ user: centos
+ sudo: true
+ roles:
+ - ansible-jenkins
+ vars:
+ - nginx_processor_count: 20
+ - nginx_connections: 2048
+ - ansible_ssh_port: 2222
+ - plugins:
+ - 'ldap'
+ - 'github'
+ - 'translation'
+ - 'preSCMbuildstep'
+ - 'copyartifact'
+ - 'ssh-slaves'
+ - 'scm-api'
+ - 'rebuild'
+ - 'publish-over-ssh'
+ - 'nested-view'
+ - 'jenkins-multijob-plugin'
+ - 'ghprb'
+ - 'github'
+ - 'github-api'
+ - 'git'
+ - 'git-client'
+ - 'envinject'
+ - 'credentials'
+ - 'copyartifact'
+ - 'github-oauth'
+
+ - port: 8080
+ - prefix: '/build'
+ - xmx: 8192
+ # Email support
+ #- email:
+ # smtp_host: 'mail.example.com'
+ # smtp_ssl: 'true'
+ # default_email_suffix: '@example.com'
+++ /dev/null
----
-
-- hosts: jenkins
- user: centos
- sudo: true
- roles:
- - ansible-jenkins
- vars:
- - nginx_processor_count: 20
- - nginx_connections: 2048
- - ansible_ssh_port: 2222
- - plugins:
- - 'ldap'
- - 'github'
- - 'translation'
- - 'preSCMbuildstep'
- - 'copyartifact'
- - 'ssh-slaves'
- - 'scm-api'
- - 'rebuild'
- - 'publish-over-ssh'
- - 'nested-view'
- - 'jenkins-multijob-plugin'
- - 'ghprb'
- - 'github'
- - 'github-api'
- - 'git'
- - 'git-client'
- - 'envinject'
- - 'credentials'
- - 'copyartifact'
- - 'github-oauth'
-
- - port: 8080
- - prefix: '/build'
- - xmx: 8192
- # Email support
- #- email:
- # smtp_host: 'mail.example.com'
- # smtp_ssl: 'true'
- # default_email_suffix: '@example.com'
--- /dev/null
+---
+
+- hosts: all
+ sudo: true
+ user: ubuntu
+ vars:
+ - jenkins_user: 'jenkins-build'
+ tasks:
+ - name: create a jenkins-build user
+ user: name=jenkins-build comment="Jenkins Build Slave User"
+
+ - name: Create .ssh directory
+ file: path=/home/jenkins-build/.ssh
+ state=directory
+
+ - name: set the authorized keys
+ authorized_key: user=jenkins-build key="{{ lookup('file', 'files/ssh/keys/jenkins_build.pub') }}"
+
+ # FIXME: this doesn't work right now as we aren't pushing private keys
+ # around in public repos
+ - name: ensure private key is present
+ copy: src=files/ssh/keys/jenkins_build dest=/home/{{ jenkins_user }}/.ssh/id_rsa mode=0600
+
+ - name: ensure public key is present
+ copy: src=files/ssh/keys/jenkins_build.pub dest=/home/{{ jenkins_user }}/.ssh/id_rsa.pub mode=0600
+
+ - name: /etc/jenkins_jobs should exist as a dir
+ file:
+ path: /etc/jenkins_jobs
+ state: directory
+
+ - name: jenkins api key should be present
+ copy: src=files/jenkins_jobs.ini dest=/etc/jenkins_jobs/jenkins_jobs.ini
+
+ - name: ensure the build dir exists
+ sudo: yes
+ lineinfile:
+ dest: /etc/sudoers
+ regexp: '^jenkins-build ALL'
+ line: 'jenkins-build ALL=(ALL:ALL) NOPASSWD:ALL'
+ backrefs: yes
+ validate: 'visudo -cf %s'
+
+ - name: ensure the build dir exists
+ file: path=/home/{{ jenkins_user }}/build state=directory owner={{ jenkins_user }}
+
+ - name: copy the gnupg files to build/
+ synchronize: src=files/gnupg.ceph-release dest=/home/{{ jenkins_user }}/build/gnupg.ceph-release
+ ignore_errors: true
+
+ - name: Install RPM requirements
+ sudo: yes
+ yum: name={{ item }} state=present
+ with_items:
+ - createrepo
+ - epel-release
+ - java-1.7.0-openjdk
+ - git
+ #- rpm-sign
+ when: ansible_pkg_mgr == "yum"
+
+ # Run the equivalent of "apt-get update" as a separate step
+ - apt: update_cache=yes
+ when: ansible_pkg_mgr == "apt"
+
+ - name: Install DEB requirements
+ sudo: yes
+ apt: name={{ item }} state=present
+ with_items:
+ - git
+ - fakeroot
+ - fakeroot-ng
+ - debhelper
+ - reprepro
+ - dchroot
+ - devscripts
+ - pbuilder
+ - pkg-config
+ - openjdk-7-jre
+ - python-dev
+ - python-pip
+ - python-virtualenv
+ when: ansible_pkg_mgr == "apt"
+++ /dev/null
----
-
-- hosts: all
- sudo: true
- user: ubuntu
- vars:
- - jenkins_user: 'jenkins-build'
- tasks:
- - name: create a jenkins-build user
- user: name=jenkins-build comment="Jenkins Build Slave User"
-
- - name: Create .ssh directory
- file: path=/home/jenkins-build/.ssh
- state=directory
-
- - name: set the authorized keys
- authorized_key: user=jenkins-build key="{{ lookup('file', 'files/ssh/keys/jenkins_build.pub') }}"
-
- # FIXME: this doesn't work right now as we aren't pushing private keys
- # around in public repos
- - name: ensure private key is present
- copy: src=files/ssh/keys/jenkins_build dest=/home/{{ jenkins_user }}/.ssh/id_rsa mode=0600
-
- - name: ensure public key is present
- copy: src=files/ssh/keys/jenkins_build.pub dest=/home/{{ jenkins_user }}/.ssh/id_rsa.pub mode=0600
-
- - name: /etc/jenkins_jobs should exist as a dir
- file:
- path: /etc/jenkins_jobs
- state: directory
-
- - name: jenkins api key should be present
- copy: src=files/jenkins_jobs.ini dest=/etc/jenkins_jobs/jenkins_jobs.ini
-
- - name: ensure the build dir exists
- sudo: yes
- lineinfile:
- dest: /etc/sudoers
- regexp: '^jenkins-build ALL'
- line: 'jenkins-build ALL=(ALL:ALL) NOPASSWD:ALL'
- backrefs: yes
- validate: 'visudo -cf %s'
-
- - name: ensure the build dir exists
- file: path=/home/{{ jenkins_user }}/build state=directory owner={{ jenkins_user }}
-
- - name: copy the gnupg files to build/
- synchronize: src=files/gnupg.ceph-release dest=/home/{{ jenkins_user }}/build/gnupg.ceph-release
- ignore_errors: true
-
- - name: Install RPM requirements
- sudo: yes
- yum: name={{ item }} state=present
- with_items:
- - createrepo
- - epel-release
- - java-1.7.0-openjdk
- - git
- #- rpm-sign
- when: ansible_pkg_mgr == "yum"
-
- # Run the equivalent of "apt-get update" as a separate step
- - apt: update_cache=yes
- when: ansible_pkg_mgr == "apt"
-
- - name: Install DEB requirements
- sudo: yes
- apt: name={{ item }} state=present
- with_items:
- - git
- - fakeroot
- - fakeroot-ng
- - debhelper
- - reprepro
- - dchroot
- - devscripts
- - pbuilder
- - pkg-config
- - openjdk-7-jre
- - python-dev
- - python-pip
- - python-virtualenv
- when: ansible_pkg_mgr == "apt"