diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-09-20 22:01:54 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-09-20 22:01:54 +0200 |
| commit | 068198fd661b1414e3b13d418200650f5705be4a (patch) | |
| tree | 10f7a729f3593ff0fd6286160c2afd641adc59ec | |
| parent | d619aadae27f2d98782651760dc75b81a20dfd81 (diff) | |
Move gcc to it's own role and add it as homebrew dependency
| -rw-r--r-- | roles/gcc/meta/argument_specs.yml | 6 | ||||
| -rw-r--r-- | roles/gcc/meta/main.yml | 20 | ||||
| -rw-r--r-- | roles/gcc/tasks/main.yml | 9 | ||||
| -rw-r--r-- | roles/gcc/vars/archlinux.yml | 2 | ||||
| -rw-r--r-- | roles/gcc/vars/debian.yml | 2 | ||||
| -rw-r--r-- | roles/homebrew/meta/main.yml | 1 | ||||
| -rw-r--r-- | roles/homebrew/tasks/main.yml | 10 | ||||
| -rw-r--r-- | roles/homebrew/vars/archlinux.yml | 5 | ||||
| -rw-r--r-- | roles/homebrew/vars/debian.yml | 5 |
9 files changed, 40 insertions, 20 deletions
diff --git a/roles/gcc/meta/argument_specs.yml b/roles/gcc/meta/argument_specs.yml new file mode 100644 index 00000000..37f68519 --- /dev/null +++ b/roles/gcc/meta/argument_specs.yml @@ -0,0 +1,6 @@ +--- +argument_specs: + main: + short_description: "Install gcc on Linux distributions" + description: "Install gcc on Linux distributions" + options: {} diff --git a/roles/gcc/meta/main.yml b/roles/gcc/meta/main.yml new file mode 100644 index 00000000..c7d54919 --- /dev/null +++ b/roles/gcc/meta/main.yml @@ -0,0 +1,20 @@ +--- +dependencies: + - role: "curl" + - role: "git" +galaxy_info: + author: "a14m" + description: "Install gcc on Linux distributions" + 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/gcc/tasks/main.yml b/roles/gcc/tasks/main.yml new file mode 100644 index 00000000..92cb96dd --- /dev/null +++ b/roles/gcc/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- name: "Include OS-specific variables" + ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" + +- name: "Ensure gcc is installed" + become: true + ansible.builtin.package: + name: "{{ gcc_package }}" + state: "present" diff --git a/roles/gcc/vars/archlinux.yml b/roles/gcc/vars/archlinux.yml new file mode 100644 index 00000000..fd361c7f --- /dev/null +++ b/roles/gcc/vars/archlinux.yml @@ -0,0 +1,2 @@ +--- +gcc_package: "base-devel" diff --git a/roles/gcc/vars/debian.yml b/roles/gcc/vars/debian.yml new file mode 100644 index 00000000..3981d191 --- /dev/null +++ b/roles/gcc/vars/debian.yml @@ -0,0 +1,2 @@ +--- +gcc_package: "build-essential" diff --git a/roles/homebrew/meta/main.yml b/roles/homebrew/meta/main.yml index 62e7b03c..bee48f06 100644 --- a/roles/homebrew/meta/main.yml +++ b/roles/homebrew/meta/main.yml @@ -2,6 +2,7 @@ dependencies: - role: "curl" - role: "git" + - role: "gcc" galaxy_info: author: "a14m" description: "Install homebrew package manager on Linux distributions" diff --git a/roles/homebrew/tasks/main.yml b/roles/homebrew/tasks/main.yml index 4da2c37a..9d3f1701 100644 --- a/roles/homebrew/tasks/main.yml +++ b/roles/homebrew/tasks/main.yml @@ -1,7 +1,4 @@ --- -- name: "Include OS-specific variables" - ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" - - name: "Check if homebrew is already installed" ansible.builtin.stat: path: "/home/linuxbrew/.linuxbrew/bin/brew" @@ -10,13 +7,6 @@ - name: "Install homebrew" when: not homebrew_binary_check.stat.exists block: - - name: "Install homebrew dependencies" - become: true - ansible.builtin.package: - name: "{{ item }}" - state: "present" - loop: "{{ homebrew_dependencies }}" - - name: "Create linuxbrew directory" become: true ansible.builtin.file: diff --git a/roles/homebrew/vars/archlinux.yml b/roles/homebrew/vars/archlinux.yml deleted file mode 100644 index 0b3af4b0..00000000 --- a/roles/homebrew/vars/archlinux.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -homebrew_dependencies: - - base-devel - - curl - - git diff --git a/roles/homebrew/vars/debian.yml b/roles/homebrew/vars/debian.yml deleted file mode 100644 index 3f2348cc..00000000 --- a/roles/homebrew/vars/debian.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -homebrew_dependencies: - - build-essential - - curl - - git |
