--- ## Install Phabricator # Source: https://github.com/relrod/phabricator-ansible - name: Create log directory file: state=directory path=/var/log/phabricator owner="{{ phd_user }}" group="{{ phd_user }}" - name: Create directory file: state=directory path=/srv/www owner="{{ phd_user }}" - name: Create tmp directory file: state=directory path=/var/tmp/phd/ owner="{{ phd_user }}" - name: Clone phacility/libphutil git: repo: https://github.com/phacility/libphutil dest: "{{ phabricator_path }}libphutil" version: stable update: false sudo_user: "{{ phd_user }}" - name: Clone phacility/arcanist git: repo: https://github.com/phacility/arcanist.git dest: "{{ phabricator_path }}arcanist" version: stable update: false sudo_user: "{{ phd_user }}" - name: Create symlink for arc file: path: /usr/local/bin/arc src: "{{ phabricator_path }}arcanist/bin/arc" state: link - name: Clone phacility/phabricator git: repo: https://github.com/phacility/phabricator.git dest: "{{ phabricator_path }}phabricator" version: stable update: false sudo_user: "{{ phd_user }}" - name: Remove local configuration if present file: path="{{ phabricator_path }}phabricator/conf/local/local.json" state=absent - name: Create a conf/custom directory. file: state=directory path={{ phabricator_path }}phabricator/conf/custom sudo_user: "{{ phd_user }}" - name: Place a starting-point custom config in {{ phabricator_path }}phabricator/conf/custom/myconfig.conf.php template: src=phabricator_myconfig.conf.php dest={{ phabricator_path }}phabricator/conf/custom/myconfig.conf.php mode: 0640 sudo_user: "{{ phd_user }}" notify: reload apache - name: Include the config shell: echo 'custom/myconfig' > {{ phabricator_path }}phabricator/conf/local/ENVIRONMENT args: creates: "{{ phabricator_path }}phabricator/conf/local/ENVIRONMENT" sudo_user: "{{ phd_user }}" - name: Migrate the database command: chdir={{ phabricator_path }}phabricator ./bin/storage upgrade --force sudo_user: "{{ phd_user }}" when: "'{{ inventory_hostname }}' == '{{ groups.app[0] }}'" # Customization - name: Custom phabricator home application template: src: PhabricatorHomeApplication.php dest: "{{ phabricator_path }}phabricator/src/applications/home/application/PhabricatorHomeApplication.php" notify: reload apache - name: Custom phabricator home controller template: src: PhabricatorHomeMainController2.php dest: "{{ phabricator_path }}phabricator/src/extensions/PhabricatorHomeMainController2.php" notify: reload apache - name: Update repo script template: src: phab_update_repo.sh dest: /root/scripts/phab_update_repo.sh mode: 0750 # Service - name: PHD main service template: src=phd-main dest="{{ phabricator_path }}phabricator/bin/phd-main" mode=0755 when: "'{{ inventory_hostname }}' == '{{ groups.app[0] }}'" notify: restart phd - name: PHD slave service template: src=phd-slave dest="{{ phabricator_path }}phabricator/bin/phd-slave" mode=0755 when: "'{{ inventory_hostname }}' != '{{ groups.app[0] }}'" notify: restart phd - name: PHD systemd service for phabricator template: src: phabricator_phd_init dest: /usr/lib/systemd/system/phd.service mode: 0644 - name: Start PHD service: name=phd state=started enabled=true - name: Email with postfix lineinfile: dest: /etc/aliases line: "{{ phd_user }}: |{{ phabricator_path }}phabricator/scripts/mail/mail_handler.php"