CSIT: Set the cadence of selected daily jobs to normal
[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,[52.10.107.188]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjr1oez076EFMo5n25lAJ2zhftLAHIkTmwTdjwR82xA8sqQbN0FMz4znZyO7o2jlewlw/OqnVAwEIvEto6tqoj1zu8bHS1Vwq4toKkk3SLzRdn8NeTL3K92IkEHhBfB7MGtDFnbKxGmC/MmcP7sUb3MUY9EyInP1ZBVDT8S1wZ0lfcQoMVraM5G3ShmoR9FNszv1EQzbg/b9EAKuZZLXoyd6NZ2OHjBOrQzbBW9/MtYQHq60m2znOq49/gpTano5EeIHgUFfrf30qZCvL3qcFZspkofpYHB7YsRz/87YAhZorQo7E5uyNKu4CMWkj3Y8JxUAdYYbuAZqFbVE7eTGl5
59 EOKNOWN
60
61 # vim: sw=2 ts=2 sts=2 et :