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

Merge branch 'os_family_debian' into merge_osdebian

parents 4af645ba 4af92490
No related branches found
No related tags found
No related merge requests found
Showing
with 636 additions and 46 deletions
- name: make /local_home
file: path=/local_home owner=root group=root state=directory
sudo: true
- name: copy the {{ ansible_ssh_user }} home
shell: cp -ar /home/{{ ansible_ssh_user }} /local_home
ignore_errors: true
sudo: true
register: home_copied
- name: edit passwd file
lineinfile:
args:
dest: /etc/passwd
regexp: "{{ ansible_ssh_user }}:x:1001:1001::/home/{{ ansible_ssh_user }}:.*"
line: "{{ ansible_ssh_user }}:x:1001:1001::/local_home/{{ ansible_ssh_user }}:/bin/bash"
backrefs: yes
sudo: true
register: edit1
- name: edit passwd file
lineinfile:
args:
dest: /etc/passwd
regexp: "{{ ansible_ssh_user }}:x:500:500::/home/{{ ansible_ssh_user }}:.*"
line: "{{ ansible_ssh_user }}:x:500:500::/local_home/{{ ansible_ssh_user }}:/bin/bash"
backrefs: yes
sudo: true
register: edit2
---
- name: restart rpcbind
service: name=rpcbind state=restarted
sudo: true
- name: restart idmap
service: name={{ item }} state=restarted
with_items:
- rpcbind
- rpcidmapd
service: name=rpcidmapd state=restarted
sudo: true
when: ansible_os_family == "RedHat"
......@@ -3,17 +3,12 @@
service: name=fail2ban state=stopped
sudo: true
- name: restart idmap
service: name={{ item }} state=restarted
with_items:
- rpcbind
- rpcidmapd
sudo: true
- name: "Mounting NFS mounts"
mount: name={{ item.name }} src={{ item.ipv4 }}:{{ item.src }} fstype={{ item.fstype }} opts={{ item.opts }} state=mounted
with_items: exportList
notify: "restart authentication"
notify: "restart rpcbind"
notify: "restart idmap"
sudo: true
ignore_errors: true
......@@ -30,6 +25,7 @@
with_items: exportList
notify: "restart authentication"
notify: "restart idmap"
notify: "restart rpcbind"
sudo: true
when: exportList is defined and firstMount | failed
......
---
- include: yumPackages.yml
when: ansible_os_family == "RedHat"
- include: aptPackages.yml
when: ansible_os_family == "Debian"
- name: setup idmap.conf
template: src=idmapd.conf.j2 dest=/etc/idmapd.conf
......
---
- name: install nfs kernel server
apt: name=nfs-kernel-server state=latest
sudo: true
when: ansible_os_family == "Debian"
- include: mkFilesystem.yml
- include: startServer.yml
......@@ -13,6 +13,18 @@
- bzip2-devel
- mysql
- mysql-devel
when: ansible_os_family == "RedHat"
- name: install deps
apt: name={{ item }} state=installed update_cache=yes
sudo: true
with_items:
- gcc
- wget
- libssl-dev
- libpam0g-dev
- libbz2-dev
when: ansible_os_family == "Debian"
- name: get munge
shell: wget https://munge.googlecode.com/files/munge-{{ munge_version }}.tar.bz2
......@@ -26,9 +38,25 @@
args:
chdir: /tmp
creates: /root/rpmbuild/RPMS/x86_64/munge-{{ munge_version }}-1.el6.x86_64.rpm
when: ansible_os_family == "RedHat"
- name: untar munge
shell: tar jxf /tmp/munge-{{ munge_version }}.tar.bz2
sudo: true
args:
chdir: /tmp
creates: /tmp/munge-{{ munge_version }}
when: ansible_os_family == "Debian"
- name: build munge
shell: configure && make && make install
sudo: true
args:
chdir: /tmp/munge-{{ munge_version }}
when: ansible_os_family == "Debian"
- name: get slurm
shell: wget http://www.schedmd.com/download/archive/slurm-{{ slurm_version }}.tar.bz2
shell: wget http://www.schedmd.com/download/latest/slurm-{{ slurm_version }}.tar.bz2
args:
chdir: /tmp
creates: /tmp/slurm-{{ slurm_version }}.tar.bz2
......@@ -36,6 +64,7 @@
- name: check munge installation
shell: rpm -qa munge
register: munge_installed
when: ansible_os_family == "RedHat"
- name: install munge deps
shell: rpm -i /root/rpmbuild/RPMS/x86_64/munge-libs-{{ munge_version }}-1.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/munge-{{ munge_version }}-1.el6.x86_64.rpm /root/rpmbuild/RPMS/x86_64/munge-devel-{{ munge_version }}-1.el6.x86_64.rpm
......
......@@ -11,3 +11,8 @@
service: name=slurmdbd state=restarted
sudo: true
- name: scontrol reconfigure
shell: sleep 10 ; scontrol reconfigure
sudo: true
delegate_to: "{{ slurmctrl }}"
run_once: true
---
- name: create slurm group
group: name=slurm system=yes gid=497
sudo: true
- name: create slurm user
user: name=slurm group=slurm system=yes createhome=no uid=497
sudo: true
- name: make sure slurm conf dir exists
file: dest=/etc/slurm state=directory
sudo: true
- name: create data directory
file: path="{{ slurmdatadir }}" state=directory owner=slurm group=slurm mode=755
sudo: true
- name: create log directory
shell: mkdir -p {{ slurmddebug.log | dirname }}; chown slurm:slurm {{ slurmddebug.log | dirname }}
args:
creates: "{{ slurmddebug.log | dirname }}"
sudo: true
when: slurmddebug is defined and slurmddebug.log
- name: copy rpms
copy: src=/tmp/rpmbuild dest=/tmp
sudo: true
......@@ -7,6 +31,28 @@
shell: "rpm --install /tmp/rpmbuild/RPMS/x86_64/munge*{{ munge_version }}*rpm"
sudo: true
ignore_errors: true
when: ansible_os_family == "RedHat"
- name: install deps
apt: name={{ item }} state=installed update_cache=yes
sudo: true
with_items:
- gcc
- wget
- libssl-dev
- libpam0g-dev
- libbz2-dev
- make
- alien
when: ansible_os_family == "Debian"
- include: installMungeFromSource.yml
when: ansible_os_family == "Debian"
- name: install munge key
template: src=munge_key.j2 dest=/etc/munge/munge.key owner=munge mode=600
sudo: true
notify: restart munge
- name: install perl
yum: name={{ item }} state=latest
......@@ -14,51 +60,40 @@
- perl
- perl-DBI
sudo: true
when: ansible_os_family == "RedHat"
- name: create slurm group
group: name=slurm system=yes
- name: install perl
apt: name={{ item }} state=latest
with_items:
- perl
- libdbi-perl
sudo: true
when: ansible_os_family == "Debian"
- name: create slurm user
user: name=slurm group=slurm system=yes createhome=no
sudo: true
- include: installSlurmFromSource.yml
when: ansible_os_family == "Debian"
- name: install slurm rpms
shell: "rpm --install /tmp/rpmbuild/RPMS/x86_64/slurm*{{ slurm_version }}*rpm"
sudo: true
ignore_errors: true
- name: install munge key
template: src=munge_key.j2 dest=/etc/munge/munge.key
sudo: true
notify: restart munge
- name: start munge
service: name=munge state=started
sudo: true
when: ansible_os_family == "RedHat"
- name: install slurm.conf
template: src=slurm.conf.j2 dest=/etc/slurm/slurm.conf
sudo: true
notify: restart slurm
when: slurm_use_vpn==False
- name: install slurm.conf
template: src=slurm-vpn.conf.j2 dest=/etc/slurm/slurm.conf
sudo: true
notify: restart slurm
when: slurm_use_vpn==True
- name: create data directory
file: path="{{ slurmdatadir }}" state=directory owner=slurm group=slurm mode=755
sudo: true
- name: create log directory
shell: mkdir -p {{ slurmddebug.log | dirname }}; chown slurm:slurm {{ slurmddebug.log | dirname }}
args:
creates: "{{ slurmddebug.log | dirname }}"
- name: start munge
service: name=munge state=started
sudo: true
when: slurmddebug is defined and slurmddebug.log
- name: start slurm
service: name=slurm state=started
......
- name: "restart sshd"
service: name=sshd state=restarted
sudo: true
when: ansible_os_family == "RedHat"
- name: "restart ssh"
service: name=ssh state=restarted
sudo: true
when: ansible_os_family == "Debian"
......@@ -6,7 +6,9 @@
line: "ChallengeResponseAuthentication yes"
backrefs: yes
sudo: true
notify: restart sshd
notify:
- restart sshd
- restart ssh
- name: "Enable Challenge Response"
lineinfile:
......@@ -16,5 +18,19 @@
line: "PasswordAuthentication yes"
backrefs: yes
sudo: true
notify: restart sshd
notify:
- restart sshd
- restart ssh
- name: "Disable Challenge Response"
lineinfile:
args:
dest: /etc/ssh/sshd_config
regexp: "PasswordAuthentication yes"
line: "PasswordAuthentication no"
backrefs: yes
sudo: true
notify:
- restart sshd
- restart ssh
......@@ -6,3 +6,8 @@
template: src=generic_slurm_config.json.j2 dest=/tmp/Strudel_Desktops.json
delegate_to: 127.0.0.1
run_once: True
- name: "Temlate TurboVNC Strudel config"
template: src=turbo_slurm_config.json.j2 dest=/tmp/Strudel_TurboVNC_Desktops.json
delegate_to: 127.0.0.1
run_once: True
......@@ -268,7 +268,7 @@
"__class__": "cmdRegEx",
"__module__": "siteConfig",
"async": false,
"cmd": "\"mkdir ~/.vnc ; rm -f ~/.vnc/clearpass ; touch ~/.vnc/clearpass ; chmod 600 ~/.vnc/clearpass ; passwd=\"'$'\"( dd if=/dev/urandom bs=1 count=8 2>/dev/null | md5sum | cut -b 1-8 ) ; echo \"'$'\"passwd > ~/.vnc/clearpass ; module load turbovnc ; cat ~/.vnc/clearpass | vncpasswd -f > ~/.vnc/passwd ; chmod 600 ~/.vnc/passwd ; echo -e '#!/bin/bash\\n/usr/local/bin/vncsession --vnc turbovnc --geometry {resolution} ; sleep 36000000 ' | sbatch -p batch -N {nodes} -n {ppn} --time={hours}:00:00 -J desktop_{username} -o .vnc/slurm-%j.out \"",
"cmd": "\"mkdir ~/.vnc ; rm -f ~/.vnc/clearpass ; touch ~/.vnc/clearpass ; chmod 600 ~/.vnc/clearpass ; passwd=\"'$'\"( dd if=/dev/urandom bs=1 count=8 2>/dev/null | md5sum | cut -b 1-8 ) ; echo \"'$'\"passwd > ~/.vnc/clearpass ; cat ~/.vnc/clearpass | vncpasswd -f > ~/.vnc/passwd ; chmod 600 ~/.vnc/passwd ; echo -e '#!/bin/bash\\nvncserver ; sleep 36000000 ' | sbatch -p batch -N {nodes} -n {ppn} --time={hours}:00:00 -J desktop_{username} -o .vnc/slurm-%j.out \"",
"failFatal": true,
"formatFatal": false,
"host": "login",
......@@ -345,7 +345,7 @@
"host": "exec",
"loop": false,
"regex": [
"^.*?started on display \\S+(?P<vncDisplay>:[0-9]+)\\s*$"
"^.*?New 'X' desktop is \\S+(?P<vncDisplay>:[0-9]+)\\s*$"
],
"requireMatch": true
},
......@@ -449,4 +449,4 @@
}
}
}
]
\ No newline at end of file
]
This diff is collapsed.
......@@ -2,11 +2,17 @@
#- include_vars: "{{ hostvars[ansible_hostname]['ansible_distribution'] }}_{{ ansible_architecture }}.yml"
- include_vars: "{{ ansible_distribution }}_{{ ansible_architecture }}.yml"
# Use mate DE on systems that have moved to gnome3, since there is no gpu acceleration by default on NeCTAR openstack
# Trusty (Ubuntu 14.04 LTS) needs repos added. Wheezy (Debian Stable) gets mate from backports, Utopic (Ubuntu 14.10) Jessie (Debian testing) and Sid (Debian unstable) get it by default
- name: add repos apt
shell: "add-apt-repository -y 'deb {{ item }} {{ ansible_distribution_release }} main' "
shell: "add-apt-repository -y ppa:ubuntu-mate-dev/ppa"
sudo: true
with_items: apt_repos
when: ansible_os_family == 'Debian'
when: ansible_distribution_release == 'trusty'
- name: add repos apt
shell: "add-apt-repository -y ppa:ubuntu-mate-dev/trusty-mate"
sudo: true
when: ansible_distribution_release == 'trusty'
- name: install system packages apt
apt: name={{ item }} state=installed update_cache=true force=yes
......
......@@ -2,6 +2,3 @@
system_packages:
- mate-desktop-environment
- tightvncserver
apt_repos:
- "http://repo.mate-desktop.org/archive/1.8/ubuntu"
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