diff options
author | Aaron LI <aly@aaronly.me> | 2018-05-15 20:16:50 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-05-15 20:16:50 +0800 |
commit | 72e1527399880eb9800a52653fd635c968d4be35 (patch) | |
tree | 93d836635f51e23fc3923319839f0a265a0863a7 /roles/git/tasks | |
parent | bbfac4101eaaa27a053560cb9cadfe5e807c12da (diff) | |
download | ansible-dfly-vps-72e1527399880eb9800a52653fd635c968d4be35.tar.bz2 |
git: remove some obsolete settings
Diffstat (limited to 'roles/git/tasks')
-rw-r--r-- | roles/git/tasks/main.yml | 82 |
1 files changed, 34 insertions, 48 deletions
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 # @@ -138,6 +90,40 @@ 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 # |