Commit ae1b435d authored by Kristopher Ruzic's avatar Kristopher Ruzic

Fixes former issues in test-suite playbook

also adds a bit to log-uploader. Currently can correctly request erp5-standalon
parent 71545053
...@@ -16,15 +16,15 @@ class MyHandler(FileSystemEventHandler): ...@@ -16,15 +16,15 @@ class MyHandler(FileSystemEventHandler):
f.write(fmt_date() + ": partition completed") f.write(fmt_date() + ": partition completed")
f.close() f.close()
upload_file(event.file, open("tmp/tmpupload", 'rb') upload_file(event.file, open("tmp/tmpupload", 'rb')
else: else:
return return
def fmt_date(): def fmt_date():
return time.strftime("[ %Y%m%d %H:%M:%S ]") return time.strftime("[ %Y%m%d %H:%M:%S ]")
class uploader(): class uploader():
system_name = "" system_name = "first-machine" # possibly generate later?
url = 'LATER' url = 'https://[2001:67c:1254:e:a9::bafb]:???/post'
# takes a file handler and a name (where it should be saved on server) # takes a file handler and a name (where it should be saved on server)
def upload_file(file_name, contents): def upload_file(file_name, contents):
......
--- ---
- stat: path=/tmp/playbook_software_name
register: software_release
- name: download software_release name - name: download software_release name
get_url: url=https://lab.nexedi.cn/krruzic/test-repository/raw/master/software get_url: url=https://lab.nexedi.cn/krruzic/test-repository/raw/master/software
dest=software_release dest=/tmp/playbook_software_name
- name: create log-uploader - name: create log-uploader
copy: src=log-uploader dest=/usr/local/bin/log-uploader mode=755 copy: src=log-uploader dest=/usr/local/bin/log-uploader mode=755
- name: add log_uploader to cron - name: add log-uploader to cron
cron: name="Ensure log_uploader is running" cron: name="Ensure log-uploader is running"
minute="*/6" minute="*/6"
job="usr/local/bin/log_uploader" job="usr/local/bin/log-uploader"
- name: run ansible playbook - name: run ansible playbook
shell: ansible-playbook "{{ lookup('file', {{ software_release }}) }}" -i hosts shell: ansible-playbook "{{ lookup('file', '/tmp/playbook_software_name') }}" -i hosts
# install dependencies # install dependencies
- easy_install: name=watchdog state=latest - easy_install: name=pip
- easy_install: name=pip state=latest
- pip: name=requests - pip: name=requests
- pip: name=watchdog
--- - name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
roles: roles:
- test-suite - test-suite
- standalone-shared
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment