diff options
-rw-r--r-- | docker/Dockerfile | 2 | ||||
-rw-r--r-- | qtip/driver/playbook/ramspeed/run.yaml | 2 | ||||
-rw-r--r-- | qtip/driver/playbook/unixbench/dhrystone.yaml | 8 | ||||
-rw-r--r-- | qtip/driver/playbook/unixbench/whetstone.yaml | 8 | ||||
-rwxr-xr-x | qtip/scripts/cleanup_creds.sh | 11 | ||||
-rw-r--r-- | qtip/util/env.py | 17 |
6 files changed, 42 insertions, 6 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 149c1fda..a4a7e477 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,7 +36,7 @@ RUN apt-get update && apt-get install -y \ supervisor \ python-setuptools \ iputils-ping\ - rsync + rsync \ --no-install-recommends \ && rm -rf /var/lib/apt/lists/* diff --git a/qtip/driver/playbook/ramspeed/run.yaml b/qtip/driver/playbook/ramspeed/run.yaml index 94becb55..496cd5db 100644 --- a/qtip/driver/playbook/ramspeed/run.yaml +++ b/qtip/driver/playbook/ramspeed/run.yaml @@ -31,7 +31,7 @@ - ~/ramspeed/ramsmp-3.5.0/ramsmp -b 3 -l 5 -p 1 >> Intmem - ~/ramspeed/ramsmp-3.5.0/ramsmp -b 6 -l 5 -p 1 >> Floatmem args: - chdir: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/whetstone/' + chdir: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/ramspeed/' - name: Fetch result files to local manchine synchronize: diff --git a/qtip/driver/playbook/unixbench/dhrystone.yaml b/qtip/driver/playbook/unixbench/dhrystone.yaml index caa97f44..a0ee89a3 100644 --- a/qtip/driver/playbook/unixbench/dhrystone.yaml +++ b/qtip/driver/playbook/unixbench/dhrystone.yaml @@ -25,8 +25,12 @@ args: chdir: '{{ ansible_env.HOME }}/tempT/UnixBench/' -- name: Copying result and system info to qtip result directory - shell: mv ~/tempT/UnixBench/results/* ./ +- name: Copying result to qtip result directory + shell: '{{ item }}' + with_items: + - mv ~/tempT/UnixBench/results/*.log ./ + - mv ~/tempT/UnixBench/results/*.html ./ + - mv ~/tempT/UnixBench/results/* ./dhrystone args: chdir: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/dhrystone/' diff --git a/qtip/driver/playbook/unixbench/whetstone.yaml b/qtip/driver/playbook/unixbench/whetstone.yaml index 723fb3a6..c753779f 100644 --- a/qtip/driver/playbook/unixbench/whetstone.yaml +++ b/qtip/driver/playbook/unixbench/whetstone.yaml @@ -25,8 +25,12 @@ args: chdir: '{{ ansible_env.HOME }}/tempT/UnixBench/' -- name: Copying result and system info to qtip result directory - shell: mv ~/tempT/UnixBench/results/* ./ +- name: Copying result to qtip result directory + shell: '{{ item }}' + with_items: + - mv ~/tempT/UnixBench/results/*.log ./ + - mv ~/tempT/UnixBench/results/*.html ./ + - mv ~/tempT/UnixBench/results/* ./whetstone args: chdir: '{{ ansible_env.HOME }}/qtip_result/{{ ansible_hostname }}/whetstone/' diff --git a/qtip/scripts/cleanup_creds.sh b/qtip/scripts/cleanup_creds.sh new file mode 100755 index 00000000..b4eee924 --- /dev/null +++ b/qtip/scripts/cleanup_creds.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +DEST_IP=$1 +HOSTNAME=$(hostname) +sshoptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + +case "$INSTALLER_TYPE" in + fuel) + ssh $sshoptions -i ./config/QtipKey root@$DEST_IP "sed -i '/root@$HOSTNAME/d' /root/.ssh/authorized_keys" + ;; +esac diff --git a/qtip/util/env.py b/qtip/util/env.py index 24e08658..830c9b38 100644 --- a/qtip/util/env.py +++ b/qtip/util/env.py @@ -16,6 +16,10 @@ import time import paramiko +from qtip.util.logger import QtipLogger + +logger = QtipLogger('ansible_driver').get + SCRIPT_DIR = path.join(path.dirname(__file__), path.pardir, 'scripts') KEYNAME = 'QtipKey' PRIVATE_KEY = '{0}/qtip/{1}'.format(os.environ['HOME'], KEYNAME) @@ -185,3 +189,16 @@ class AnsibleEnvSetup(object): return False time.sleep(2) return False + + def cleanup(self): + IF_DEBUG = os.getenv('IF_DEBUG') + + if IF_DEBUG: + logger.info("DEBUG Mode: please do cleanup by manual.") + else: + logger.info("Cleanup hostfile and keypair.") + clean_file(self.hostfile, self.keypair, self.keypair + '.pub') + + for ip in self.host_ip_list: + logger.info("Cleanup authorized_keys from {0}...".format(ip)) + os.system('bash %s/cleanup_creds.sh {0}'.format(ip)) |