Add option to use https/ssh git repositories
This commit is contained in:
parent
0d13709bb0
commit
8df370f630
@ -22,3 +22,14 @@
|
|||||||
vars:
|
vars:
|
||||||
desktop_src_dir: "{{ ansible_user_dir }}/src/desktop"
|
desktop_src_dir: "{{ ansible_user_dir }}/src/desktop"
|
||||||
arch_src_dir: "{{ ansible_user_dir }}/src/arch"
|
arch_src_dir: "{{ ansible_user_dir }}/src/arch"
|
||||||
|
git_repos:
|
||||||
|
ssh:
|
||||||
|
dwm: ssh://git@git.grondek.dev:2222/pgrondek/dwm.git
|
||||||
|
dotfiles: ssh://git@git.grondek.dev:2222/pgrondek/dotfiles.git
|
||||||
|
polybar: ssh://git@git.grondek.dev:2222/pgrondek/polybar-dwm.git
|
||||||
|
st: ssh://git@git.grondek.dev:2222/pgrondek/stterm.git
|
||||||
|
https:
|
||||||
|
dwm: https://git.grondek.dev/pgrondek/dwm.git
|
||||||
|
dotfiles: https://git.grondek.dev/pgrondek/dotfiles.git
|
||||||
|
polybar: https://git.grondek.dev/pgrondek/polybar-dwm.git
|
||||||
|
st: https://git.grondek.dev/pgrondek/stterm.git
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: checkout dotfiles
|
- name: checkout dotfiles
|
||||||
git:
|
git:
|
||||||
repo: "{{ dotfiles.repo }}"
|
repo: "{{ git.dotfiles }}"
|
||||||
dest: "{{ desktop_src_dir }}/dotfiles"
|
dest: "{{ desktop_src_dir }}/dotfiles"
|
||||||
clone: yes
|
clone: yes
|
||||||
update: yes
|
update: yes
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
dotfiles:
|
|
||||||
repo: ssh://git@git.grondek.dev:2222/pgrondek/dotfiles.git
|
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
- name: checkout dwm
|
- name: checkout dwm
|
||||||
git:
|
git:
|
||||||
repo: "{{ dwm.repo }}"
|
repo: "{{ git.dwm }}"
|
||||||
dest: "{{ desktop_src_dir }}/dwm"
|
dest: "{{ desktop_src_dir }}/dwm"
|
||||||
clone: yes
|
clone: yes
|
||||||
update: yes
|
update: yes
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
- name: "polybar: checkout"
|
- name: "polybar: checkout"
|
||||||
git:
|
git:
|
||||||
repo: "{{ polybar.repo }}"
|
repo: "{{ git.polybar }}"
|
||||||
dest: "{{ desktop_src_dir }}/polybar"
|
dest: "{{ desktop_src_dir }}/polybar"
|
||||||
clone: yes
|
clone: yes
|
||||||
update: yes
|
update: yes
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
- name: checkout st
|
- name: checkout st
|
||||||
git:
|
git:
|
||||||
repo: "{{ st.repo }}"
|
repo: "{{ git.st }}"
|
||||||
dest: "{{ desktop_src_dir }}/stterm"
|
dest: "{{ desktop_src_dir }}/stterm"
|
||||||
clone: yes
|
clone: yes
|
||||||
update: yes
|
update: yes
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
dwm:
|
|
||||||
repo: ssh://git@git.grondek.dev:2222/pgrondek/dwm.git
|
|
||||||
st:
|
|
||||||
repo: ssh://git@git.grondek.dev:2222/pgrondek/stterm.git
|
|
||||||
dwmstatus:
|
|
||||||
repo: https://git.grondek.dev/pgrondek/dwmstatus.git
|
|
||||||
polybar:
|
|
||||||
repo: ssh://git@git.grondek.dev:2222/pgrondek/polybar-dwm.git
|
|
14
roles/prepare/tasks/git-repos.yml
Normal file
14
roles/prepare/tasks/git-repos.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
- name: Check if ssh keys exists
|
||||||
|
stat:
|
||||||
|
path: "{{ ansible_user_dir }}/.ssh/id_rsa"
|
||||||
|
register: ssh_key
|
||||||
|
|
||||||
|
- name: Use SSH repositories
|
||||||
|
set_fact:
|
||||||
|
git: "{{ git_repos.ssh }}"
|
||||||
|
when: ssh_key.stat.exists
|
||||||
|
|
||||||
|
- name: Use HTTPS repositories
|
||||||
|
set_fact:
|
||||||
|
git: "{{ git_repos.https }}"
|
||||||
|
when: not ssh_key.stat.exists
|
@ -4,3 +4,5 @@
|
|||||||
|
|
||||||
- import_tasks: arch.yml
|
- import_tasks: arch.yml
|
||||||
when: ansible_distribution == "Archlinux"
|
when: ansible_distribution == "Archlinux"
|
||||||
|
|
||||||
|
- import_tasks: git-repos.yml
|
||||||
|
Loading…
Reference in New Issue
Block a user