From fb88d9b85b5cea8fcdcf0b9c293214ac35818ea2 Mon Sep 17 00:00:00 2001 From: don sizemore Date: Sat, 20 Feb 2016 20:35:22 -0500 Subject: [PATCH] #6 add condor role, such as it is, run conder prereq before first deploy-all.yaml call --- ansible/playbooks/condor.yaml | 5 ++ ansible/playbooks/prereqs.yaml | 1 + .../condor/files/htcondor-stable-rhel7.repo | 5 ++ ansible/roles/condor/tasks/main.yml | 29 ++++++++ .../condor/templates/condor_config.local.j2 | 68 +++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 ansible/playbooks/condor.yaml create mode 100644 ansible/roles/condor/files/htcondor-stable-rhel7.repo create mode 100644 ansible/roles/condor/tasks/main.yml create mode 100644 ansible/roles/condor/templates/condor_config.local.j2 diff --git a/ansible/playbooks/condor.yaml b/ansible/playbooks/condor.yaml new file mode 100644 index 000000000..d6b1247e0 --- /dev/null +++ b/ansible/playbooks/condor.yaml @@ -0,0 +1,5 @@ +- hosts: condor:condor-submission:services + sudo: yes + sudo_user: root + roles: + - role: condor diff --git a/ansible/playbooks/prereqs.yaml b/ansible/playbooks/prereqs.yaml index 1c3908901..4d2e0c47d 100644 --- a/ansible/playbooks/prereqs.yaml +++ b/ansible/playbooks/prereqs.yaml @@ -1,4 +1,5 @@ --- include: iptables.yaml +include: condor.yaml include: docker.yaml diff --git a/ansible/roles/condor/files/htcondor-stable-rhel7.repo b/ansible/roles/condor/files/htcondor-stable-rhel7.repo new file mode 100644 index 000000000..dd7c0953d --- /dev/null +++ b/ansible/roles/condor/files/htcondor-stable-rhel7.repo @@ -0,0 +1,5 @@ +[htcondor-stable] +name=HTCondor Stable RPM Repository for Redhat Enterprise Linux 7 +baseurl=http://research.cs.wisc.edu/htcondor/yum/stable/rhel7 +enabled=1 +gpgcheck=0 diff --git a/ansible/roles/condor/tasks/main.yml b/ansible/roles/condor/tasks/main.yml new file mode 100644 index 000000000..5d4ca8037 --- /dev/null +++ b/ansible/roles/condor/tasks/main.yml @@ -0,0 +1,29 @@ +--- + +- name: install condor RHEL/CentOS7 repo + copy: src="htcondor-stable-rhel7.repo" dest=/etc/yum.repos.d owner=root group=root mode=0644 + when: ansible_distribution == "CentOS" and + ansible_distribution_major_version == "7" + tags: + - deploy_condor + +- name: install HTCondor + sudo: yes + yum: name=condor-all state=latest + when: ansible_distribution == "CentOS" and + ansible_distribution_major_version == "7" + tags: + - deploy_condor + +- name: set the /etc/condor/condor_config.local file + sudo: yes + template: src=condor_config.local.j2 dest=/etc/condor/condor_config.local owner=root group=root mode=0644 + +- name: create cred_dir + sudo: yes + file: path="{{ condor.cred_dir }}" state=directory owner=condor group=condor mode=0755 + +- name: restart condor + sudo: yes + service: name=condor state=restarted enabled=yes + diff --git a/ansible/roles/condor/templates/condor_config.local.j2 b/ansible/roles/condor/templates/condor_config.local.j2 new file mode 100644 index 000000000..1c00b19d0 --- /dev/null +++ b/ansible/roles/condor/templates/condor_config.local.j2 @@ -0,0 +1,68 @@ +## For more detial please see +## http://www.cs.wisc.edu/condor/manual/v7.4/3_3Configuration.html + +## Condor Config for iPlant condor cluser on DE services host. + +## What machine is your central manager? + +#CONDOR_HOST = $(FULL_HOSTNAME) +CONDOR_HOST = {{ condor.host }} + +## Pool's short description + +COLLECTOR_NAME = {{environment_name}} Condor Pool at $(FULL_HOSTNAME) + +## When is this machine willing to start a job? + +START = TRUE + + +## When to suspend a job? + +SUSPEND = FALSE + + +## When to nicely stop a job? +## (as opposed to killing it instantaneously) + +PREEMPT = FALSE + + +## When to instantaneously kill a preempting job +## (e.g. if a job is in the pre-empting stage for too long) + +KILL = FALSE + +## This macro determines what daemons the condor_master will start and keep its watchful eyes on. +## The list is a comma or space separated list of subsystem names + +#DAEMON_LIST = COLLECTOR, MASTER, NEGOTIATOR, SCHEDD, STARTD +DAEMON_LIST = MASTER, SCHEDD, CREDD + +## Sets how often the condor_negotiator starts a negotiation cycle. +## It is defined in seconds and defaults to 60 (1 minute). + +NEGOTIATOR_INTERVAL = 20 + +## Disable UID_DOMAIN check when submit a job + +TRUST_UID_DOMAIN = TRUE + +################################# +## Added for iPlant Collaborative +################################# +CONDOR_ADMIN = {{ condor.admin }} +UID_DOMAIN = {{ condor.uid_domain }} +FILESYSTEM_DOMAIN = {{ condor.filesystem_domain }} +COLLECTOR_NAME = {{ condor.collector_name }} +# FLOCK_TO = {{ condor.flock_to }} +ALLOW_READ = {{ condor.allow_read }} +ALLOW_WRITE = {{ condor.allow_write }} +HIGHPORT = 65535 +LOWPORT = 61440 +JAVA = /usr/java/latest/bin/java +## used for debugging purposes +#NUM_SLOTS = 5 + +EVENT_LOG_MAX_SIZE = 1000000000 +EVENT_LOG_MAX_ROTATIONS = 3