Merge "Fix Honeycomb linting"
[ci-management.git] / jenkins-scripts / basic_settings.sh
1 #!/bin/bash
2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2016 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11
12 case "$(facter operatingsystem)" in
13   Ubuntu)
14     # make sure that the ca-certs are properly updated
15     /usr/sbin/update-ca-certificates
16
17     # attach to the fd.io.dev apt repo
18 #    echo 'deb http://nexus.fd.io/content/repositories/fd.io.dev/ ./' >> /etc/apt/sources.list
19
20     # Configure Ubuntu mirror
21     perl -pi -e 'unless(m{fd\.io}){ s{://[^/]+/}{://ca.archive.ubuntu.com/} }' /etc/apt/sources.list
22     ;;
23   *)
24     # Do nothing on other distros for now
25     ;;
26 esac
27
28 IPADDR=$(facter ipaddress)
29 HOSTNAME=$(facter hostname)
30 FQDN=$(facter fqdn)
31
32 echo "${IPADDR} ${HOSTNAME} ${FQDN}" >> /etc/hosts
33
34 #Increase limits
35 cat <<EOF > /etc/security/limits.d/jenkins.conf
36 jenkins         soft    nofile          16000
37 jenkins         hard    nofile          16000
38 EOF
39
40 cat <<EOJENKINS_SUDO >/etc/sudoers.d/89-jenkins-user-defaults
41 Defaults:jenkins !requiretty
42 jenkins     ALL = NOPASSWD: ALL
43 EOJENKINS_SUDO
44
45 cat <<EOSSH >> /etc/ssh/ssh_config
46 Host *
47   ServerAliveInterval 60
48
49 # we don't want to do SSH host key checking on spin-up systems
50 # Don't use CIDR since SSH won't parse it
51 # 10.30.48.0/23
52 Host 10.30.48.* 10.30.49.*
53   StrictHostKeyChecking no
54   UserKnownHostsFile /dev/null
55 EOSSH
56
57 cat <<EOKNOWN >  /etc/ssh/ssh_known_hosts
58 [gerrit.fd.io]:29418,[162.253.54.31]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC76FxV43JIk/HpI5JUZfizmak9znK/QzsjPoNHt/Eo2Vp68kvJIRZ+PzI7RJR0NsdsXlyqzRsGuH+Cj99ZuLVjNMqz1Y1A5y6itYAgT42KDcnV/JoPx6WV+THdQ+oMSp2dINtvD1kc6Om8iAA2CwYOfIZ/FQS5A9OX2xzFopo4qAN3nRk9kpcHyC698R5SDNZBbk6eqlsBz0827KJrSpOSEEMBhtroBM4JV8vImcSWeJuQ5QFdZgQdQaI8R5YFBRbWu3mDSgJfjJk89xT2CkUiqIynNJeiQMM4IZxcdQB3zJ1RUEJepxv77yV09NZ8jwhaN6X659UJZjsCZ5ffvc77
59 EOKNOWN
60
61 # vim: sw=2 ts=2 sts=2 et :