diff --git a/roles/internal/theyvoteforyou/tasks/main.yml b/roles/internal/theyvoteforyou/tasks/main.yml index 2d8e00e6..60751659 100644 --- a/roles/internal/theyvoteforyou/tasks/main.yml +++ b/roles/internal/theyvoteforyou/tasks/main.yml @@ -265,9 +265,9 @@ notify: nginx reload - name: Allow deploy user to control application services - copy: + template: src: theyvoteforyou_foreman - dest: /etc/sudoers.d/ + dest: /etc/sudoers.d/theyvoteforyou_foreman mode: '0440' validate: visudo -cf %s # notify: sudo reload diff --git a/roles/internal/theyvoteforyou/templates/theyvoteforyou_foreman b/roles/internal/theyvoteforyou/templates/theyvoteforyou_foreman index ff8a5eac..028d9285 100644 --- a/roles/internal/theyvoteforyou/templates/theyvoteforyou_foreman +++ b/roles/internal/theyvoteforyou/templates/theyvoteforyou_foreman @@ -1,5 +1,6 @@ # TODO: Delete the line below as soon as it isn't necessary deploy ALL = NOPASSWD: {{ bundle_path }} exec foreman export * +deploy ALL = NOPASSWD: /usr/local/rvm/bin/rvm . do bundle exec foreman export * deploy ALL = NOPASSWD: /bin/systemctl enable theyvoteforyou-staging.target deploy ALL = NOPASSWD: /bin/systemctl enable theyvoteforyou-production.target deploy ALL = NOPASSWD: /bin/systemctl enable theyvoteforyou-development.target