Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
warn_list:
- command-instead-of-module
- command-instead-of-shell
- fqcn[action-core]
- name[missing]
- no-changed-when
- yaml[empty-lines]
- yaml[line-length]
# All warn_list rules resolved — enforced at error level
{}
48 changes: 35 additions & 13 deletions debian/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@
# Install prerequisite APT packages
- name: Install prerequisite APT packages
ansible.builtin.apt:
name: "{{ apt_packages_prereqs | selectattr('supported_architectures', 'undefined') | map(attribute='name') | list + apt_packages_prereqs | selectattr('supported_architectures', 'defined') | selectattr('supported_architectures', 'contains', deb_architecture) | map(attribute='name') | list }}"
name: >-
{{ apt_packages_prereqs
| selectattr('supported_architectures', 'undefined')
| map(attribute='name') | list
+ apt_packages_prereqs
| selectattr('supported_architectures', 'defined')
| selectattr('supported_architectures', 'contains', deb_architecture)
| map(attribute='name') | list }}
state: present
become: true
tags:
Expand Down Expand Up @@ -129,7 +136,14 @@
# Install APT packages
- name: Install APT packages
ansible.builtin.apt:
name: "{{ apt_packages | selectattr('supported_architectures', 'undefined') | map(attribute='name') | list + apt_packages | selectattr('supported_architectures', 'defined') | selectattr('supported_architectures', 'contains', deb_architecture) | map(attribute='name') | list }}"
name: >-
{{ apt_packages
| selectattr('supported_architectures', 'undefined')
| map(attribute='name') | list
+ apt_packages
| selectattr('supported_architectures', 'defined')
| selectattr('supported_architectures', 'contains', deb_architecture)
| map(attribute='name') | list }}
state: present
become: true
tags:
Expand Down Expand Up @@ -461,7 +475,7 @@
- extensions

# Git LFS setup
- name: Ensure Git LFS is initialized
- name: Ensure Git LFS is initialized # noqa: command-instead-of-module
ansible.builtin.command:
cmd: git lfs install
register: git_lfs_result
Expand All @@ -472,41 +486,47 @@

# Git configuration (user.name)
- name: Configure Git user.name
ansible.builtin.command:
cmd: git config --global user.name "{{ git_user_name }}"
register: git_name_result
changed_when: git_name_result.rc == 0
community.general.git_config:
name: user.name
value: "{{ git_user_name }}"
scope: global
when: git_user_name is defined and git_user_name != ""
tags:
- git
- config

# Git configuration (user.email)
- name: Configure Git user.email
ansible.builtin.command:
cmd: git config --global user.email "{{ git_user_email }}"
register: git_email_result
changed_when: git_email_result.rc == 0
community.general.git_config:
name: user.email
value: "{{ git_user_email }}"
scope: global
when: git_user_email is defined and git_user_email != ""
tags:
- git
- config

# Custom user commands
- name: Execute custom user commands
- name: Execute custom user commands # noqa: command-instead-of-shell
ansible.builtin.shell: "{{ item.command }}"
loop: "{{ custom_commands_user | default([], true) }}"
register: custom_command_user_result
changed_when: custom_command_user_result.rc == 0
failed_when: false
loop_control:
label: "Executing: {{ item.description }}"
tags:
- custom
- user-commands

# Custom elevated commands
- name: Execute custom elevated commands
- name: Execute custom elevated commands # noqa: command-instead-of-shell
ansible.builtin.shell: "{{ item.command }}"
become: true
loop: "{{ custom_commands_elevated | default([], true) }}"
register: custom_command_elevated_result
changed_when: custom_command_elevated_result.rc == 0
failed_when: false
loop_control:
label: "Executing: {{ item.description }}"
tags:
Expand Down Expand Up @@ -537,6 +557,8 @@
- name: Execute custom script
ansible.builtin.command:
cmd: "{{ custom_script }}"
register: custom_script_result
changed_when: custom_script_result.rc == 0
when: custom_script is defined and custom_script != "" and custom_script_stat.stat.exists
tags:
- custom
Expand Down
48 changes: 35 additions & 13 deletions fedora/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,14 @@
# Install prerequisite DNF packages
- name: Install prerequisite DNF packages
ansible.builtin.dnf:
name: "{{ dnf_packages_prereqs | selectattr('supported_architectures', 'undefined') | map(attribute='name') | list + dnf_packages_prereqs | selectattr('supported_architectures', 'defined') | selectattr('supported_architectures', 'contains', rpm_architecture) | map(attribute='name') | list }}"
name: >-
{{ dnf_packages_prereqs
| selectattr('supported_architectures', 'undefined')
| map(attribute='name') | list
+ dnf_packages_prereqs
| selectattr('supported_architectures', 'defined')
| selectattr('supported_architectures', 'contains', rpm_architecture)
| map(attribute='name') | list }}
state: present
become: true
tags:
Expand Down Expand Up @@ -119,7 +126,14 @@
# Install DNF packages
- name: Install DNF packages
ansible.builtin.dnf:
name: "{{ dnf_packages | selectattr('supported_architectures', 'undefined') | map(attribute='name') | list + dnf_packages | selectattr('supported_architectures', 'defined') | selectattr('supported_architectures', 'contains', rpm_architecture) | map(attribute='name') | list }}"
name: >-
{{ dnf_packages
| selectattr('supported_architectures', 'undefined')
| map(attribute='name') | list
+ dnf_packages
| selectattr('supported_architectures', 'defined')
| selectattr('supported_architectures', 'contains', rpm_architecture)
| map(attribute='name') | list }}
state: present
become: true
tags:
Expand Down Expand Up @@ -451,7 +465,7 @@
- extensions

# Git LFS setup
- name: Ensure Git LFS is initialized
- name: Ensure Git LFS is initialized # noqa: command-instead-of-module
ansible.builtin.command:
cmd: git lfs install
register: git_lfs_result
Expand All @@ -462,41 +476,47 @@

# Git configuration (user.name)
- name: Configure Git user.name
ansible.builtin.command:
cmd: git config --global user.name "{{ git_user_name }}"
register: git_name_result
changed_when: git_name_result.rc == 0
community.general.git_config:
name: user.name
value: "{{ git_user_name }}"
scope: global
when: git_user_name is defined and git_user_name != ""
tags:
- git
- config

# Git configuration (user.email)
- name: Configure Git user.email
ansible.builtin.command:
cmd: git config --global user.email "{{ git_user_email }}"
register: git_email_result
changed_when: git_email_result.rc == 0
community.general.git_config:
name: user.email
value: "{{ git_user_email }}"
scope: global
when: git_user_email is defined and git_user_email != ""
tags:
- git
- config

# Custom user commands
- name: Execute custom user commands
- name: Execute custom user commands # noqa: command-instead-of-shell
ansible.builtin.shell: "{{ item.command }}"
loop: "{{ custom_commands_user | default([], true) }}"
register: custom_command_user_result
changed_when: custom_command_user_result.rc == 0
failed_when: false
loop_control:
label: "Executing: {{ item.description }}"
tags:
- custom
- user-commands

# Custom elevated commands
- name: Execute custom elevated commands
- name: Execute custom elevated commands # noqa: command-instead-of-shell
ansible.builtin.shell: "{{ item.command }}"
become: true
loop: "{{ custom_commands_elevated | default([], true) }}"
register: custom_command_elevated_result
changed_when: custom_command_elevated_result.rc == 0
failed_when: false
loop_control:
label: "Executing: {{ item.description }}"
tags:
Expand Down Expand Up @@ -527,6 +547,8 @@
- name: Execute custom script
ansible.builtin.command:
cmd: "{{ custom_script }}"
register: custom_script_result
changed_when: custom_script_result.rc == 0
when: custom_script is defined and custom_script != "" and custom_script_stat.stat.exists
tags:
- custom
Expand Down
25 changes: 13 additions & 12 deletions macOS/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@

# Refresh Ansible inventory
# This ensures that the inventory is up-to-date after Homebrew installations which add to the PATH
- meta: refresh_inventory
- name: Refresh Ansible inventory
ansible.builtin.meta: refresh_inventory

# PowerShell module setup
- name: Ensure PowerShell modules are installed
Expand Down Expand Up @@ -273,7 +274,7 @@
- extensions

# Git LFS setup
- name: Ensure Git LFS is initialized
- name: Ensure Git LFS is initialized # noqa: command-instead-of-module
ansible.builtin.command:
cmd: git lfs install
register: git_lfs_result
Expand All @@ -284,27 +285,27 @@

# Git configuration
- name: Configure Git user.name
ansible.builtin.command:
cmd: git config --global user.name "{{ git_user_name }}"
register: git_name_result
changed_when: git_name_result.rc == 0
community.general.git_config:
name: user.name
value: "{{ git_user_name }}"
scope: global
when: git_user_name is defined and git_user_name != ""
tags:
- git
- config

- name: Configure Git user.email
ansible.builtin.command:
cmd: git config --global user.email "{{ git_user_email }}"
register: git_email_result
changed_when: git_email_result.rc == 0
community.general.git_config:
name: user.email
value: "{{ git_user_email }}"
scope: global
when: git_user_email is defined and git_user_email != ""
tags:
- git
- config

# Custom macOS commands and preferences - Non-elevated (user) commands
- name: Execute custom macOS commands (non-elevated)
- name: Execute custom macOS commands (non-elevated) # noqa: command-instead-of-shell
ansible.builtin.shell:
cmd: "{{ item }}"
executable: /bin/bash
Expand All @@ -320,7 +321,7 @@
- user-commands

# Custom macOS commands that require elevated privileges
- name: Execute custom macOS commands (elevated)
- name: Execute custom macOS commands (elevated) # noqa: command-instead-of-shell
ansible.builtin.shell:
cmd: "{{ item }}"
executable: /bin/bash
Expand Down
Loading