diff options
author | Kelley Spoon <kelley.spoon@linaro.org> | 2018-04-11 16:26:06 -0500 |
---|---|---|
committer | Benjamin Copeland <ben.copeland@linaro.org> | 2018-04-12 07:54:43 +0000 |
commit | f4dfa237588b2fd8038d02ca25185baad6d4b405 (patch) | |
tree | cf494279be52a16bbe83e861d0458b5ebb0368ae | |
parent | 9f4443236acec84e711296833c1334a44451d32b (diff) |
Phabricator: Add systemd unit for phd and mail config
This changes ensures that the phd daemon will be
running through system after install and sets the
mailer to use the local sendmail facility.
Change-Id: Ifef240eb7f2c8c4489a96fe0eaa8e21e94816b3e
Reviewed-on: https://review.linaro.org/24661
Reviewed-by: Benjamin Copeland <ben.copeland@linaro.org>
-rw-r--r-- | roles/phabricator/handlers/main.yml | 7 | ||||
-rw-r--r-- | roles/phabricator/tasks/config.yml | 7 | ||||
-rw-r--r-- | roles/phabricator/tasks/main.yml | 6 | ||||
-rw-r--r-- | roles/phabricator/templates/phd.service | 13 |
4 files changed, 33 insertions, 0 deletions
diff --git a/roles/phabricator/handlers/main.yml b/roles/phabricator/handlers/main.yml index ed6fede8..dd625718 100644 --- a/roles/phabricator/handlers/main.yml +++ b/roles/phabricator/handlers/main.yml @@ -1,3 +1,10 @@ --- - name: configure-phabricator import_tasks: config.yml + +- name: systemctl-enable-phd + systemd: + daemon_reload: yes + enabled: yes + name: phd + state: started diff --git a/roles/phabricator/tasks/config.yml b/roles/phabricator/tasks/config.yml index a649d070..e4ce07fc 100644 --- a/roles/phabricator/tasks/config.yml +++ b/roles/phabricator/tasks/config.yml @@ -19,3 +19,10 @@ command: ./bin/storage upgrade --force args: chdir: "{{phabricator_install_dir}}" + +- name: Install mailer config + command: ./bin/config set cluster.mailers '[{"key":"mailer","type":"sendmail"}]' + args: + chdir: "{{phabricator_install_dir}}" + + diff --git a/roles/phabricator/tasks/main.yml b/roles/phabricator/tasks/main.yml index 7dab1b9f..e57aefd3 100644 --- a/roles/phabricator/tasks/main.yml +++ b/roles/phabricator/tasks/main.yml @@ -91,3 +91,9 @@ login_password: "{{phabricator_mysql_root_password}}" state: present priv: '*.*:ALL' + +- name: Create phd systemctl service file + template: + src: phd.service + dest: /lib/systemd/system/phd.service + notify: systemctl-enable-phd diff --git a/roles/phabricator/templates/phd.service b/roles/phabricator/templates/phd.service new file mode 100644 index 00000000..b4ab91d1 --- /dev/null +++ b/roles/phabricator/templates/phd.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phabricator Daemons +After=syslog.target network.target mysql.service + +[Service] +Type=forking +User=root +WorkingDirectory={{phabricator_install_dir}} +ExecStart={{phabricator_install_dir}}/bin/phd start +ExecStop={{phabricator_install_dir}}/bin/phd stop --force + +[Install] +WantedBy=multi-user.target |