radek_sprta.dotfiles
Ansible Role: Dotfiles
This Ansible role installs a collection of dotfiles from a specified Git repository. By default, it installs my (Radek Sprta's) dotfiles, but you can use any dotfiles you prefer, as long as they follow the usual format.
Requirements
You need to have git
installed on the managed machine (you can install it easily with geerlingguy.git
if needed).
Role Variables
Here are the available variables with their default values (see defaults/main.yml
):
dotfiles_recursive
: true
Clone recursively including submodules.dotfiles_repo
: "https://gitlab.com/radek-sprta/dotfiles.git"
The Git repository to use for fetching dotfiles.dotfiles_repo_version
: master
The branch/tag/commit hash to use for retrieving dotfiles. They should be in the root directory.dotfiles_repo_accept_hostkey
: false
Automatically add the host key for the repository URL if it's not already added. This is ignored ifssh_opts
includes "-o StrictHostKeyChecking=no".dotfiles_repo_local_destination
: "~/dotfiles"
The local path where the repository will be cloned.dotfiles_force_clone
: false
If set to true, it will force the cloning of the repository, replacing any local changes.dotfiles_home
: "~"
The home directory where dotfiles will be linked. The default should work for most cases, but you might need to specify the full path in some situations or when running as another user.dotfiles_files
:
A list of which files from the dotfiles repository should be linked todotfiles_home
. Examples include:- ansible.cfg
- config/fish
- config/flake8
- config/yakuakerc
- gitconfig
- gitignore_global
- gitmessage
- inputrc
- selected_editor
- tmux.conf
- vim
- vimrc
dotfiles_start_with_dot
: false
Indicates if the files in the repository start with a dot.
Example Playbook
Here’s a simple example of how to use this role in a playbook:
- hosts: localhost
roles:
- { role: radek_sprta.dotfiles }
License
MIT
Author Information
This role is created by Radek Sprta mail@radeksprta.eu and is based on a dotfiles role by Jeff Geerling.
Install a set of dotfiles from a given repository.
ansible-galaxy install radek_sprta.dotfiles