Find my latest work and links to my YouTube, Twitter, etc. on my website: www.jeffgeerling.com.
If you like my work and want me to be able to keep improving it, please sponsor me on GitHub.
Ansible Role - Easy and flexible dotfile installation.
Home Page: https://galaxy.ansible.com/geerlingguy/dotfiles/
License: MIT License
Find my latest work and links to my YouTube, Twitter, etc. on my website: www.jeffgeerling.com.
If you like my work and want me to be able to keep improving it, please sponsor me on GitHub.
Hi,
do you think it would make sense to add a variable that defines which private key the ansible-git-module should use when accessing github?
This is only necessary for people who like to or have to use different ssh keys.
Adding key_file: ...
to the "Ensure dotfiles repository is cloned locally."-task does the trick for me.
having this as a variable seems useful. If you agree I would create a PR.
Allow a force override for repos if needed. I have a tasks that adds a section to a dotfile. This section does not need to be kept in the repo as it varies for each person.
I'll open up a PR later, this should be solvable with:
- name: Ensure dotfile directories exist.
file:
path: "{{ (dotfiles_home + '/' + item)|dirname }}"
state: directory
become: no
with_items: "{{ dotfiles_files }}"
nvim requires a dot file in ~/.config/nvim/init.vim
.
I like to keep my dotfiles without the leading dot in my git repository. It would be nice if this role could handle this when creating the links, so for example vimrc
in the git repo should be linked to ~/.vimrc
.
Some configs can be spread across multiple files in a folder. For example, neovim configs can consist an init.vim
or init.lua
and multiple other .vim
or .lua
files. It would be useful if we can track the entire folder with a wildcard:
dotfiles_files:
- .config/nvim/*
If the dot files repo doesn't have a master branch it will fail with:
TASK [geerlingguy.dotfiles : Ensure dotfiles repository is cloned locally.] *****************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "/usr/local/bin/git checkout --force master", "msg": "Failed to checkout master", "rc": 1, "stderr": "error: pathspec 'master' did not match any file(s) known to git\n", "stderr_lines": ["error: pathspec 'master' did not match any file(s) known to git"], "stdout": "", "stdout_lines": []}
The easiest solution is to just add a branch master to the repo.
That was good enough for me, so just adding the issue and closing for others if needed to reference or if someone wanted to add the feature.
Obviously, this needs to be updated....
[DEPRECATION WARNING]: always_run is deprecated. Use check_mode = no instead..
This feature will be removed in version 2.4. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
The specific section is:
- name: Ensure all configured dotfiles are links.
shell: "ls -F {{ dotfiles_home }}/{{ item }}"
register: existing_dotfile_info
failed_when: false
always_run: yes
changed_when: false
with_items: "{{ dotfiles_files }}"
I have the same issue that was reported in #24, are you accepting pull requests for this issue? @geerlingguy
For example, dotfiles_repo_local_destination
could base on xdg-user-dir DOCUMENTS
I use this role as part of https://github.com/geerlingguy/mac-dev-playbook
So, here's my dotfiles directory before running the role:
14:27:43 ~/Documents/dotfiles $ git status
On branch henning
Your branch is up-to-date with 'origin/henning'.
nothing to commit, working tree clean
14:27:50 ~/Documents/dotfiles $ git log --max-count 1
commit 464510cda7f29fce31ae8bf88956533bea634303
Author: Henning Sprang <[email protected]>
Date: Mon May 29 14:18:28 2017 +0100
make some more adjustments
Then I run this role as part of the mac-development-playbook.
It does something like this:
TASK [geerlingguy.dotfiles : Ensure dotfiles repository is cloned locally.] ****
changed: [127.0.0.1]
So it changes the local clone nevertheless that this already exists and is perfectly up to date.
After this I have:
14:31:28 ~/Documents/dotfiles $ git status
On branch henning
Your branch is behind 'origin/henning' by 5 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
14:31:30 ~/Documents/dotfiles $ git log --max-count 1
commit cbb4d5508de7e7247cac88dec96e9ba870218547
Author: Henning Sprang <[email protected]>
Date: Sat Apr 29 02:33:37 2017 +0200
update homebrew github token
and my links to config files point to ourdated old versions. Which I do not want.
I'd expect the
Hi, trying to symlink my .bash_profile
is throwing an error in the task Link dotfiles into home folder in the second execution:
refusing to convert between file and link for /home/vagrant/.bash_profile
Adding force=true
would fix the issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.