diff --git a/roles/OpenVPN-Client/tasks/main.yml b/roles/OpenVPN-Client/tasks/main.yml index 640caecb77a0a6dd6b63c0347e2ebef484ff182f..44aab742b4a4ea1f6a4cdf736ae7c367897c197a 100644 --- a/roles/OpenVPN-Client/tasks/main.yml +++ b/roles/OpenVPN-Client/tasks/main.yml @@ -3,6 +3,6 @@ include: installOpenVPN.yml - name: "Start OpenVPN" - service: name=openvpn state=started + service: name=openvpn state=started enabled=yes sudo: true diff --git a/roles/OpenVPN-Server/tasks/main.yml b/roles/OpenVPN-Server/tasks/main.yml index 387f2bca8837485a71491c9becc9e4fc0362e416..b69a74c0cc65f0ad56cf046337355662ea7b3b03 100644 --- a/roles/OpenVPN-Server/tasks/main.yml +++ b/roles/OpenVPN-Server/tasks/main.yml @@ -3,5 +3,5 @@ include: installOpenVPN.yml - name: "Start OpenVPN" - service: name=openvpn state=started + service: name=openvpn state=started enabled=yes sudo: true diff --git a/roles/apache2/tasks/apacheDebian.yml b/roles/apache2/tasks/apacheDebian.yml index 44ffcdc4a675736cfdf50a9d0be0c1d5016cc565..acfada376e9d2e3a857be634bc417cf60fb4930e 100644 --- a/roles/apache2/tasks/apacheDebian.yml +++ b/roles/apache2/tasks/apacheDebian.yml @@ -29,6 +29,6 @@ - name: "Starting Apache2" - service: name=apache2 state=started + service: name=apache2 state=started enabled=yes sudo: true diff --git a/roles/calculateSlurmConf/templates/slurm.conf.j2 b/roles/calculateSlurmConf/templates/slurm.conf.j2 index 59c199f54a57593d850c995fe1b5cf40d51e9b74..889cc5ea5aca979afb2195406c0e3f24f7d8538b 100644 --- a/roles/calculateSlurmConf/templates/slurm.conf.j2 +++ b/roles/calculateSlurmConf/templates/slurm.conf.j2 @@ -30,7 +30,7 @@ SwitchType=switch/none MpiDefault=pmi2 SlurmctldPidFile={{ slurmpiddir }}/slurmctld.pid SlurmdPidFile={{ slurmpiddir }}/slurmd.pid -ProctrackType=proctrack/linuxproc +ProctrackType=proctrack/cgroup #PluginDir= CacheGroups=0 #FirstJobId= diff --git a/roles/ldapclient/tasks/configLdapClient.yml b/roles/ldapclient/tasks/configLdapClient.yml index 4120f7ce57eaa199fb210ecb8f391abfb1d4f170..3e22db75422d4647405933e4379b34548da6aa24 100644 --- a/roles/ldapclient/tasks/configLdapClient.yml +++ b/roles/ldapclient/tasks/configLdapClient.yml @@ -40,5 +40,5 @@ notify: restart sssd - name: "start sssd" - service: name=sssd state=started + service: name=sssd state=started enabled=yes sudo: true diff --git a/roles/lustre-client/tasks/main.yml b/roles/lustre-client/tasks/main.yml index 0b2e2be241a767155c0c515dd2324b9391c9ec64..41d03b0e4df28534dee4f9401ac3b737a560e221 100644 --- a/roles/lustre-client/tasks/main.yml +++ b/roles/lustre-client/tasks/main.yml @@ -1,11 +1,12 @@ --- - include_vars: "{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yaml" -- name: copy rpms +- name: copy rpms/debs copy: dest=/tmp/ src=lustre-install/{{ item }} with_items: "{{ lustre_pkgs }}" + #- name: install rpms # yum: name="/tmp/{{ item }}" # sudo: true @@ -14,13 +15,38 @@ - 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 }}" + + diff --git a/roles/lustre-client/vars/Ubuntu_14.yaml b/roles/lustre-client/vars/Ubuntu_14.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8e3870d0105543ff13ed9ade7813a438a3852943 --- /dev/null +++ b/roles/lustre-client/vars/Ubuntu_14.yaml @@ -0,0 +1,5 @@ +--- +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 diff --git a/roles/mellanox_drivers/tasks/main.yml b/roles/mellanox_drivers/tasks/main.yml index 72cdbce129e9de3eb95397791ba96ca4422a8b01..462b7320c432d0967141833497b88696ec3d31ce 100644 --- a/roles/mellanox_drivers/tasks/main.yml +++ b/roles/mellanox_drivers/tasks/main.yml @@ -1,14 +1,18 @@ --- +- 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 - when: ansible_os_family=="RedHat" and ansible_distribution_major_version == "7" + ignore_errors: true + when: ansible_os_family == "RedHat" # # A REBOOT IS NEEDED AFTER a KERNEL UPDATE @@ -19,6 +23,7 @@ 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 @@ -36,26 +41,78 @@ ignore_errors: true - name: copy driver source - unarchive: copy=yes src=files/MLNX_OFED_LINUX-3.1-1.0.3-rhel7.1-x86_64-ext.tgz dest=/tmp + #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 and ansible_os_family=="RedHat" and ansible_distribution_major_version == "7" + when: drivers_installed|failed - name: install drivers shell: ./mlnxofedinstall -q args: - chdir: /tmp/MLNX_OFED_LINUX-3.1-1.0.3-rhel7.1-x86_64-ext + #more changes + chdir: "/tmp/{{ MELLANOX_DRIVER_SRC }}" sudo: true - when: drivers_installed|failed and ansible_distribution_major_version == "7" + 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 "Ansible updates triggered" + 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 @@ -63,23 +120,11 @@ - 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 - sudo: false -- name: get IP address - local_action: command ./scripts/map_ib_ip.pl {{ inventory_hostname }} - register: ip_address - -- name: template IP address - template: dest=/etc/sysconfig/network-scripts/ifcfg-ens6 src=ifcfg-ens6.j2 owner=root group=root - sudo: true - when: ansible_distribution_major_version == "7" - - name: bring up interface - command: ifup ens6 + #variable=eth0 or ens6 + command: ifup {{ MELLANOX_DEVICE_NAME }} sudo: true when: ansible_distribution_major_version == "7" - - - diff --git a/roles/mellanox_drivers/vars/mellanoxVars.yml b/roles/mellanox_drivers/vars/mellanoxVars.yml new file mode 100644 index 0000000000000000000000000000000000000000..e2277dd40ad203653226ea0a356c0806689d7822 --- /dev/null +++ b/roles/mellanox_drivers/vars/mellanoxVars.yml @@ -0,0 +1,4 @@ +--- + #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 %}" diff --git a/roles/nfs-common/handlers/main.yml b/roles/nfs-common/handlers/main.yml index 7b77dc761daa5d64900882953560e05d713c3c2e..f5c928114ee92484c0bb856b936476fbddfb5324 100644 --- a/roles/nfs-common/handlers/main.yml +++ b/roles/nfs-common/handlers/main.yml @@ -1,4 +1,4 @@ --- - name: "Run rpcbind service" - service: "name=rpcbind state=started" + service: "name=rpcbind state=started enabled=yes" diff --git a/roles/nfs-server/tasks/startServer.yml b/roles/nfs-server/tasks/startServer.yml index f326a572afecfca5d806f4950a2b0e973ad89c83..60d84ab3ca51ff23e5a93e1e648c0e04dda17b38 100644 --- a/roles/nfs-server/tasks/startServer.yml +++ b/roles/nfs-server/tasks/startServer.yml @@ -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" diff --git a/roles/shibboleth-sp/tasks/shibbolethConfig.yml b/roles/shibboleth-sp/tasks/shibbolethConfig.yml index 3ccd12c1d401bb7346ff52902f63375ea5eab3a9..d94f5dc70053db42194783b1145e67f5b508b141 100644 --- a/roles/shibboleth-sp/tasks/shibbolethConfig.yml +++ b/roles/shibboleth-sp/tasks/shibbolethConfig.yml @@ -140,4 +140,4 @@ - name: "Starting shibboleth" sudo: true - service: name=shibd state=started + service: name=shibd state=started enabled=yes diff --git a/roles/slurm-start/tasks/main.yml b/roles/slurm-start/tasks/main.yml index 3f7ba6f297828cc493784d9f632c20e5923f7966..a857be9a01b37ba0b4d56ccd8079ca731abe71f5 100644 --- a/roles/slurm-start/tasks/main.yml +++ b/roles/slurm-start/tasks/main.yml @@ -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