aboutsummaryrefslogblamecommitdiffstats
path: root/roles/git/tasks/main.yml
blob: 28c1cbf0e5fd354d22071f5f3f89d93d4a86d746 (plain) (tree)
1
2
3
4
5
6
7
8
9

   
                           
                          



                        
                        



                           
                       






                              
                       









                                          
                           







                                                                 
                           




                                    

                                       
                               

                                    
---

- name: install git package
  ansible.builtin.package:
    name: git
    state: present

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

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

- name: create git directories
  ansible.builtin.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
  ansible.builtin.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
  ansible.builtin.template:
    src: gitconfig.j2
    dest: "{{ git_dir }}/.gitconfig"
    owner: "{{ git_user }}"
    group: "{{ git_group }}"
    mode: 0644

- name: include ssh key synchronization
  ansible.builtin.include_role:
    name: sshd
    tasks_from: synchronize_keys.yml
remember that computers suck.