diff --git a/roles/phabricator/tasks/maintenance.yml b/roles/phabricator/tasks/maintenance.yml index 8ad1996..8aef910 100644 --- a/roles/phabricator/tasks/maintenance.yml +++ b/roles/phabricator/tasks/maintenance.yml @@ -1,42 +1,42 @@ --- # Git GC everyday - name: Optimize repo file template: src: "{{ cust_repo_gc }}" dest: /root/scripts/repo-gc.sh mode: 0750 - name: Optimize repositories task cron: name: Optimize repositories minute: 0 hour: 0 weekday: 0 job: "/root/scripts/repo-gc.sh" # Merge identical files - name: Compact file script template: src: "{{ cust_compact_storage }}" dest: /root/scripts/compact-storage.sh mode: 0750 - name: Compact file storage task cron: name: Compact file storage minute: 30 hour: 0 weekday: 0 job: "/root/scripts/compact-storage.sh" run_once: yes # Analyze DB - name: Analyze MariaDB tables cron: name: Analyze MariaDB tables minute: 0 hour: 1 - job: "{{ phabricator_path }}/phabricator/bin/storage analyze --host {{ groups.dbs[0] }}" + job: "{{ phabricator_path }}phabricator/bin/storage analyze --host {{ groups.dbs[0] }}" run_once: yes diff --git a/roles/phabricator/templates/phab_update_repo.sh b/roles/phabricator/templates/phab_update_repo.sh index 36a2f36..84f4f2e 100644 --- a/roles/phabricator/templates/phab_update_repo.sh +++ b/roles/phabricator/templates/phab_update_repo.sh @@ -1,7 +1,7 @@ #!/bin/bash echo "Discovering commits in all repositories ..." -cd {{ phabricator_path }}/phabricator +cd {{ phabricator_path }}phabricator for r in $(./bin/repository list); do ./bin/repository reparse --importing --all $r done diff --git a/tasks/update_phab.yml b/tasks/update_phab.yml index d77f528..71e21f7 100644 --- a/tasks/update_phab.yml +++ b/tasks/update_phab.yml @@ -1,117 +1,117 @@ --- - name: Fix permission on phab git repo hosts: app, phd tags: ['conf-app', 'conf-phd'] user: centos sudo: yes vars_files: - "{{ var }}" tasks: - file: state: directory owner: "{{ phd_user }}" group: "{{ phd_user }}" path: "{{ phabricator_path }}" recurse: yes - name: Phabricator in read-only mode hosts: app, phd tags: ['conf-app', 'conf-phd'] run_once: true user: centos sudo: yes vars_files: - "{{ var }}" tasks: - - shell: "{{ phabricator_path }}/phabricator/bin/config set cluster.read-only true" + - shell: "{{ phabricator_path }}phabricator/bin/config set cluster.read-only true" - name: Stop PHD hosts: phd tags: ['conf-phd'] run_once: true user: centos sudo: yes vars_files: - "{{ var }}" tasks: - service: name=phd state=stopped - name: Update phabricator hosts: app, phd tags: ['conf-app', 'conf-phd'] serial: 1 user: centos sudo: yes sudo_user: "{{ phd_user }}" vars_files: - "{{ var }}" tasks: - name: Set git config shell: "git config --global user.email info@{{ domain }}; git config --global user.name ansible" - name: Clone c4science/libphutil git: repo: https://c4science.ch/source/libphutil.git dest: "{{ phabricator_path }}libphutil" version: "{{ phabricator_branch }}" update: true - name: Clone phacility/arcanist git: repo: https://secure.phabricator.com/diffusion/ARC/arcanist.git dest: "{{ phabricator_path }}arcanist" version: "stable" update: true - name: Clone c4science/phabricator git: repo: https://c4science.ch/source/phab.git dest: "{{ phabricator_path }}phabricator" version: "{{ phabricator_branch }}" update: true - name: Migrate the database command: chdir={{ phabricator_path }}phabricator ./bin/storage upgrade --force when: inventory_hostname == groups.app[0] - name: Restart httpd daemons hosts: app tags: ['conf-app'] serial: 1 user: centos sudo: yes vars_files: - "{{ var }}" tasks: - service: name=httpd24-httpd state=restarted - name: Start PHD hosts: phd tags: ['conf-phd'] run_once: true user: centos sudo: yes vars_files: - "{{ var }}" tasks: - service: name=phd state=started - name: Phabricator in normal mode hosts: app, phd tags: ['conf-app', 'conf-phd'] run_once: true user: centos sudo: yes vars_files: - "{{ var }}" tasks: - shell: "{{ phabricator_path }}/phabricator/bin/config set cluster.read-only false" - name: Check HTTP status code of public pages hosts: 127.0.0.1 tags: always connection: local gather_facts: false vars_files: - "{{ var }}" tasks: - shell: "../utils/check_http.sh {{ http_scheme }}{{ domain }}"