From 255a250d59de46c3bb3b6b7b40d8ae036ad1bd4a Mon Sep 17 00:00:00 2001 From: YAMASAKI Masahide Date: Sat, 12 Oct 2013 00:44:02 +0900 Subject: [PATCH] add screen and introduce changed_when --- roles/admin/screen/tasks/main.yml | 5 +++++ roles/admin/stop_all_peering/tasks/main.yml | 3 +++ roles/admin/stop_all_seeding/tasks/main.yml | 3 +++ roles/admin/stop_tracker/tasks/main.yml | 3 +++ roles/murder/stop_seeding/tasks/main.yml | 3 +++ distribute_files.yml => setup.yml | 11 ++++++++++- site.yml | 2 +- 7 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 roles/admin/screen/tasks/main.yml rename distribute_files.yml => setup.yml (65%) diff --git a/roles/admin/screen/tasks/main.yml b/roles/admin/screen/tasks/main.yml new file mode 100644 index 0000000..7aad694 --- /dev/null +++ b/roles/admin/screen/tasks/main.yml @@ -0,0 +1,5 @@ + +- name: install screen + yum: name=screen state=latest + tags: screen + diff --git a/roles/admin/stop_all_peering/tasks/main.yml b/roles/admin/stop_all_peering/tasks/main.yml index 16ae081..9c71279 100644 --- a/roles/admin/stop_all_peering/tasks/main.yml +++ b/roles/admin/stop_all_peering/tasks/main.yml @@ -1,5 +1,8 @@ - name: stop all peering shell: pkill -f "murder_client.py peer" + register: result + failed_when: result.rc not in [0, 1] + changed_when: result.rc not in [0, 1] tags: stop_all_peering diff --git a/roles/admin/stop_all_seeding/tasks/main.yml b/roles/admin/stop_all_seeding/tasks/main.yml index 2a8a483..e24f453 100644 --- a/roles/admin/stop_all_seeding/tasks/main.yml +++ b/roles/admin/stop_all_seeding/tasks/main.yml @@ -1,5 +1,8 @@ - name: stop all seeding shell: pkill -f "SCREEN.*seeder-" + register: result + failed_when: result.rc not in [0, 1] + changed_when: result.rc not in [0, 1] tags: stop_all_seeding diff --git a/roles/admin/stop_tracker/tasks/main.yml b/roles/admin/stop_tracker/tasks/main.yml index 323ff14..7a93f65 100644 --- a/roles/admin/stop_tracker/tasks/main.yml +++ b/roles/admin/stop_tracker/tasks/main.yml @@ -1,5 +1,8 @@ - name: stop tracker shell: pkill -f 'SCREEN.*murder_tracker.py' + register: result + failed_when: result.rc not in [0, 1] + changed_when: result.rc not in [0, 1] tags: stop_tracker diff --git a/roles/murder/stop_seeding/tasks/main.yml b/roles/murder/stop_seeding/tasks/main.yml index ff73066..49f4428 100644 --- a/roles/murder/stop_seeding/tasks/main.yml +++ b/roles/murder/stop_seeding/tasks/main.yml @@ -1,4 +1,7 @@ - name: stop seeding shell: pkill -f "SCREEN.*seeder-{{ tag }}" + register: result + failed_when: result.rc not in [0, 1] + changed_when: result.rc not in [0, 1] tags: stop_seeding diff --git a/distribute_files.yml b/setup.yml similarity index 65% rename from distribute_files.yml rename to setup.yml index 2c7c059..7b0a4fb 100644 --- a/distribute_files.yml +++ b/setup.yml @@ -1,3 +1,4 @@ + - name: get distribute_files hosts: ansible_host roles: @@ -8,7 +9,15 @@ - tracker - seeder - peer - #sudo: yes + sudo: yes roles: - admin/distribute_files +- name: install screen + hosts: + - tracker + - seeder + sudo: yes + roles: + - admin/screen + diff --git a/site.yml b/site.yml index f7f30c8..4d4bf42 100644 --- a/site.yml +++ b/site.yml @@ -1,5 +1,5 @@ --- -- distribute_files.yml +- setup.yml - create_torrent.yml - deploy.yml - stop_seeder_and_tracker.yml