Skip to content

Commit 7a84086

Browse files
committed
Unbreak deploy by allowing to mystamps user to manage the service.
Before deploy.sh failed with error: Failed to stop mystamps.service: Interactive authentication required Addressed to #399
1 parent 801073a commit 7a84086

File tree

2 files changed

+14
-1
lines changed
  • src/main/scripts/ci/ansible
  • vagrant/provisioning/roles/mystamps-app/tasks

2 files changed

+14
-1
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
service:
3838
name: mystamps
3939
state: stopped
40+
become: yes
41+
become_user: root
42+
become_method: sudo
4043

4144
- name: Copying WAR file
4245
copy:
@@ -50,8 +53,10 @@
5053
- name: Starting service
5154
service:
5255
name: mystamps
53-
enabled: yes
5456
state: started
57+
become: yes
58+
become_user: root
59+
become_method: sudo
5560

5661
- name: Starting monitoring
5762
uptimerobot:

vagrant/provisioning/roles/mystamps-app/tasks/main.yml

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
---
22

3+
- name: Granting to mystamps to manage the service
4+
copy:
5+
content: "mystamps my-stamps.ru=(root) NOPASSWD: /bin/systemctl stop mystamps,/bin/systemctl start mystamps,/bin/systemctl restart mystamps\n"
6+
dest: /etc/sudoers.d/10_mystamps
7+
owner: root
8+
group: root
9+
mode: '0440'
10+
311
- name: Uploading mystamps.war to a server
412
copy:
513
src: ../../target/mystamps.war

0 commit comments

Comments
 (0)