Always set up the ARA systemd unit file
The idea is to make sure that the ARA systemd service is always configured so that the service can be started/stopped/disabled without needing to carry logic for configuring the unit file and reloading systemctl all over the place. Change-Id: Iadfeb0acadbb9803305abde8cface2e4104f0609
This commit is contained in:
parent
a296583c1a
commit
c51366f722
|
@ -16,31 +16,9 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with ARA. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
- name: Get the location of ara-manage
|
||||
command: which ara-manage
|
||||
environment:
|
||||
PATH: "{{ path_with_virtualenv | default(omit) }}"
|
||||
register: ara_manage
|
||||
changed_when: false
|
||||
|
||||
- name: Copy systemd service template
|
||||
become: true
|
||||
template:
|
||||
src: templates/ara_service.conf.j2
|
||||
dest: /etc/systemd/system/ara.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify:
|
||||
- reload systemctl daemon
|
||||
- restart ara
|
||||
|
||||
- name: Flush handlers
|
||||
meta: flush_handlers
|
||||
|
||||
- name: Ensure the embedded server service is started and enabled
|
||||
become: true
|
||||
systemd:
|
||||
service:
|
||||
name: ara
|
||||
state: started
|
||||
enabled: yes
|
||||
|
|
|
@ -59,6 +59,28 @@
|
|||
src: logrotate.conf.j2
|
||||
dest: /etc/logrotate.d/ara
|
||||
|
||||
- name: Get the location of ara-manage
|
||||
command: which ara-manage
|
||||
environment:
|
||||
PATH: "{{ path_with_virtualenv | default(omit) }}"
|
||||
register: ara_manage
|
||||
changed_when: false
|
||||
|
||||
- name: Copy systemd service template
|
||||
become: true
|
||||
template:
|
||||
src: templates/ara_service.conf.j2
|
||||
dest: /etc/systemd/system/ara.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify:
|
||||
- reload systemctl daemon
|
||||
- restart ara
|
||||
|
||||
- name: Flush handlers
|
||||
meta: flush_handlers
|
||||
|
||||
- name: Include web server configuration
|
||||
include_tasks: "{{ ara.deployment.server }}/{{ ara.deployment.type }}.yml"
|
||||
|
||||
|
|
Loading…
Reference in New Issue