diff --git a/deploy/roles/common/tasks/main.yml b/deploy/roles/common/tasks/main.yml index 2485d12..4c2925b 100644 --- a/deploy/roles/common/tasks/main.yml +++ b/deploy/roles/common/tasks/main.yml @@ -1,29 +1,40 @@ --- # Packages - apt: name: "{{ item }}" #update_cache: yes with_items: - htop - iotop - iftop - iperf - screen - vim - tcpdump - ntp - qtbase5-dev - emacs-nox # SSH Keys - name: SSH Keys for root authorized_key: user=root key="{{ item }}" with_items: - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCg4sLDXRNWUuF3Fx4rxeQ5u9F5MbjFggCdiQSorACh2yLMsFwj1MenWJRN5LRwmyciKGQbNwdZTqA/Oh5dsXgY7liYNWeHhagu9/DnXcs8Rtv9qXabazf7Rkqftz793pVJm8eK53vfPlckN5Jg4vYFcgIaX6qXn5KbMbfK1Zc8/urLNZM7ywByXPrDEV2X8px6BPNaldXFOO+4hvmxLufKEDf9iROMveDjcgGOU9hlNiTTeTQwD1Q+6QpKVxLNYbFTggICYWCIMmHZR9hsI0y/8EU5fMB/T7dLtVXyCuwpc2Y3ycdOMA+FEooV6tveC6RLuUA35vs32MdAcwCe4aCB rorist@blackeye" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+YXgLj0Yy4B2CT1MTIo5T5k61WvvGDHeDMqd+hxIfhNnJUpqeJ8B7s6JyWS3c1pk7djcie0ozHKRzCkEocwre1wgFvYc3pfuuKYwS50/OOwoNHwO8Yz12M6DMnGD8Q4FjjQrUx6GE2i/NtX9grlzqC8pe2qyg8szdmGrdx95+5Cej57e9iE4xH+9/X4kvO4qy8/RWWcpe6gdhyk+rlonO3GLakAHHhwuwit151KxJGD9qjW9+G9iQWTH9+IlCoHOtD9wYbNG5x117NhRTPVKc4UShKttmJ7DQ2dofXUfIEXSNSnHVnhyHosr32fG0+a1l7gAgXNvGtJbHjSYd+d3J aubort@pleiad" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCtugT/NP/HYCMJ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9W8VFUS8/7+N+5XGvMnX47n82YWnYjN7SP5NUmHxCK+d2R9lH8GDMe7siQb2V0H3/baOXTLpsiyJbCyUyS9ZnIefzas8Qy++CN5El2TU5V4t2pzMwUuNHQVk2I/YSPDcioxuVGJEmUMqB0SX344SOTnYQFNcj9+jy1a/FELMxRZzY7ZzBH/bGx2oCFE7q0HoQpcU2I2JVfCK1LRtfVS1hWppdfEw+Qp2kMWYES4ZZE9KdKWeOjNF1Vz+hlZszziCNBFrwhFuiLIvDASc+GdHvQFY3rJC9qMogdknMtaCoxIrDQq3M+RHb0CEg1/o8nZcqr/SSXO7JOBIUuBOfK5rQyqYD4LzTmVTyUGvThhRsjm2UH76cC46x3ZDG5mcfka4lHoGnNkorSY3OvlbEXNFD2nnVZCqyftMsIlsNGmOXU+lKwfHultvCS8NRfFjGq2fJmDUWK7GN/oI9yqJ3XWh+xmwtoedZX4tgZW0JHb2TF9PqJspomYwCTUOni1OryZ9DMq6P01NRGUAkoA/TIs0cWtyb4u8KOMqQyhRyOcn1BilMXI2IXFHfu9Ug5yqimmmV5YrWWmCeNrRPBguO6Fiu5FWVimLFCFcw6M9L6sFt8h8L+EbWG8AtVcxvONmHcuHe1/Jty6lvw+i+6v5ptF8TW4eKmEGvAfeK0mfjTbIx00HGR18zdjELmysifOMlB1QFL8fAP52mUY08EXh6QJW8pmC3NYfHmlRfJjlthrGyiRVu0XHHStFiYolbMwHmkSncsvsQGHJxkiDMKQG7iL4+AiULNkSWZk0A08jnKzuEUU0Xnvw0gU8lTeL7Jj8H3oW8jnTvviKA7z7MI5pP4r+d9uFq7/3nbu4OWknK235AbmBY2mVfLp/3ja7b15qtd8sjTtFjToY6zTb8G6sV2eQKsAxGbw4bedqOSZljL9gDxQfeLYMCxo8whkbu9GBIIveZyeBEFyBH2Ja6s71iRWPllFlfIX4OM8j5hAM/gpI8ppmkj clusters" - - hostname: name: "{{ inventory_hostname }}" + +- name: Creating some users + block: + - user: + name: spack + uid: 206 + - user: + name: slurm + uid: 204 + system: yes + tags: + - users diff --git a/deploy/roles/spack/files/.bashrc b/deploy/roles/spack/files/.bashrc new file mode 100644 index 0000000..33eabfc --- /dev/null +++ b/deploy/roles/spack/files/.bashrc @@ -0,0 +1,114 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples +source /softs/spack/share/spack/setup-env.sh + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + #alias grep='grep --color=auto' + #alias fgrep='fgrep --color=auto' + #alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +#alias ll='ls -l' +#alias la='ls -A' +#alias l='ls -CF' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi diff --git a/deploy/roles/spack/files/modules.yaml b/deploy/roles/spack/files/modules.yaml new file mode 100644 index 0000000..98c7c75 --- /dev/null +++ b/deploy/roles/spack/files/modules.yaml @@ -0,0 +1,122 @@ +# ------------------------------------------------------------------------- +# This is the default configuration for Spack's module file generation. +# +# Settings here are versioned with Spack and are intended to provide +# sensible defaults out of the box. Spack maintainers should edit this +# file to keep it current. +# +# Users can override these settings by editing the following files. +# +# Per-spack-instance settings (overrides defaults): +# $SPACK_ROOT/etc/spack/modules.yaml +# +# Per-user settings (overrides default and site settings): +# ~/.spack/modules.yaml +# ------------------------------------------------------------------------- +modules: + enable: + - tcl + - lmod + prefix_inspections: + bin: + - PATH + man: + - MANPATH + share/man: + - MANPATH + share/aclocal: + - ACLOCAL_PATH + lib: + - LIBRARY_PATH + - LD_LIBRARY_PATH + lib64: + - LIBRARY_PATH + - LD_LIBRARY_PATH + include: + - CPATH + lib/pkgconfig: + - PKG_CONFIG_PATH + lib64/pkgconfig: + - PKG_CONFIG_PATH + '': + - CMAKE_PREFIX_PATH + + lmod: + hash_length: 0 + + hierarchy: + - mpi + + core_compilers: + - gcc@5.4.0 + + all: + suffixes: + +mpi: mpi + +openmp: openmp + '^fftw+openmp': openmp + +plumed: plumed + '^cuda': cuda + ^python@2.7.14: py2 + ^python@3.6.5: py3 + environment: + set: + '${PACKAGE}_ROOT': '${PREFIX}' + + blacklist: [ + 'autoconf', + 'automake', + 'bison', + 'bzip2', + 'flex', + 'gdbm', + 'gettext', + 'gmp', + 'help2man', + 'hwloc', + 'inputproto', + 'kbproto', + 'libpciaccess', + 'libpthread-stubs', + 'libsigsegv', + 'libtool', + 'libx11', + 'libxau', + 'libxcb', + 'libxdmcp', + 'libxml2', + 'm4', + 'ncurses', + 'openssl', + 'perl', + 'pkgconf', + 'readline', + 'sqlite', + 'tar', + 'texinfo', + 'util-macros', + 'xcb-proto', + 'xextproto', + 'xproto', + 'xtrans', + 'xz', + 'py-cycler', + 'py-cython', + 'py-dateutil', + 'py-enum34', + 'py-functools32', + 'py-hypothesis', + 'py-kiwisolver', + 'py-matplotlib', + 'py-numpy', + 'py-pillow', + 'py-pip', + 'py-py', + 'py-pyparsing', + 'py-pytest', + 'py-pytz', + 'py-scipy', + 'py-setuptools', + 'py-six', + 'py-subprocess32', + ] \ No newline at end of file diff --git a/deploy/roles/spack/tasks/main.yml b/deploy/roles/spack/tasks/main.yml new file mode 100644 index 0000000..24fe8a6 --- /dev/null +++ b/deploy/roles/spack/tasks/main.yml @@ -0,0 +1,31 @@ +--- +- name: installing spack + block: + - git: + repo: 'https://github.com/spack/spack.git' + dest: /softs/spack + tags: + - spack + when: "'frontal' in group_names" + +- name: setting spack env + block: + - copy: + src: .bashrc + dest: /home/spack + owner: spack + group: spack + - apt: + name: "{{ item }}" + with_items: + - g++-6 + - gfortran-6 + - cmake + - python + - python3 + tags: + - packages + - command: + - spack compiler find + become: spack +