first commit
This commit is contained in:
3
roles/python/tasks/main.yml
Normal file
3
roles/python/tasks/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- import_tasks: "{{task|lower}}.yml"
|
||||
|
6
roles/python/tasks/start_service.yml
Normal file
6
roles/python/tasks/start_service.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: start {{repo}}
|
||||
service: name={{repo}} state=started
|
||||
#- name: wait for {{repo}} to start completely
|
||||
#shell: while sleep 2; do grep -m 1 '(JVM running for [0-9\.]\+)$' {{remote_dir}}/../logs/{{repo}}.log && break; done
|
||||
|
8
roles/python/tasks/stop_service.yml
Normal file
8
roles/python/tasks/stop_service.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: wait 2s to free connections
|
||||
shell: sleep 2
|
||||
- name: stop {{repo}}
|
||||
service: name={{repo}} state=stopped
|
||||
#- name: clean {{repo}} logs
|
||||
#shell: cd {{remote_dir}}/../logs/{{repo}} && rm -f *
|
||||
|
16
roles/python/tasks/svn.yml
Normal file
16
roles/python/tasks/svn.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
- name: check whether {{repo}} exists
|
||||
shell: ls {{repo}}/.svn || true
|
||||
args:
|
||||
chdir: "{{remote_dir}}"
|
||||
register: repo_exists
|
||||
|
||||
- name: checkout {{repo}} from svn
|
||||
shell: cd {{remote_dir}} && rm -rf {{repo}} && svn checkout {{svn_opt}} {{svn_url}} {{repo}} &>> {{ansible_env.SSH_TTY}}
|
||||
when: repo_exists.stdout == ''
|
||||
|
||||
- name: update {{repo}} from svn
|
||||
shell: cd {{remote_dir}}/{{repo}} && svn update {{svn_opt}} &>> {{ansible_env.SSH_TTY}}
|
||||
register: update_result
|
||||
when: repo_exists.stdout != ''
|
||||
|
Reference in New Issue
Block a user