From: Alfredo Deza Date: Fri, 17 Jul 2015 21:21:55 +0000 (-0400) Subject: move the playbook files to the top dir X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5286640e1cd8276c597ade29f634a5446e708d24;p=ceph-build.git move the playbook files to the top dir Signed-off-by: Alfredo Deza --- diff --git a/ansible/master.yml b/ansible/master.yml new file mode 100644 index 00000000..5b93e75a --- /dev/null +++ b/ansible/master.yml @@ -0,0 +1,41 @@ +--- + +- 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' diff --git a/ansible/master/master.yml b/ansible/master/master.yml deleted file mode 100644 index 5b93e75a..00000000 --- a/ansible/master/master.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- - -- 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' diff --git a/ansible/slave.yml b/ansible/slave.yml new file mode 100644 index 00000000..773edb79 --- /dev/null +++ b/ansible/slave.yml @@ -0,0 +1,83 @@ +--- + +- 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" diff --git a/ansible/slaves/slave.yml b/ansible/slaves/slave.yml deleted file mode 100644 index 773edb79..00000000 --- a/ansible/slaves/slave.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- - -- 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"