Jakub Sokołowski f96fe517e7
beacon-node-builds: allow staff group membets to start builds
I was thinking of defining the jobs as nimbus user systemd units, but
that would not work unless nimbus user logged in at least once.

And Systemd services have no functionality for allowing non-root users
to start/stop/restart system services, so sudo is the simplest way.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2021-02-08 12:36:02 +01:00

27 lines
756 B
YAML

---
- name: Create user for beacon node builds
user:
name: '{{ beacon_node_builds_user }}'
group: '{{ beacon_node_builds_group }}'
groups: ['docker']
shell: '/bin/zsh'
- name: Set disable rebase as merge strategy
git_config:
scope: 'global'
name: 'pull.rebase'
value: false
become_user: '{{ beacon_node_builds_user }}'
- name: Configure access to Docker Hub
docker_login:
username: '{{ beacon_node_builds_docker_hub_user | mandatory }}'
password: '{{ beacon_node_builds_docker_hub_token | mandatory }}'
become_user: '{{ beacon_node_builds_user }}'
- name: Sudoers file to let non-root users start jobs
template:
src: 'builds_sudoers.j2'
dest: '/etc/sudoers.d/80-beacon-node-builds'
mode: 0440