From 028182d93d02f65ddd98b0620ed84a88eb0b8594 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sat, 25 Jan 2020 05:05:07 +0500 Subject: [PATCH] Use git shell --- playbooks/deploy/git.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/playbooks/deploy/git.yml b/playbooks/deploy/git.yml index 25fab2c..49b2fe2 100644 --- a/playbooks/deploy/git.yml +++ b/playbooks/deploy/git.yml @@ -8,6 +8,13 @@ roles: - kotovalexarian.common tasks: + - name: Install system packages + apt: + name: + - cgit + - finger + - git + - name: Create system group group: name: git @@ -50,11 +57,14 @@ group: root mode: 'u=rw,g=r,o=r' - - name: Install system packages - apt: - name: - - cgit - - git + - name: Detect shell + shell: "/usr/bin/finger git | grep -oP 'Shell: \\K.*'" + register: detect_shell_result + changed_when: false + + - name: Use git shell + command: '/usr/bin/chsh git -s /usr/bin/git-shell' + when: detect_shell_result.stdout != '/usr/bin/git-shell' - name: Disable Apache configuration command: '/usr/sbin/a2disconf cgit'