forked from jprorama/CRI_XCBC
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'vagrant-provision' into feat-ood-add-r
- Loading branch information
Showing
21 changed files
with
203 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
--- | ||
- hosts: ood | ||
roles: | ||
- ood | ||
- { name: 'prep_ood', tags: 'prep_ood' } | ||
- { name: 'ood', tags: 'ood' } | ||
- { name: 'warewulf_sync', tags: 'warewulf_sync' } | ||
- { name: 'ood_firewall_and_services', tags: 'ood_firewall_and_services' } | ||
- { name: 'ohpc_firewall_and_services', tags: 'ohpc_firewall_and_services' } | ||
- { name: 'ood_add_rstudio', tags: 'ood_add_rstudio' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ | |
- tmux | ||
- ruby | ||
- turbojpeg | ||
- nc | ||
- '@X Window System' | ||
- '@Xfce' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
- name: Install pip for system python and build tools | ||
yum: | ||
state: present | ||
name: | ||
- '@Development Tools' | ||
- python-pip | ||
|
||
- name: Create user build | ||
user: | ||
name: build | ||
|
||
- name: Change owner and permission of easybuild installation directory | ||
file: | ||
path: "{{ easybuild_prefix }}" | ||
owner: root | ||
group: build | ||
mode: "g+w" | ||
recurse: yes | ||
|
||
- name: Download EasyBuild bootstrap script | ||
get_url: | ||
url: https://raw.githubusercontent.com/easybuilders/easybuild-framework/develop/easybuild/scripts/bootstrap_eb.py | ||
dest: /tmp/bootstrap_eb.py | ||
|
||
- name: Boostrap EasyBuild | ||
shell: | | ||
source /opt/ohpc/admin/lmod/lmod/init/bash | ||
python bootstrap_eb.py "{{ easybuild_prefix }}" | ||
become_user: build | ||
args: | ||
executable: /bin/bash | ||
chdir: /tmp | ||
|
||
- name: Check if EasyBuild installation path is in default MODULEPATH | ||
shell: grep "{{ easybuild_prefix }}/modules/all" /etc/profile.d/lmod.sh | ||
ignore_errors: yes | ||
register: default_modulepath_sh | ||
|
||
- shell: grep "{{ easybuild_prefix }}/modules/all" /etc/profile.d/lmod.csh | ||
ignore_errors: yes | ||
register: default_modulepath_csh | ||
|
||
- name: Add EasyBuild installation path into default MODULEPATH | ||
replace: | ||
path: /etc/profile.d/lmod.sh | ||
regexp: '(MODULEPATH=.*)' | ||
replace: '\1:{{ easybuild_prefix }}/modules/all' | ||
backup: yes | ||
when: default_modulepath_sh.stdout == "" | ||
|
||
- name: Add EasyBuild installation path into default MODULEPATH | ||
replace: | ||
path: /etc/profile.d/lmod.csh | ||
regexp: '(MODULEPATH "[^"]*)' | ||
replace: '\1:{{ easybuild_prefix }}/modules/all' | ||
backup: yes | ||
when: default_modulepath_csh.stdout == "" | ||
|
||
- name: Verify EasyBuild installation | ||
shell: | | ||
source /opt/ohpc/admin/lmod/lmod/init/bash | ||
module use "{{ easybuild_prefix }}/modules/all" | ||
module load EasyBuild | ||
eb --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
- name: start and enable munge | ||
service: | ||
name: munge | ||
state: started | ||
enabled: yes | ||
|
||
- name: start and enable slurmd | ||
service: | ||
name: slurmd | ||
state: started | ||
enabled: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
- name: Enable http service | ||
systemd: | ||
state: started | ||
name: httpd24-httpd | ||
enabled: yes | ||
|
||
- name: Open port http/s | ||
firewalld: | ||
service: http | ||
permanent: true | ||
state: enabled | ||
|
||
- firewalld: | ||
service: https | ||
permanent: true | ||
state: enabled | ||
|
||
- name: Disable SELinux Enforcement (permissive) | ||
selinux: | ||
policy: targeted | ||
state: permissive | ||
|
||
- name: Set SELinux to permissive mode without reboot | ||
command: setenforce 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
- name: Get OpenHPC repo | ||
yum: name={{ openhpc_release_rpm }} state=present update_cache=true | ||
|
||
- name: Install dependencies-nfs-utils, ohpc packages, ntp and other required tools. | ||
yum: name={{ item }} state=installed update_cache=true | ||
with_items: | ||
- nfs-utils | ||
- ohpc-base-compute | ||
- ohpc-slurm-client | ||
- zsh | ||
- git | ||
- vim | ||
- tmux | ||
- ruby | ||
|
||
- name: Mount /home, /opt/ohpc/pub from OHPC node | ||
lineinfile: | ||
path: /etc/fstab | ||
line: '{{ item }}' | ||
with_items: | ||
- "{{ headnode_private_ip }}:/home /home nfs nfsvers=3,nodev,nosuid,noatime 0 0" | ||
- "{{ headnode_private_ip }}:/opt/ohpc/pub /opt/ohpc/pub nfs nfsvers=3,nodev,noatime 0 0" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
# Implement warewulf file synchrnoization for cluster integration | ||
# https://groups.io/g/OpenHPC-users/message/2084 | ||
# https://groups.io/g/OpenHPC-users/message/2405 | ||
|
||
# Discovery avoids having to hard code the ethernet device number | ||
# it keys off the assigned static IP for the ood node and uses that | ||
# to discover the ethernet device and mac address for the node | ||
# adapted from: https://serverfault.com/a/852093 | ||
- name: discover ethernet address for ood internal network | ||
set_fact: | ||
ood_macaddress: "{{ hostvars[inventory_hostname]['ansible_' + item]['macaddress'] }}" | ||
when: hostvars[inventory_hostname]['ansible_' + item]['ipv4']['address'] == ood_ip_addr | ||
with_items: | ||
- "{{ hostvars[inventory_hostname]['ansible_interfaces'] }}" | ||
|
||
- name: install warewulf file synchronization | ||
copy: | ||
src: warewulf | ||
dest: / | ||
owner: root | ||
group: root | ||
|
||
# ensure script files are executable | ||
- file: | ||
path: /warewulf/bin | ||
recurse: true | ||
mode: u+x,g+x | ||
|
||
- name: create custom warewulf config file for node | ||
template: | ||
src: wwnodeconf.j2 | ||
dest: /warewulf/config | ||
owner: root | ||
group: root | ||
mode: 0640 | ||
|
||
- name: add warewulf file sync via cron | ||
copy: | ||
src: wwupdatefiles | ||
dest: /etc/cron.d | ||
owner: root | ||
group: root | ||
mode: 0640 | ||
|
||
- name: create log output dir for warewulf cron | ||
file: | ||
path: /var/log/warewulf | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 755 | ||
|
||
- name: "RUN THESE COMMAND ON OHPC MASTER TO COMPLETE REGISTRATION" | ||
pause: | ||
seconds: 1 | ||
|
||
- name: "sudo wwsh node new ood -y" | ||
pause: | ||
seconds: 1 | ||
|
||
- name: "sudo wwsh node set ood -y -I {{ ood_ip_addr }} --hwadd {{ ood_macaddress }}" | ||
pause: | ||
seconds: 1 | ||
|
||
- name: "sudo wwsh provision set ood -y --files dynamic_hosts,munge.key,slurm.conf --bootlocal=exit" | ||
pause: | ||
seconds: 90 | ||
|
||
- name: Force warewulf synchronization | ||
shell: /warewulf/bin/wwgetfiles >/var/log/warewulf/wwgetfiles.log 2>&1 |
File renamed without changes.