summaryrefslogtreecommitdiff
path: root/roles/git_server_rpc/tasks/main.yaml
blob: a69e9e3b1a46e118b6b24c45e807b75217470cdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
- name: Create git_server_rpc user
  user: name=git_server_rpc
        home=/home/git_server_rpc

- name: Create git_server_rpc ssh dir
  file: path=/home/git_server_rpc/.ssh
        owner=git_server_rpc
        group=git_server_rpc
        mode=0700
        state=directory

- name: Make sure sudo is installed
  apt: name=sudo state=present update_cache=yes

- name: Configure git_server_rpc sudo rights
  template: dest=/etc/sudoers.d/git_server_rpc
            mode=0440
            src=git_server_rpc.sudoers

- name: Read git user ssh-key
  slurp: src=/var/lib/gitolite/.ssh/id_rsa.pub
  register: git_server_key
  delegate_to: "{{groups['gitservers'][0]}}"

- name: Put pubkey from gitserver to authorized_keys
  copy: dest=/home/git_server_rpc/.ssh/authorized_keys
        content="{{git_server_key.content|b64decode}}"
        owner=git_server_rpc
        group=git_server_rpc
        mode=0644