- name: Install git community.general.openbsd_pkg: name: "{{ git_packages }}" state: present - name: Create git user ansible.builtin.user: name: "{{ git_user }}" home: "{{ git_home }}" shell: /usr/local/bin/git-shell system: true - name: Create git home directory ansible.builtin.file: path: "{{ git_home }}" state: directory owner: "{{ git_user }}" group: "{{ git_user }}" mode: "0755" - name: Silence message of the day for git user ansible.builtin.file: path: "{{ git_home }}/.hushlogin" state: touch owner: "{{ git_user }}" group: "{{ git_user }}" mode: "0644" - name: Create .ssh directory ansible.builtin.file: path: "{{ git_home }}/.ssh" state: directory owner: "{{ git_user }}" group: "{{ git_user }}" mode: "0700" - name: Deploy authorized_keys ansible.builtin.copy: content: "{{ git_authorized_keys | join('\n') }}\n" dest: "{{ git_home }}/.ssh/authorized_keys" owner: "{{ git_user }}" group: "{{ git_user }}" mode: "0600" - name: Create git-shell-commands directory ansible.builtin.file: path: "{{ git_home }}/git-shell-commands" state: directory owner: "{{ git_user }}" group: "{{ git_user }}" mode: "0755" - name: Deploy git-shell create-repo helper script ansible.builtin.copy: src: git-shell-commands/create dest: "{{ git_home }}/git-shell-commands/create" owner: "{{ git_user }}" group: "{{ git_user }}" mode: "0755"