Giter Site home page Giter Site logo

idolize / ansible-role-dotfiles-stow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from footur/ansible-role-dotfiles

1.0 1.0 0.0 24 KB

Ansible Role - Easy and flexible dotfile installation with stow

Home Page: https://galaxy.ansible.com/ui/standalone/roles/idolize/dotfiles_stow/

License: MIT License

Python 100.00%

ansible-role-dotfiles-stow's Introduction

Ansible Role: idolize.dotfiles_stow

Installs a set of dotfiles from a given Git repostiory.

Works for all dotfile repos that follow the stow format (blog post).

Example playbook

---
- hosts: localhost
  roles:
    - role: idolize.dotfiles_stow
      vars:
        dotfiles_repo: https://github.com/myusername/mydotfiles
        dotfiles_conflict_mode: adopt_and_reset

Configuration

Dotfiles Repository

Before using the role, you must define the dotfiles_repo variable somewhere. This is the git repo where your dotfiles are stored (e.g. "https://github.com/myusername/mydotfiles").

You may also specify dotfiles_repo_version (default = "main"), which specifies the version of the repo to checkout (e.g. branch, tag, or commit).

Directories

The dotfiles repository clone location and dotfiles symlink destination can be configured using the following variables:

dotfiles_repo_local_destination (default = "~/dotfiles") - Where to clone the dotfiles_repo git repository (the source stow directory).

dotfiles_home (default = "~") - Where to symlink the final dotfiles (stow's target directory).

Conflicts

If there are already existing configuration files in the dotfiles_home target directory then, by default, the task will throw an error. This matches the default behavior of stow.

If, instead, you want to change the behavior of how conflicts are handled you can set the dotfiles_conflict_mode variable to one of the following options:

abort (default) - Throws an error and exits on conflict.

adopt - Follows the "adopt" behavior from stow, where the existing config files overwrite the ones in the dotfiles repo.

adopt_and_reset - This is semi-equivalent to overwriting the existing config files with the ones from the dotfiles_repo, but there are a few caveats to be aware of. Instead of directly overwriting the files, it instead runs using --adopt, and then resets the dotfiles_repo repo back to the previous state using git.

Dependencies

None

Tests

Fully tested on:

  • Fedora 36
  • Ubuntu 20.04
  • macOS 13.4.1

Credits

Forked from: https://github.com/mariuskimmina/ansible-role-dotfiles

Inspired by: https://github.com/geerlingguy/ansible-role-dotfiles. The main difference between the original project and this one is the usage of stow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.