From 2bb29965bdfeb90376b69f394acd36f612fd7d88 Mon Sep 17 00:00:00 2001 From: Salt Date: Fri, 11 Oct 2019 16:37:18 -0500 Subject: [PATCH] Reorganize user salt creation This now allows for easier home directory imports Gonna whip up a playbook to initialize a fresh Ubuntu install on my workstations --- roles/user/tasks/main.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/roles/user/tasks/main.yml b/roles/user/tasks/main.yml index 1c0f755..fe53327 100644 --- a/roles/user/tasks/main.yml +++ b/roles/user/tasks/main.yml @@ -37,11 +37,17 @@ key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDyOzdOFNONNhr++/2L3iSN04JsLwYHkapslDMEImI0x4chvdfdA9OkEOZHP5EoMUG6uWL3xZZdQ9Egp931oHDc4W5ylPQ1VtqQ2vcyffCfBTOEaUeEgw2tHBDngMqBgTajMSFvTbaC7JNSIdcGP1KTCCYZ3f8DPjVmG8FAKq1kDnCyI4sXHQswi/AbIBrOsWSW+qjrQdD/jU7T2LPQbU9FB+afinDizhGXUzkmbRkOD5z/YsyrWDfaKhGS4EwJpZbEwT7ocnCaQSa74xYLwUlBONhg3u2wq00mrh7vc2WbeGB7VoCsojPIj5r6KoCKzRBVog2HLQ4W7QqfSW/nXR21 salt@iridium" become: yes become_user: salt +- name: Check for dotfile initialization + stat: path=$HOME/.dotfiles + register: p + become: yes + become_user: salt - name: Configure git SSH substitute for GitHub git_config: name: url."https://github.com/".insteadOf value: "git@github.com:" scope: global + when: not p.stat.exists become: yes become_user: salt - name: Configure git SSH substitute for GitLab @@ -49,11 +55,7 @@ name: url."https://gitlab.com/".insteadOf value: "git@gitlab.com:" scope: global - become: yes - become_user: salt -- name: Check for dotfile initialization - stat: path=$HOME/.dotfiles - register: p + when: not p.stat.exists become: yes become_user: salt - name: Clone bootstrap script @@ -71,6 +73,15 @@ when: not p.stat.exists become: yes become_user: salt +- name: Disable untracked files on dotfiles + git_config: + name: status.showUntrackedFiles + value: "no" + scope: local + repo: ~/.dotfiles + when: not p.stat.exists + become: yes + become_user: salt - name: Remove bootstrap script directory file: path: ~/bootstrap @@ -78,11 +89,3 @@ when: not p.stat.exists become: yes become_user: salt -- name: Disable untracked files on dotfiles - git_config: - name: status.showUntrackedFiles - value: "no" - scope: local - repo: ~/.dotfiles - become: yes - become_user: salt