https://github.com/charlesrocket/essential-collection
https://github.com/charlesrocket/essential-collection
ansible dotfiles git
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/charlesrocket/essential-collection
- Owner: charlesrocket
- License: mit
- Created: 2023-03-27T19:11:39.000Z (about 3 years ago)
- Default Branch: trunk
- Last Pushed: 2024-12-19T15:10:40.000Z (over 1 year ago)
- Last Synced: 2025-03-24T15:11:22.755Z (about 1 year ago)
- Topics: ansible, dotfiles, git
- Language: Python
- Homepage: https://charlesrocket.github.io/essential-collection/
- Size: 410 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# essential-collection
[](https://galaxy.ansible.com/ui/repo/published/charlesrocket/essential/)
[](https://github.com/charlesrocket/essential_collection/actions/workflows/ci.yml)
[](https://codecov.io/gh/charlesrocket/essential-collection)
### Install
`requirements.yml`:
```yaml
collections:
- name: charlesrocket.essential
```
## `dotfiles`
#### Requirements
`git` on managed machines
### Example
```yaml
- name: Playbook
hosts: all
roles:
- charlesrocket.essential.dotfiles
```
### Set variables
```yaml
dotfiles_repo: "https://github.com/charlesrocket/dotfiles.git" # dotfiles
dotfiles_repo_version: openbsd # branch to track
dotfiles_repo_accept_newhostkey: false # StrictHostKeyChecking=accept-new
dotfiles_repo_force: false # force git clone
dotfiles_repo_local_destination: "~/git/dotfiles" # local repo path
dotfiles_home: "~" # local dotfiles path
dotfiles_files: # files to track
- .config/mc/ini
- .zshrc
```
## `git`
### Example
```yaml
- name: Playbook
hosts: all
roles:
- charlesrocket.essential.git
```
### Credential helper
Define the following variables to deploy the credential helper:
```yaml
git_repo_destination: "~/gitlab/git" # git repository destination
git_helper_directory: "~/bin" # helper directory
git_helper: ["netrc"]
```
* Add `git_repo_shallow: true` to use shallow clone.
* Add `git_repo_force: true` to override local modifications.
## `fetch_vars`
Inject variables from remote hosts:
```yaml
- name: Playbook
hosts: all
tasks:
- name: Import user variables
include_role:
name: charlesrocket.essential.fetch_vars
vars:
fetch_vars_url: https://www.example.com/user_vars.yaml
```