Commit 6ac2dda9 authored by Kristopher Ruzic's avatar Kristopher Ruzic

hardcode to install erp5-standalone, initial log_uploader\n\nSets up the...

hardcode to install erp5-standalone, initial log_uploader\n\nSets up the ansible playbook we want to run/test, and initializes monitoring process
parent b5e7abe7
#!/usr/bin/python2.7
import sys
import time
from watchdog.observers import Observer
---
- file: path=/opt/ansible-install state=directory mode=0755
- stat path=/opt/ansible-install/playbook_name
register: playbook_name
- name: download log_uploader
get_url: url=https://lab.nexedi.cn/krruzic/test-repository/raw/master/log_uploader
dest=/usr/local/bin/log_uploader
- name: set playbook to run and download
shell: echo "erp5-standalone" > {{ playbook_name }}
# recreate playbook directory
- file: path=/opt/upgrader/ state=directory mode=0755
- shell: rm -rf /opt/ansible-install/playbook/
- shell: mkdir -p /opt/ansible-install/playbook
- name: Download playbook from slapcache
shell: slapcache-download --destination=/opt/ansible-playbook/archive.tar.gz
- name: Uncompress
shell: tar -xzvf /opt/ansible-playbook/archive.tar.gz
args: chdir: /opt/ansible-playbook/playbook/
- name: run ansible playbook
shell: ansible-playbook "{{ lookup('file', {{ playbook_name }}) }}" -i hosts
- name: add log_uploader to cron
cron: name="Ensure log_uploader is running"
minute="5"
job="usr/local/bin/log_uploader"
- name: install python watchdog
shell: easy_install watchdog
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