summaryrefslogtreecommitdiffstats
path: root/roles/dotfiles
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-11-03 23:05:10 +0100
committerAhmed Abdelhalim <[email protected]>2025-11-03 23:16:51 +0100
commit20b2d74c404102740b63a0efc723f1ad60073cc9 (patch)
tree5b016dc8609d6ecca09f2f609323cb5b02811c4a /roles/dotfiles
parent375bd8bb283cdce04cb2a65c489f0c6f46a975a9 (diff)
Add dotfiles setup role w/testing
Diffstat (limited to 'roles/dotfiles')
-rw-r--r--roles/dotfiles/meta/argument_specs.yml14
-rw-r--r--roles/dotfiles/meta/main.yml20
-rw-r--r--roles/dotfiles/tasks/main.yml15
3 files changed, 49 insertions, 0 deletions
diff --git a/roles/dotfiles/meta/argument_specs.yml b/roles/dotfiles/meta/argument_specs.yml
new file mode 100644
index 00000000..699cfe19
--- /dev/null
+++ b/roles/dotfiles/meta/argument_specs.yml
@@ -0,0 +1,14 @@
+---
+argument_specs:
+ main:
+ short_description: "Configure dotfile repo"
+ description: "Configure dotfile repo"
+ options:
+ dotfiles_repo_url:
+ type: "str"
+ description: "The dotfiles git repo URL"
+ required: true
+ dotfiles_setup_script:
+ type: "str"
+ description: "The dotfiles setup script"
+ required: true
diff --git a/roles/dotfiles/meta/main.yml b/roles/dotfiles/meta/main.yml
new file mode 100644
index 00000000..110e20f8
--- /dev/null
+++ b/roles/dotfiles/meta/main.yml
@@ -0,0 +1,20 @@
+---
+dependencies:
+ - role: "git"
+ - role: "stow"
+galaxy_info:
+ author: "a14m"
+ description: "Configure dotfiles repo"
+ company: "kartoffeln.work GmbH."
+ license: "MIT"
+ min_ansible_version: "2.18"
+ platforms:
+ - name: "ArchLinux"
+ versions:
+ - "all"
+ - name: "Ubuntu"
+ versions:
+ - "noble"
+ - name: "Debian"
+ versions:
+ - "bookworm"
diff --git a/roles/dotfiles/tasks/main.yml b/roles/dotfiles/tasks/main.yml
new file mode 100644
index 00000000..51b2e817
--- /dev/null
+++ b/roles/dotfiles/tasks/main.yml
@@ -0,0 +1,15 @@
+---
+- name: "Clone dotfiles git repo"
+ ansible.builtin.git:
+ repo: "{{ dotfiles_repo_url }}"
+ dest: "{{ ansible_env.HOME }}/.rc"
+ clone: true
+ update: false
+ single_branch: true
+ version: main
+
+- name: "Setup dotfiles"
+ ansible.builtin.shell:
+ cmd: "{{ dotfiles_setup_script }}"
+ executable: /bin/bash
+ creates: "{{ ansible_env.HOME }}/.bash_profile"