karlmdavis.rcm-dotfiles
Ansible Role for RCM
This Ansible role helps to install and set up RCM, a tool for managing dotfiles.
After using this role, you can change the repositories locally. To deploy new dotfiles from those repositories, just run:
$ rcup -f
Requirements
To use this role, you need the following on your Ansible management system:
- Ansible version 2.4.0 or higher
- Git version 1.7.1 or higher
The systems you manage need:
- Ubuntu 16.04 (unless you set
rcm_install_mode: no_internet, which works on most operating systems)
Role Variables
Here are some variables you can set:
rcm_user: The user for whom the RCM repositories will be installed.rcm_repos: A list of Git repositories that will provide dotfiles.repo: The URL of the Git repository.refspec: The specific version of the Git repository to clone (default ismaster).dest: The directory where the repository will be cloned.
rcm_install_mode: If set tono_internet, the role will download everything on the Ansible management system instead of assuming the managed system has internet access. In this mode, RCM is installed for individual users instead of system-wide.rcm_replace_existing_files: If true, the-fflag will be used withrcup, allowing it to replace existing files. This can be useful to overwrite the defaultbashrcfile with one from your dotfiles repository.
For default variable values, see defaults/main.yml.
Dependencies
This role does not depend on any other Ansible roles.
Example Playbook
Here’s an example of applying this role to the box host in an Ansible play:
- hosts: box
tasks:
- name: Install and Configure RCM
include_role:
name: karlmdavis.rcm-dotfiles
vars:
rcm_user: ansible_test
rcm_install_mode: no_internet
rcm_repos:
- repo: 'https://foosball.example.com/path/to/repo.git'
dest: '/home/karl/.dotfiles-repo.git'
Development Environment
To develop or modify this project, you need to have several tools installed.
Python
This project requires Python 2.7. To install it, run:
$ sudo apt-get install python
virtualenv
This project has dependencies that must be installed using pip. It’s recommended to use a Python virtual environment for managing these dependencies.
To install virtualenv, run:
$ sudo apt-get install python-virtualenv
Docker
It's useful to run test Docker containers locally. You need to have Docker installed, which is not covered in this guide, but you can easily find resources online to help with installation.
Running the Tests
After installing the necessary tools, you can use the test/run-tests.sh script to run tests locally. Alternatively, you can push changes to a GitHub branch or pull request, and Travis CI will run the tests for you: Travis CI: karlmdavis/ansible-role-rcm-dotfiles.
License
This project is licensed under the GNU General Public License, Version 3.
This Ansible role can be used to install and configure RCM (https://github.com/thoughtbot/rcm), a management suite for dotfiles.
ansible-galaxy install karlmdavis.rcm-dotfiles