From de70bcb62d89be0525e12381879b78ddc70ec21d Mon Sep 17 00:00:00 2001 From: YAMASAKI Masahide Date: Sat, 12 Oct 2013 23:00:24 +0900 Subject: [PATCH] introduce pigz --- deploy.yml | 1 + group_vars/all | 4 ++-- production | 1 - rm_tgz.yml | 9 +++++++++ roles/admin/pigz/tasks/main.yml | 5 +++++ roles/murder/create_torrent/tasks/main.yml | 2 +- roles/murder/peer/tasks/main.yml | 2 +- setup.yml | 3 ++- site.yml | 8 ++++---- start_tracker.yml | 1 + 10 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 rm_tgz.yml create mode 100644 roles/admin/pigz/tasks/main.yml diff --git a/deploy.yml b/deploy.yml index b85cdf8..8337354 100644 --- a/deploy.yml +++ b/deploy.yml @@ -5,6 +5,7 @@ - seeder - peer sudo: yes + #serial: 100 roles: - murder/peer diff --git a/group_vars/all b/group_vars/all index 3ba68fa..6ea55e5 100644 --- a/group_vars/all +++ b/group_vars/all @@ -1,10 +1,10 @@ # The global variable file # deploy tag -tag: deploy_test1 +tag: deploy_test2 # path -seeder_files_path: ~/roles +seeder_files_path: ~/builds destination_path: /tmp # path permission diff --git a/production b/production index b09eb42..c964432 100644 --- a/production +++ b/production @@ -3,7 +3,6 @@ [ansible_host] localhost ansible_connection=local - # tracker node [tracker] 10.0.0.1 diff --git a/rm_tgz.yml b/rm_tgz.yml new file mode 100644 index 0000000..9cf4609 --- /dev/null +++ b/rm_tgz.yml @@ -0,0 +1,9 @@ + + +- name: rm_tgz + gather_facts: no + hosts: peer + sudo: yes + roles: + - murder/rm_tgz + diff --git a/roles/admin/pigz/tasks/main.yml b/roles/admin/pigz/tasks/main.yml new file mode 100644 index 0000000..b59ae04 --- /dev/null +++ b/roles/admin/pigz/tasks/main.yml @@ -0,0 +1,5 @@ + +- name: yum install pigz + yum: name=pigz state=latest + tags: pigz + diff --git a/roles/murder/create_torrent/tasks/main.yml b/roles/murder/create_torrent/tasks/main.yml index 69d350c..53a18d1 100644 --- a/roles/murder/create_torrent/tasks/main.yml +++ b/roles/murder/create_torrent/tasks/main.yml @@ -1,6 +1,6 @@ - name: create tar.gz - shell: tar -c -z -C {{ seeder_files_path }}/ -f {{ filename }} {{ tar_options }} . + shell: tar -c -C {{ seeder_files_path }}/ {{ tar_options }} .|pigz > {{ filename }} when: node_type == "seeder" tags: create_tgz diff --git a/roles/murder/peer/tasks/main.yml b/roles/murder/peer/tasks/main.yml index 7fe01bf..42abd10 100644 --- a/roles/murder/peer/tasks/main.yml +++ b/roles/murder/peer/tasks/main.yml @@ -33,6 +33,6 @@ tags: peer - name: tar xf - shell: tar xf {{ filename }} -C "{{ destination_path }}" + shell: unpigz -c {{ filename }} | tar -x -C "{{ destination_path }}" tags: peer diff --git a/setup.yml b/setup.yml index 7b0a4fb..eda2676 100644 --- a/setup.yml +++ b/setup.yml @@ -4,7 +4,7 @@ roles: - admin/clone_murder_files -- name: Upload the support files +- name: Upload the support files and install pigz hosts: - tracker - seeder @@ -12,6 +12,7 @@ sudo: yes roles: - admin/distribute_files + - admin/pigz - name: install screen hosts: diff --git a/site.yml b/site.yml index 4d4bf42..a46eeca 100644 --- a/site.yml +++ b/site.yml @@ -1,6 +1,6 @@ --- -- setup.yml -- create_torrent.yml -- deploy.yml -- stop_seeder_and_tracker.yml +- include: setup.yml +- include: create_torrent.yml +- include: deploy.yml +- include: stop_seeder_and_tracker.yml diff --git a/start_tracker.yml b/start_tracker.yml index 7fecee6..48d0e3a 100644 --- a/start_tracker.yml +++ b/start_tracker.yml @@ -1,6 +1,7 @@ - name: start tracker hosts: tracker + gather_facts: no sudo: yes roles: - admin/start_tracker