Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible: new centos6 machines, updated & fixed centos6 config #1076

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ hosts:

- softlayer:
centos5-x86-1: {ip: 50.23.85.253}
centos6-x64-1: {ip: 50.97.245.10}
centos6-x64-1: {ip: 169.62.77.228}

- linuxonecc:
rhel72-s390x-1: {ip: 148.100.110.65}
Expand Down Expand Up @@ -215,8 +215,8 @@ hosts:
- softlayer:
centos5-x64-1: {ip: 50.23.85.252}
centos5-x64-2: {ip: 173.193.25.109}
centos6-x64-1: {ip: 50.23.85.251}
centos6-x64-2: {ip: 184.173.120.137}
centos6-x64-1: {ip: 169.61.75.51}
centos6-x64-2: {ip: 169.61.75.58}
centos7-x64-1: {ip: 50.23.85.250}
debian8-x86-1: {ip: 169.44.16.126}
ubuntu1404-x64-1: {ip: 50.97.245.5}
Expand Down
25 changes: 12 additions & 13 deletions ansible/roles/baselayout/tasks/partials/repo/centos6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
# centos6 - almost getting there
#

- name: "repo : add scl devtoolset"
yum_repository:
baseurl: http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo
gpgkey: http://ftp.scientificlinux.org/linux/scientific/5x/{{ ansible_architecture }}/RPM-GPG-KEYs/RPM-GPG-KEY-cern
gpgcheck: yes
- name: "repo : add devtoolset-2"
get_url:
url: http://people.centos.org/tru/devtools-2/devtools-2.repo
dest: /etc/yum.repos.d/devtoolset-2.repo
mode: 0440

- name: "repo : add scl"
yum_repository:
baseurl: http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo
gpgkey: http://ftp.scientificlinux.org/linux/scientific/5x/{{ ansible_architecture }}/RPM-GPG-KEYs/RPM-GPG-KEY-cern
gpgcheck: yes

- name: install epel
- name: "repo : add epel"
yum:
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm"
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
state: present

- name: "repo : add epel key"
rpm_key:
key: /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}
state: present
4 changes: 4 additions & 0 deletions ansible/roles/baselayout/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ packages: {
'git',
],

centos6: [
'devtoolset-2-toolchain',
],

centos7: [
'gcc-c++',
],
Expand Down
21 changes: 21 additions & 0 deletions ansible/roles/bootstrap/tasks/partials/centos6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---

#
# a centos6 bootstrap - copied from fedora
#

- name: check for python
raw: stat /usr/bin/python
register: has_python
failed_when: has_python.rc > 1

- name: check for libselinux-python bindings
raw: yum info libselinux-python | grep Installed
register: has_libselinux
failed_when: has_libselinux.rc > 1

- name: install libselinux-python bindings
raw: yum install -y libselinux-python

- name: disable selinux
selinux: state=disabled
2 changes: 1 addition & 1 deletion ansible/roles/jenkins-worker/tasks/monit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
copy:
args:
src: "{{ monitrc }}"
dest: "/etc/monitrc"
dest: "/etc/monit.d/jenkins"
mode: 0440
loop_control:
loop_var: monitrc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
- python-argparse

- name: install tap2junit
raw: easy_install tap2junit
raw: easy_install --index-url https://pypi.python.org/pypi tap2junit

9 changes: 5 additions & 4 deletions ansible/roles/jenkins-worker/templates/centos.initd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ PIDFILE=/var/run/jenkins/$NAME.pid
JENKINS_SLAVE_USER="iojs"
JENKINS_SLAVE_JAR="/home/{{ server_user }}/slave.jar"
JENKINS_SLAVE_LOG="/home/{{ server_user }}/$NAME.log"
JENKINS_SLAVE_ARGS="-Xmx{{ server_ram|default('128m') }} -jnlpUrl {{ jenkins_url }}/computer/{{ inventory_hostname }}/slave-agent.jnlp -secret {{ secret }}"
JENKINS_JAVA_ARGS="-Xmx{{ server_ram|default('128m') }}"
JENKINS_SLAVE_ARGS="-jnlpUrl {{ jenkins_url }}/computer/{{ inventory_hostname }}/slave-agent.jnlp -secret {{ secret }}"
JENKINS_ENV="JOBS={{ ansible_processor_vcpus }} \
HOME=/home/{{ server_user }} \
DESTCPU={{ ansible_architecture }} \
ARCH={{ ansible_architecture }} \
DESTCPU={{ server_arch | default(ansible_architecture) }} \
ARCH={{ server_arch | default(ansible_architecture) }} \

This comment was marked as off-topic.

This comment was marked as off-topic.

JOBS={{ server_jobs | default(ansible_processor_vcpus) }} \
OSTYPE=linux-gnu \
NODE_TEST_DIR=$HOME/tmp \
Expand All @@ -43,7 +44,7 @@ slave_start() {
mkdir `dirname $PIDFILE` > /dev/null 2>&1 || true
chown $JENKINS_SLAVE_USER `dirname $PIDFILE`

runuser -m -l $JENKINS_SLAVE_USER -c "$JENKINS_ENV PATH=$JENKINS_PATH $JAVA -jar $JENKINS_SLAVE_JAR $JENKINS_SLAVE_ARGS > $JENKINS_SLAVE_LOG 2>&1 &"
runuser -m -l $JENKINS_SLAVE_USER -c "$JENKINS_ENV PATH=$JENKINS_PATH $JAVA $JENKINS_JAVA_ARGS -jar $JENKINS_SLAVE_JAR $JENKINS_SLAVE_ARGS > $JENKINS_SLAVE_LOG 2>&1 &"
pgrep -f -u $JENKINS_SLAVE_USER $JENKINS_SECRET > $PIDFILE
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCK_FILE
Expand Down