[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [gettor/master] Edit recipes and roles



commit 92c0ca0e0bb97edc82a155aa3753e7ff365f259d
Author: hiro <hiro@xxxxxxxxxxxxxx>
Date:   Sat Aug 31 12:35:46 2019 +0200

    Edit recipes and roles
---
 playbooks/{ => group_vars}/all.yml |  0
 playbooks/update.yml               |  4 ++++
 roles/gettor/tasks/main.yml        |  2 ++
 roles/gettor/tasks/restart.yml     | 22 ++++++++++++++++++++++
 roles/gettor/tasks/source.yml      | 11 -----------
 5 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/playbooks/all.yml b/playbooks/group_vars/all.yml
similarity index 100%
rename from playbooks/all.yml
rename to playbooks/group_vars/all.yml
diff --git a/playbooks/update.yml b/playbooks/update.yml
new file mode 100644
index 0000000..ebb2417
--- /dev/null
+++ b/playbooks/update.yml
@@ -0,0 +1,4 @@
+tasks:
+  - import_role:
+      name: gettor
+    tags: gettor
diff --git a/roles/gettor/tasks/main.yml b/roles/gettor/tasks/main.yml
index 6aaa7dc..3e9e9e0 100644
--- a/roles/gettor/tasks/main.yml
+++ b/roles/gettor/tasks/main.yml
@@ -1 +1,3 @@
+- import_tasks: source.yml
 - import_tasks: db.yml
+- import_tasks: restart.yml
diff --git a/roles/gettor/tasks/restart.yml b/roles/gettor/tasks/restart.yml
new file mode 100644
index 0000000..33ba3c8
--- /dev/null
+++ b/roles/gettor/tasks/restart.yml
@@ -0,0 +1,22 @@
+---
+
+- name: virtualenv start
+  command: >
+    virtualenv venv
+  environment:
+        PATH: {{ gettor_path }}
+
+
+- name: virtualenv activate
+  command: >
+    source venv/bin/activate
+  environment:
+        PATH: {{ gettor_path }}
+
+- name: stop gettor
+  command: >
+    {{ gettor_path }}/bin gettor_service stop
+
+- name: start gettor
+  command: >
+    {{ gettor_path }}/bin gettor_service start
diff --git a/roles/gettor/tasks/source.yml b/roles/gettor/tasks/source.yml
index 33b7978..8fde7d2 100644
--- a/roles/gettor/tasks/source.yml
+++ b/roles/gettor/tasks/source.yml
@@ -4,20 +4,9 @@
     path: "{{ gettor_path }}/.git/config"
   register: stat_result
 
-- name: checkout some stuff
-  command: git checkout -- db/schema.rb locale
-  args:
-    chdir: "{{ gettor_path }}"
-  when: stat_result.stat.exists
-
 - name: update gettor source
   git:
     repo: "{{ gettor_repo }}"
     dest: "{{ gettor_path }}"
     umask: '022'
   diff: false
-  when: not ansible_check_mode
-  notify:
-    - restart gitlab-mailroom
-    - restart gitlab-sidekiq
-    - reload gitlab-unicorn

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits