diff options
Diffstat (limited to 'roles/git/tasks')
-rw-r--r-- | roles/git/tasks/main.yml | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 5600e2d..a421ad0 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -5,7 +5,9 @@ --- - name: ensure git package is present - package: name=git state=present + package: + name: git + state: present - name: ensure git group exists group: @@ -17,43 +19,38 @@ name: "{{ git_user }}" group: "{{ git_group }}" shell: "{{ git_shell }}" - home: "/home/{{ git_user }}" + home: "{{ git_dir }}" create_home: false -- name: ensure git home directory is not created - file: path="/home/{{ git_user }}" state=absent - -- name: ensure git-only directory exists - file: - path: "{{ git_dir }}" - owner: "{{ git_user }}" - group: "{{ git_group }}" - state: directory - mode: 0755 - -- name: link git user home directory with git root repository - file: - src: "{{ git_dir }}" - dest: "/home/{{ git_user }}" - owner: "{{ git_user }}" - group: "{{ git_group }}" - mode: 0750 - force: true - state: link - -- name: ensure git-shell-commands directory exists +- name: ensure git directories exist file: - path: "/home/{{ git_user }}/git-shell-commands" + path: "{{ item }}" owner: "{{ git_user }}" group: "{{ git_group }}" state: directory - mode: 0755 + mode: "0755" + loop: + - "{{ git_dir }}" + - "{{ git_dir }}/git-shell-commands" - name: generate git-shell no-login prompt template: src: no-interactive-login.j2 - dest: "/home/{{ git_user }}/git-shell-commands/no-interactive-login" + dest: "{{ git_dir }}/git-shell-commands/no-interactive-login" owner: "{{ git_user }}" group: "{{ git_group }}" - mode: 0744 + 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 |