aboutsummaryrefslogblamecommitdiffstats
path: root/roles/git/tasks/main.yml
blob: 4d2b74ee8b146800c60c4c3fbba79c85a648e3ab (plain) (tree)












































                                                                 
- name: install git package
  package:
    name: git
    state: present

- name: create git group
  group:
    name: "{{ git_group }}"
    state: present

- name: create git user
  user:
    name: "{{ git_user }}"
    group: "{{ git_group }}"
    shell: "{{ git_shell }}"
    home: "{{ git_dir }}"
    create_home: false

- name: create git directories
  file:
    path: "{{ item }}"
    owner: "{{ git_user }}"
    group: "{{ git_group }}"
    state: directory
    mode: 0755
  loop:
    - "{{ git_dir }}"
    - "{{ git_dir }}/git-shell-commands"

- name: generate git-shell no-login prompt
  template:
    src: no-interactive-login.j2
    dest: "{{ git_dir }}/git-shell-commands/no-interactive-login"
    owner: "{{ git_user }}"
    group: "{{ git_group }}"
    mode: "0744"
  when: not git_allow_ssh_login

- name: generate gitconfig
  template:
    src: gitconfig.j2
    dest: "{{ git_dir }}/.gitconfig"
    owner: "{{ git_user }}"
    group: "{{ git_group }}"
    mode: 0644
remember that computers suck.