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





                                 
                                     


                  

                               
        
                           

                  
                              
       

                            
                            
                         

                      
                                    
       
                      


                            



                                        



                                          
                                                                 

                            
                
                                              












                                    

# git ~~ roles/git/tasks/main.yml
# Init git user and settings

---

- name: ensure git package is present
  package:
    name: git
    state: present

- name: ensure git group exists
  group:
    name: "{{ git_group }}"
    state: present

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

- name: ensure git directories exist
  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: git_nologin is defined and git_nologin

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

- name: synchronize ssh key
  include_role:
    name: sshd
    tasks_from: sync_keys
remember that computers suck.