aboutsummaryrefslogtreecommitdiffstats
path: root/roles/setup_git/tasks/main.yml
blob: b2b2d7341060d3cac580f856c05c3c7c1143b304 (plain) (blame)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

# =========================================================================== #
#                   __                _ __ 
#       _________  / /__       ____ _(_) /_
#      / ___/ __ \/ / _ \     / __ `/ / __/
#     / /  / /_/ / /  __/    / /_/ / / /_  
#    /_/   \____/_/\___(_)   \__, /_/\__/  
#                           /____/
#
# =========================================================================== #

---
- name: Check installation of git
  package:
    name: git
    state: present

- name: Add group git
  user:
    name: "{{ git_group }}"
    state: present

- name: Add user git
  user:
    name: "{{ git_user }}"
    comment: "{{ git_user_comment }}"
    group: "{{ git_group }}"

- name: Set up multiple authorized keys
  authorized_key:
    user: "{{ git_user }}"
    state: present
    key: "{{ item }}"
  with_file:
    - "{{ playbook_dir }}/files/pub_ssh/WS-bentonite"
    - "{{ playbook_dir }}/files/pub_ssh/LP-graphite"

- name: Create git directory
  file:
    path: "{{ git_directory_path }}"
    state: directory
    owner: "{{ git_user }}"
    group: "{{ git_group }}"
    mode: 0755
    recurse: True

remember that computers suck.