Skip to content
Snippets Groups Projects
Commit 470dd541 authored by erbel's avatar erbel
Browse files

Added live roles

parent 6d0082a8
Branches
Tags
1 merge request!5Dev/live
---
# tasks file for vcsshark
- block:
- name: enable ubuntu group
group: name=ubuntu state=present
- name: enable ubuntu user
user: name=ubuntu state=present shell=/bin/bash
- name: Deploy memeSHARK Job
shell: echo "Insert part for deployment here."
when: task == "DEPLOY"
remote_user: ubuntu
become_user: ubuntu
- block:
- name: Executing check
shell: echo "python3.6 ~/memeshark/memeshark.py"
when: task == "CONFIGURE"
remote_user: ubuntu
become_user: ubuntu
- block:
- name: Start memeSHARK
shell: python3.6 ~/memeshark/main.py -n {{ projectname }} -D {{ mongodb }} -H {{ mongolocation }} -p 27017
when: task == "START"
become_user: "ubuntu"
remote_user: ubuntu
localhost
\ No newline at end of file
---
- hosts: localhost
remote_user: root
roles:
- vcsshark
---
# vars file for vcsshark
projectpath: ~/safe
projectname: safe
#checkstyle
mongodb: vcsshark
mongolocation: localhost
...@@ -35,15 +35,15 @@ while true; do ...@@ -35,15 +35,15 @@ while true; do
echo "$val" echo "$val"
if [ $(echo "$val > $thresholdCrit" | bc ) = 1 ]; then if [ $(echo "$val > $thresholdCrit" | bc ) = 1 ]; then
state=Critical state=CriticalMem
elif [ $(echo "$val > $thresholdHigh" | bc ) = 1 ]; then elif [ $(echo "$val > $thresholdHigh" | bc ) = 1 ]; then
state=High state=HighMem
elif [ $(echo "$val > $thresholdMid" | bc ) = 1 ]; then elif [ $(echo "$val > $thresholdMid" | bc ) = 1 ]; then
state=Mid state=MidMem
elif [ $(echo "$val > $thresholdLow" | bc ) = 1 ]; then elif [ $(echo "$val > $thresholdLow" | bc ) = 1 ]; then
state=Low state=LowMem
else else
state=None state=NoneMem
fi fi
...@@ -52,7 +52,7 @@ while true; do ...@@ -52,7 +52,7 @@ while true; do
else else
echo "New state reached: $state" echo "New state reached: $state"
echo "Publishing new results" echo "Publishing new results"
curl -v -X PUT http://"$endpoint""$propid" -H 'Content-Type: text/occi' -H 'Category: monitorableproperty; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="'$sensor'",occi.core.target="'$propresource'", occi.core.title="monProp", monitoring.property="'$state'", monitoring.property.result="'$propname'"' curl -v -X PUT http://"$endpoint""$propid" -H 'Content-Type: text/occi' -H 'Category: monitorableproperty; scheme="http://schemas.ugoe.cs.rwm/monitoring#"; class="kind"' -H 'X-OCCI-Attribute:occi.core.source="'$sensor'",occi.core.target="'$propresource'", occi.core.title="monProp", monitoring.result="'$state'", monitoring.property="'$propname'"'
oldstate=$state oldstate=$state
fi fi
sleep $sequence sleep $sequence
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment