Use git repositories as source

main
Nils Gerstner 2 years ago
parent 69e55a3fcb
commit f3e4b1dbc0

@ -1,6 +1,6 @@
#!/usr/bin/bash
SUDO="sudo"
WORKDIR="/tmp/ansible"
WORKDIR="/tmp/ansible_setup"
if [ "$(whoami)" == "root" ]; then
SUDO=""
@ -14,9 +14,13 @@ fail() {
if ! which ansible-playbook; then
${SUDO} apt update
${SUDO} apt install -y ansible || fail "Failed to install ansible!"
${SUDO} apt install -y ansible wget || fail "Failed to install ansible!"
fi
cd /tmp
wget https://git.gerstner.se/nils/ansible_setup/archive/main.zip
unzip main.zip
cd ${WORKDIR} || fail "Could not change to work directory!"
ansible-playbook local.yml || fail "Failed to execute ansible playbook"
# ansible-playbook all.yml || fail "Failed to execute ansible playbook"

@ -30,31 +30,32 @@
- dotfiles
- productivity
# - name: Clone the dotfiles repository
# git:
# repo: https://gitlab.com/bhavin192/dotfiles.git
# dest: ~/dotfiles
# when: st.stat.islnk is not defined
# tags:
# - install
# - dotfiles
# - productivity
- name: Move dotfiles to dest folder
ansible.builtin.copy:
src: /tmp/ansible/dotfiles
dest: ~/
remote_src: yes
owner: root
group: root
# mode: u+rw,g-wx,o-rwx
# validate: /usr/sbin/visudo -csf %s
- name: Clone the dotfiles repository
git:
repo: https://git.gerstner.se/nils/ansible_dotfiles.git
dest: ~/dotfiles
when: st.stat.islnk is not defined
tags:
- git
- install
- dotfiles
- productivity
# - name: Move dotfiles to dest folder
# ansible.builtin.copy:
# src: /tmp/ansible/dotfiles
# dest: ~/
# remote_src: yes
# owner: root
# group: root
# # mode: u+rw,g-wx,o-rwx
# # validate: /usr/sbin/visudo -csf %s
# tags:
# - git
# - install
# - dotfiles
# - productivity
- name: Stow the dotfiles
shell: |
stow --verbose 2 --dir "${HOME}/dotfiles" --target "${HOME}" .

Loading…
Cancel
Save