From d25c2f7a159e16ce62c54c084aee8e9f71f5aea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20M=C3=BCller?= Date: Tue, 27 Apr 2021 14:32:25 +0200 Subject: [PATCH] README, minor structure improvements --- README.md | 19 ++++++++++++ inv.yml | 7 +++++ play.yml | 31 +++++++++++++------ .../docker/tasks/main.yml | 0 4 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 README.md rename docker_setup.yml => roles/docker/tasks/main.yml (100%) diff --git a/README.md b/README.md new file mode 100644 index 0000000..4cfdf63 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# Requirements: +CentOS 7 vm equipped with 2 CPU cores and 2 disks: one main disk containing OS +and an additional virtio disk containing docker images. Typically choose 5GB +for size of each disk. + +# Tags +- htcondor, singularity, docker, slurm +- htcondor-containered, slurm-config + +Just update slurm config using --tags slurm-config. +Full setup of just slurm using --skip-tags htcondor,singularity + +# Example: Setup SLURM +First adjust inv.yml to you needs, specifying the hostname of your VM. Run: + + ansible-playbook -i inv.yml --skip-tags htcondor,singularity play.yml + +Configuration goes into ```/container/volumes/slurm/slurm.conf``` generated +from ```roles/slurm/templates/slurm.conf.j2```. diff --git a/inv.yml b/inv.yml index 102b3c7..d21860b 100644 --- a/inv.yml +++ b/inv.yml @@ -5,3 +5,10 @@ all: ansible_host: ed-c7-1.virt.magni.thoto.net ssh_args: -o ControlMaster=auto -o ControlPersist=60s # ansible_host: 192.168.122.139 + children: + htcondor: + hosts: + ed-c7-1: + slurm: + hosts: + ed-c7-1: diff --git a/play.yml b/play.yml index 5555b03..d2110ba 100644 --- a/play.yml +++ b/play.yml @@ -1,43 +1,54 @@ --- -- hosts: ed-c7-1 +- hosts: all tasks: - name: "install tools" yum: name: [ vim-enhanced, htop, screen, bind-utils, nmap-ncat, net-tools ] state: present +- hosts: htcondor + pre_tasks: - name: "install htcondor repo" yum: name: https://research.cs.wisc.edu/htcondor/repo/8.9/htcondor-release-current.el7.noarch.rpm state: present + tags: htcondor - name: "install htcondor software " yum: name: htcondor-ce state: present + tags: htcondor - name: "remove minicondor configuration" yum: name: minicondor state: absent + tags: htcondor - name: "setup singularity" import_tasks: "singularity.yml" tags: singularity + roles: - name: "setup docker" - import_tasks: "docker_setup.yml" + role: docker tags: docker - name: "setup htcondor test environment in docker containers" - import_role: - name: docker-htcondor - tags: htcondor-containered + role: docker-htcondor + tags: + - htcondor-containered + - htcondor +- hosts: slurm + vars: + container_privileged: True + num_nodes: 3 + roles: + - name: "setup docker" + role: docker + tags: docker - name: "setup slurm test environment in docker containers" - import_role: - name: slurm - vars: - container_privileged: True - num_nodes: 3 + role: slurm tags: slurm diff --git a/docker_setup.yml b/roles/docker/tasks/main.yml similarity index 100% rename from docker_setup.yml rename to roles/docker/tasks/main.yml