forked from infra/ansible
87 lines
2.3 KiB
YAML
87 lines
2.3 KiB
YAML
# restricted to run on cloud instances only
|
|
- hosts: 209.132.184.*
|
|
user: root
|
|
vars_files:
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
- ${private}/vars.yml
|
|
- ${vars}/${ansible_distribution}.yml
|
|
vars:
|
|
- hostbase: jenkins-${dist_tag}-
|
|
|
|
tasks:
|
|
- include: $tasks/cloud_setup_basic.yml
|
|
- name: install pkgs for jenkins
|
|
action: yum state=installed pkg=$item
|
|
with_items:
|
|
- vim
|
|
- java-1.7.0-openjdk
|
|
- subversion
|
|
- bzr
|
|
- git
|
|
- rpmlint
|
|
- rpmdevtools
|
|
- mercurial
|
|
- mock
|
|
- python-bugzilla
|
|
- python-straight-plugin
|
|
- python-pip
|
|
- python-virtualenv
|
|
- python-coverage
|
|
- pylint
|
|
- python-argparse
|
|
- python-nose
|
|
- python-BeautifulSoup
|
|
- python-fedora
|
|
- python-unittest2
|
|
- python-pep8
|
|
tags:
|
|
- packages
|
|
|
|
- name: install pkgs for jenkins for fedora systems
|
|
action: yum state=installed pkg=$item
|
|
only_if: '$is_fedora'
|
|
with_items:
|
|
- python3
|
|
- python-nose-cover3
|
|
- python3-nose-cover3
|
|
tags:
|
|
- packages
|
|
|
|
- name: set the hostname to jenkins-osversion
|
|
action: command hostname jenkins-${dist_tag}
|
|
tags:
|
|
- config
|
|
|
|
- name: setup jenkins_slave user
|
|
action: user name=jenkins_slave state=present createhome=yes system=no password=${jenkins_slave_pw}
|
|
tags:
|
|
- jenkinsuser
|
|
- name: jenkins_slave to mock group
|
|
action: user name=jenkins_slave groups=mock
|
|
|
|
- name: add .gitconfig for jenkins_slave user
|
|
action: template src=$files/jenkins/gitconfig dest=/home/jenkins_slave/.gitconfig owner=jenkins_slave group=jenkins_slave mode=664
|
|
tags:
|
|
- config
|
|
|
|
- name: template sshd_config
|
|
action: template src=$item dest=/etc/ssh/sshd_config mode=0600 owner=root group=root
|
|
first_available_file:
|
|
- $files/jenkins/sshd_config_slave.$ansible_distribution
|
|
- $files/jenkins/sshd_config_slave
|
|
notify:
|
|
- restart sshd
|
|
tags:
|
|
- config
|
|
|
|
- name: mkdir dir for jenkins data
|
|
action: file state=directory path=/mnt/jenkins owner=jenkins_slave group=jenkins_slave
|
|
|
|
- name: add jenkins-admin-keys for ssh'ing as root
|
|
action: copy src=$files/jenkins/jenkins-admin-keys dest=/root/.ssh/authorized_keys mode=600 backup=true
|
|
tags:
|
|
- config
|
|
|
|
|
|
handlers:
|
|
- include: $handlers/restart_services.yml
|