Skip to content

Commit 380b9b3

Browse files
committed
deploy.yml: use raw module for managing service.
With service module deploy failed with error: sudo: a password is required Correction for 7a84086 commit. Addressed to #399
1 parent 7a84086 commit 380b9b3

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/main/scripts/ci/ansible/deploy.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,10 @@
3333
state: paused
3434
when: uptimerobot is defined and uptimerobot.monitorid != '' and uptimerobot.apikey != ''
3535

36+
# we can't use service module here because our sudoers allows to execute only exact commands
3637
- name: Stopping service
37-
service:
38-
name: mystamps
39-
state: stopped
40-
become: yes
41-
become_user: root
42-
become_method: sudo
38+
raw:
39+
sudo systemctl stop mystamps
4340

4441
- name: Copying WAR file
4542
copy:
@@ -50,13 +47,10 @@
5047
mode: '0755'
5148
backup: yes
5249

50+
# we can't use service module here because our sudoers allows to execute only exact commands
5351
- name: Starting service
54-
service:
55-
name: mystamps
56-
state: started
57-
become: yes
58-
become_user: root
59-
become_method: sudo
52+
raw:
53+
sudo systemctl start mystamps
6054

6155
- name: Starting monitoring
6256
uptimerobot:

0 commit comments

Comments
 (0)