Skip to content
Snippets Groups Projects
Commit 0af4875d authored by Chris Hines's avatar Chris Hines
Browse files

Merge branch 'master' into 'master'

Master

See merge request !1
parents 4132c697 c5b15665
No related branches found
No related tags found
No related merge requests found
Showing
with 303 additions and 10 deletions
......@@ -3,6 +3,6 @@
include: installOpenVPN.yml
- name: "Start OpenVPN"
service: name=openvpn state=started
service: name=openvpn state=started enabled=yes
sudo: true
......@@ -3,5 +3,5 @@
include: installOpenVPN.yml
- name: "Start OpenVPN"
service: name=openvpn state=started
service: name=openvpn state=started enabled=yes
sudo: true
......@@ -29,6 +29,6 @@
-
name: "Starting Apache2"
service: name=apache2 state=started
service: name=apache2 state=started enabled=yes
sudo: true
......@@ -40,5 +40,5 @@
notify: restart sssd
- name: "start sssd"
service: name=sssd state=started
service: name=sssd state=started enabled=yes
sudo: true
---
- include_vars: "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yaml"
- name: copy rpms/debs
copy: dest=/tmp/ src=lustre-install/{{ item }}
with_items:
"{{ lustre_pkgs }}"
#- name: install rpms
# yum: name="/tmp/{{ item }}"
# sudo: true
# with_items: "{{ lustre_pkgs }}"
- name: install rpms
yum: name=/tmp/lustre-client-modules-2.7.0-3.10.0_229.14.1.el7.x86_64.x86_64.rpm
sudo: true
when: ansible_os_family == "RedHat"
- name: install rpms
yum: name=/tmp/lustre-client-2.7.0-3.10.0_229.14.1.el7.x86_64.x86_64.rpm
sudo: true
when: ansible_os_family == "RedHat"
# instructions to build these debs:
# Instantiate an Ubuntu 14.04 instance
# git clone git://git.hpdd.intel.com/fs/lustre-release.git
# cd lustre-release
# optionally git checkout 0754bc8f2623bea184111af216f7567608db35b6 <- I know this commit works on Ubuntu, but I had a lot of trouble with other branches
# sh autogen.sh
# ./configure --enable-dist --disable-doc --disable-server --disable-dependency-tracking --with-o2ib=/var/lib/dkms/mlnx-ofed-kernel/3.1/build/
# mkdir BUILD
# cd BUILD
# ln -s ../lustre-2.7.62.tar.gz lustre-2.7.62.orig.tar.gz
# tar zxvf ../lustre-2.7.62.tar.gz
# cd lustre-2.7.62
# ./configure --disable-doc --disable-server --disable-dependency-tracking --with-o2ib=/var/lib/dkms/mlnx-ofed-kernel/3.1/build/
# vi debian/changelog (the version number on the first line is incorrect)
# make debs
#
- name: install debs
apt: name="/tmp/{{ item }}"
sudo: true
with_items: "{{ lustre_pkgs }}"
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "14"
- name: "Mount lustre filesystems"
mount: name="{{ item.mntpt }}" src="{{ item.servers }}"/"{{ item.src }}" state="mounted" fstype="lustre" opts="_netdev,flock"
sudo: true
with_items: "{{ mntlist }}"
---
lustre_pkgs:
- lustre-client-modules-2.7.0-3.10.0_229.14.1.el7.x86_64.x86_64.rpm
- lustre-client-2.7.0-3.10.0_229.14.1.el7.x86_64.x86_64.rpm
---
lustre_pkgs:
- linux-patch-lustre_2.7.62-1_all.deb
- lustre-client-modules-3.13.0-58-generic_2.7.62-1_amd64.deb
- lustre-utils_2.7.62-1_amd64.deb
#!/bin/sh
# A CRUDE Script to install Mellanox OFED drivers
# Philip.Chan@monash.edu
#
# TODO: check if MLNX_OFED is already installed!
# TODO: check kernel...
KERN=`uname -r`
if [ "$KERN" != "3.10.0-229.14.1.el7.x86_64" ]
then
echo "Oops! Did you forget to reboot?"
echo "Kernel version has to be 3.10.0-229.14.1.el7.x86_64"
exit 1
fi
sudo yum install -y pciutils gcc-gfortran libxml2-python tcsh libnl lsof tcl tk perl
sudo yum install -y gtk2 atk cairo
tar xzvf MLNX_OFED_LINUX-3.1-1.0.3-rhel7.1-x86_64-ext.tgz
cd MLNX_OFED_LINUX-3.1-1.0.3-rhel7.1-x86_64-ext
sudo ./mlnxofedinstall -q
cd ..
tmpfile="/tmp/ifcfg.pc"
rm -f $tmpfile
./set_ifcfg.pl $tmpfile
if [ -f $tmpfile ]
then
echo "Attempting to install ifcfg-ens6"
if [ -f /etc/sysconfig/network-scripts/ifcfg-ens6 ]
then
echo "/etc/sysconfig/network-scripts/ifcfg-ens6 already exists!"
grep IP /etc/sysconfig/network-scripts/ifcfg-ens6
echo "bailing!"
else
sudo cp -ip $tmpfile /etc/sysconfig/network-scripts/ifcfg-ens6
sudo chown root:root /etc/sysconfig/network-scripts/ifcfg-ens6
cd /etc/sysconfig/network-scripts
sudo ./ifup ens6
ping -c 1 172.16.228.1
fi
fi
exit 0
#!/usr/bin/perl
#
# Assumes Mellanox NIC is named as ens6
# Philip.Chan@monash.edu
#
# Usage:
# ./set_ifcfg.pl [<tmpfilename>]
# To be used within the mlnx_install.sh
#
my $outfile = shift @ARGV;
$outfile = "tmp.ifcfg" if (! defined $outfile);
sub get_index
{
my $hn = shift;
my $maxhosts = 32;
if ($hn =~ /hc(\d+)/) {
return 33 + $1 if ($1 < $maxhosts);
}
if ($hn =~ /hs(\d+)/) {
return 1 + $1 if ($1 < $maxhosts);
}
return 0;
}
my $hostname = `/bin/hostname`;
my $x = get_index($hostname);
die "Unable to parse hostname $hostname" if ($x eq '0');
my $ip = "172.16.229.$x";
print "Assigning $ip to $hostname\n";
open OUT, ">$outfile" or die "Failed to create output file $outfile!";
print OUT "DEVICE=ens6\n";
print OUT "ONBOOT=yes\n";
print OUT "NM_CONTROLLED=no\n";
print OUT "BOOTPROTO=none\n";
print OUT "IPADDR=$ip\n";
print OUT "PREFIX=22\n";
print OUT "MTU=9000\n";
close OUT;
exit 0;
---
- include_vars: mellanoxVars.yml
- name: yum install dependencies
yum: name=perl,pciutils,gtk2,atk,cairo,gcc-gfortran,libxml2-python,tcsh,libnl,lsof,tcl,tk
sudo: true
ignore_errors: true
when: ansible_os_family == "RedHat"
- name: yum update to upgrade kernel
shell: "yum update -y"
sudo: true
ignore_errors: true
when: ansible_os_family == "RedHat"
#
# A REBOOT IS NEEDED AFTER a KERNEL UPDATE
#
- name: restart machine
shell: sleep 5; sudo shutdown -r now "Ansible updates triggered"
async: 2
poll: 0
ignore_errors: true
sudo: true
when: ansible_os_family == "RedHat"
- name: waiting for server to come back
#local_action: wait_for host={{ ansible_host }} state=started port=22 delay=10 search_regex=OpenSSH
local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo: false
- name: waiting for server to come back number 2
local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo: false
- name: test for existing installation of drivers
command: ibv_devinfo
sudo: true
register: drivers_installed
ignore_errors: true
- name: copy driver source
#make this a variable
unarchive: copy=yes src="files/{{ MELLANOX_DRIVER_SRC }}.tgz" dest=/tmp
sudo: true
#when: drivers_installed|failed and ansible_os_family=="RedHat" and ansible_distribution_major_version == "7"
when: drivers_installed|failed
- name: install drivers
shell: ./mlnxofedinstall -q
args:
#more changes
chdir: "/tmp/{{ MELLANOX_DRIVER_SRC }}"
sudo: true
when: drivers_installed|failed
#
# get IP address before reboot
#
- name: get IP address
local_action: command ./scripts/map_ib_ip.pl {{ inventory_hostname }}
register: ip_address
sudo: false
- name: template IP address
template: dest=/etc/sysconfig/network-scripts/ifcfg-ens6 src=ifcfg-ens6.j2 owner=root group=root
sudo: true
when: ansible_os_family=="RedHat" and ansible_distribution_major_version == "7"
#ubuntu equivalent of previous command
- name: Ubuntu network interfaces - line 1
lineinfile:
args:
dest: /etc/network/interfaces
line: auto {{ MELLANOX_DEVICE_NAME }}
state: present
sudo: true
when: ansible_os_family=="Debian"
- name: Ubuntu network interfaces - line 2
lineinfile:
args:
dest: /etc/network/interfaces
line: iface {{ MELLANOX_DEVICE_NAME }} inet static
state: present
insertafter: "auto {{ MELLANOX_DEVICE_NAME }}"
sudo: true
when: ansible_os_family=="Debian"
- name: Ubuntu network interfaces - line 3
lineinfile:
args:
dest: /etc/network/interfaces
line: address {{ ip_address.stdout }}
state: present
insertafter: "iface {{ MELLANOX_DEVICE_NAME }} inet static"
sudo: true
when: ansible_os_family=="Debian"
#
# A REBOOT IS NEEDED AFTER SUCCESSFUL INSTALL
#
- name: restart machine
command: "sleep 5; sudo shutdown -r now"
async: 2
poll: 0
ignore_errors: true
sudo: true
when: ansible_os_family=="Centos"
- name: restart machine for Ubuntu -cos it is 'special'
command: "sudo shutdown -r now"
async: 2
poll: 0
ignore_errors: true
sudo: true
when: ansible_os_family=="Debian"
- name: waiting for server to come back
local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo: false
- name: waiting for server to come back 2
local_action: wait_for host={{ ansible_ssh_host }} state=started port=22 delay=10 search_regex=OpenSSH
- name: bring up interface
#variable=eth0 or ens6
command: ifup {{ MELLANOX_DEVICE_NAME }}
sudo: true
when: ansible_distribution_major_version == "7"
DEVICE=ens6
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR={{ ip_address.stdout }}
PREFIX=22
MTU=9000
---
#note. do not add '.tgz' to driver src. done in playbook
MELLANOX_DRIVER_SRC: "{% if ansible_os_family == 'RedHat' %}MLNX_OFED_LINUX-3.1-1.0.3-rhel7.1-x86_64-ext{% elif ansible_os_family == 'Debian' %}MLNX_OFED_LINUX-3.1-1.0.3-ubuntu14.04-x86_64{% endif %}"
MELLANOX_DEVICE_NAME: "{% if ansible_os_family == 'RedHat' %}ens6{% elif ansible_os_family == 'Debian' %}eth1{% endif %}"
---
-
name: "Run rpcbind service"
service: "name=rpcbind state=started"
service: "name=rpcbind state=started enabled=yes"
......@@ -5,16 +5,16 @@
with_items: exportList
- name: "Starting rpcbind"
service: "name=rpcbind state=started"
service: "name=rpcbind state=started enabled=true"
sudo: true
when: ansible_os_family == "RedHat"
- name: "Start the Server"
service: "name=nfs state=started"
service: "name=nfs state=started enabled=true"
sudo: true
when: ansible_os_family == "RedHat"
- name: "Start the Server"
service: "name=nfs-kernel-server state=started"
service: "name=nfs-kernel-server state=started enabled=true"
sudo: true
when: ansible_os_family == "Debian"
......@@ -140,4 +140,4 @@
-
name: "Starting shibboleth"
sudo: true
service: name=shibd state=started
service: name=shibd state=started enabled=yes
......@@ -36,7 +36,7 @@
when: use_systemd is defined
- name: start munge
service: name=munge state=started
service: name=munge state=started enabled=yes
sudo: true
- name: start slurmdbd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment