From c755315a4645cea02b4498b3eceb2fb2e96ad00d Mon Sep 17 00:00:00 2001 From: Ahmed AbdelHalim Date: Mon, 3 Nov 2025 23:05:10 +0100 Subject: Add dotfiles setup role w/testing --- roles/dotfiles/meta/argument_specs.yml | 14 ++++++++++++++ roles/dotfiles/meta/main.yml | 20 ++++++++++++++++++++ roles/dotfiles/tasks/main.yml | 15 +++++++++++++++ roles/stow/meta/argument_specs.yml | 6 ++++++ roles/stow/meta/main.yml | 18 ++++++++++++++++++ roles/stow/tasks/main.yml | 6 ++++++ 6 files changed, 79 insertions(+) create mode 100644 roles/dotfiles/meta/argument_specs.yml create mode 100644 roles/dotfiles/meta/main.yml create mode 100644 roles/dotfiles/tasks/main.yml create mode 100644 roles/stow/meta/argument_specs.yml create mode 100644 roles/stow/meta/main.yml create mode 100644 roles/stow/tasks/main.yml (limited to 'roles') 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" diff --git a/roles/stow/meta/argument_specs.yml b/roles/stow/meta/argument_specs.yml new file mode 100644 index 00000000..f28fd6a4 --- /dev/null +++ b/roles/stow/meta/argument_specs.yml @@ -0,0 +1,6 @@ +--- +argument_specs: + main: + short_description: "Install stow on Linux distribution" + description: "Install stow on Linux distribution" + options: {} diff --git a/roles/stow/meta/main.yml b/roles/stow/meta/main.yml new file mode 100644 index 00000000..b80706ce --- /dev/null +++ b/roles/stow/meta/main.yml @@ -0,0 +1,18 @@ +--- +dependencies: [] +galaxy_info: + author: "a14m" + description: "Install stow" + 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/stow/tasks/main.yml b/roles/stow/tasks/main.yml new file mode 100644 index 00000000..bbed9279 --- /dev/null +++ b/roles/stow/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: "Ensure stow is installed" + become: true + ansible.builtin.package: + name: "stow" + state: "present" -- cgit v1.2.3