diff --git a/tasks/configure-app.yml b/tasks/configure-app.yml index 0c58877..3e4ea43 100644 --- a/tasks/configure-app.yml +++ b/tasks/configure-app.yml @@ -1,139 +1,139 @@ --- - yum: name="{{ item }}" state=present with_items: - nginx - php - php-fpm - php-mysql - php-gd - php-mbstring - php-posix - php-pear - php-devel - pcre-devel - yum: name="{{ item }}" state=absent with_items: - php-pecl-apcu ## Users - user: name="{{ phd_user }}" - user: name="{{ www_user }}" - user: name: "{{ vcs_user }}" password: "NP" shell: "/bin/sh" - name: Create sudoers template: src: sudoers dest: "/etc/sudoers.d/phabricator" mode: 0440 owner: root group: root validate: "/usr/sbin/visudo -cf %s" ## Nginx - name: Install nginx yum: name=nginx state=present - name: Autostart nginx command: chkconfig nginx on - name: Copy nginx config - template: src=phabricator.conf dest=/etc/nginx/conf.d/phabricator.conf + template: src=nginx-phabricator.conf dest=/etc/nginx/conf.d/phabricator.conf notify: restart nginx # PHP CGI - name: Autostart php-fpm command: chkconfig php-fpm on - name: Copy php.ini configuration template: src=php.ini dest=/etc/php.ini notify: restart php-fpm - name: Install APC shell: yes '' | pecl install apc; echo '' # SSH - name: SSH hook for phabricator template: src: phabricator_ssh_hook.sh dest: /usr/libexec/phabricator_ssh_hook.sh group: "{{ phd_user }}" mode: 0755 - name: SSHd config for phabricator template: src: phabricator_sshd_config dest: /etc/ssh/sshd_config.phabricator mode: 0640 - name: SSHd systemd service for phabricator template: src: phabricator_sshd_init dest: /usr/lib/systemd/system/sshd_phabricator.service mode: 0640 notify: restart sshd_phabricator ## Phabricator # Source: https://github.com/relrod/phabricator-ansible - 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 facebook/libphutil git: repo=https://github.com/facebook/libphutil.git dest=/srv/www/facebook/libphutil sudo_user: "{{ phd_user }}" - name: Clone facebook/arcanist git: repo=https://github.com/facebook/arcanist.git dest=/srv/www/facebook/arcanist sudo_user: "{{ phd_user }}" - name: Clone facebook/phabricator to {{ phabricator_path }} git: repo=https://github.com/facebook/phabricator.git dest=/srv/www/facebook/phabricator sudo_user: "{{ phd_user }}" - name: Create a conf/custom directory. file: state=directory path={{ phabricator_path }}/conf/custom sudo_user: "{{ phd_user }}" - name: Place a starting-point custom config in {{ phabricator_path }}conf/custom/myconfig.conf.php - template: src=myconfig.conf.php dest={{ phabricator_path }}conf/custom/myconfig.conf.php + template: src=phabricator_myconfig.conf.php dest={{ phabricator_path }}conf/custom/myconfig.conf.php sudo_user: "{{ phd_user }}" - name: Include the config shell: echo 'custom/myconfig' > {{ phabricator_path }}conf/local/ENVIRONMENT sudo_user: "{{ phd_user }}" - name: Migrate the database command: chdir={{ phabricator_path }} ./bin/storage upgrade --force sudo_user: "{{ phd_user }}" - name: Create the repository directory file: state=directory path="{{ repositories_path }}" owner="{{ phd_user }}" group="{{ phd_user }}" - name: Mount NFS share mount: name: "{{ repositories_path }}" src: "{{ hostvars['127.0.0.1']['openstackjump']['private_ip'][0] }}:{{ repositories_path }}" fstype: 'nfs' opts: 'auto' state: 'mounted' ## Application - name: Start PHD daemons command: chdir={{ phabricator_path }} ./bin/phd restart sudo_user: "{{ phd_user }}" diff --git a/templates/phabricator.conf b/templates/nginx-phabricator.conf similarity index 100% rename from templates/phabricator.conf rename to templates/nginx-phabricator.conf diff --git a/templates/myconfig.conf.php b/templates/phabricator_myconfig.conf.php similarity index 100% rename from templates/myconfig.conf.php rename to templates/phabricator_myconfig.conf.php