From 72e1527399880eb9800a52653fd635c968d4be35 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 15 May 2018 20:16:50 +0800 Subject: git: remove some obsolete settings --- roles/git/tasks/main.yml | 82 ++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 48 deletions(-) (limited to 'roles') diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index caf04f8..ebd2ef3 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -34,54 +34,6 @@ -c "Git Repositories Owner" when: pw_cmd.rc != 0 -- name: generate vars.conf file - template: - src: vars.conf.j2 - dest: "{{ git.user.home }}/vars.conf" - -- name: copy git-shell commands - copy: - src: git-shell-commands/ # trailing '/' -> directory contents - dest: "{{ git.user.home }}/git-shell-commands/" - mode: 0755 - -- name: (local) github sync - check ssh key existence - become: false - stat: - path: "{{ git.github.keyfile }}" - delegate_to: localhost - register: stat_result - -- name: (local) github sync - generate new ssh key pair - become: false - command: > - ssh-keygen -t ed25519 -C "git:github-sync" -N "" - -f "{{ git.github.keyfile }}" - delegate_to: localhost - when: not stat_result.stat.exists - -- name: github sync - create .ssh directory on the server - file: - path: "{{ git.user.home }}/.ssh" - state: directory - owner: "{{ git.user.name }}" - group: "{{ git.user.name }}" - mode: 0700 - -- name: github sync - copy public key to the server - copy: - src: "{{ git.github.keyfile }}" - dest: "{{ git.user.home }}/.ssh/id_{{ git.github.keytype }}" - owner: "{{ git.user.name }}" - mode: 0400 - -- name: create directory for linking public repos - file: - path: "{{ git.user.home }}/{{ git.public_dir }}" - state: directory - owner: "{{ git.user.name }}" - group: "{{ git.user.name }}" - # # gitolite # @@ -137,6 +89,40 @@ delegate_to: localhost tags: gitolite +# +# Github sync +# + +- name: (local) github sync - check ssh key existence + become: false + stat: + path: "{{ git.github.keyfile }}" + delegate_to: localhost + register: stat_result + +- name: (local) github sync - generate new ssh key pair + become: false + command: > + ssh-keygen -t ed25519 -C "git:github-sync" -N "" + -f "{{ git.github.keyfile }}" + delegate_to: localhost + when: not stat_result.stat.exists + +- name: github sync - create .ssh directory on the server + file: + path: "{{ git.user.home }}/.ssh" + state: directory + owner: "{{ git.user.name }}" + group: "{{ git.user.name }}" + mode: 0700 + +- name: github sync - copy public key to the server + copy: + src: "{{ git.github.keyfile }}" + dest: "{{ git.user.home }}/.ssh/id_{{ git.github.keytype }}" + owner: "{{ git.user.name }}" + mode: 0400 + # # cgit # -- cgit v1.2.2