- name: Install Nginx
include: nginx.yml
when: use_nginx
+- name: Install Service Files
+ include: services.yml
+ when: use_service_files
- name: Starting Services
include: start.yml
when: start_services
--- /dev/null
+# TODO: 'Before' and 'After' reflect a single-server setup.
+# Make these configurable for cases where certain services
+# (e.g. memcache) are not run on the same machine.
+
+[Unit]
+Description=Open Service Request Framework
+After=ejabberd.service memcached.service
+Before=apache2.service apache2-websockets.service
+Requries=memcached.service
+BindsTo=ejabberd.service
+
+[Service]
+User=opensrf
+Group=opensrf
+Type=oneshot
+RemainAfterExit=yes
+Environment=PATH=/openils/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+Environment=LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH
+#ExecStartPre=/bin/sleep 5
+ExecStart=/openils/bin/osrf_control -l --start-all
+#ExecStartPost=/bin/sleep 10
+#ExecStartPost=-/bin/systemctl restart apache2.service
+#ExecStartPost=-/bin/systemctl restart apache2-websockets.service
+ExecStop=/openils/bin/osrf_control -l --stop-all
+
+#[Install]
+#WantedBy=multi-user.target
+#Alias=opensrf.service
+
--- /dev/null
+- name: Install OpenSRF Service File
+ become: true
+ template:
+ src: extras/service_files/opensrf.service.j2
+ dest: /lib/systemd/system/opensrf.service
+ owner: root
+ group: root
+ mode: 0644
+- name: Reload Systemd Configs
+ become: true
+ shell: systemctl daemon-reload
# Install and configure NGINX proxy
use_nginx: true
+# Install systemd service files and use them to stop/start services
+use_service_files: true
+
# Start Evergreen services when the install is complete.
start_services: true