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
3 changes: 0 additions & 3 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ warn_list:
- command-instead-of-module
- command-instead-of-shell
- fqcn[action-core]
- ignore-errors
- name[missing]
- no-changed-when
- schema[playbook]
- yaml[empty-lines]
- yaml[line-length]
- yaml[truthy]
32 changes: 16 additions & 16 deletions debian/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- name: Setup development environment on Debian
hosts: localhost
connection: local
gather_facts: yes
gather_facts: true
# Define the become password at the play level so it's available to all tasks
vars:
ansible_become_pass: "{{ lookup('env', 'ANSIBLE_SUDO_PASS') }}"
Expand All @@ -16,7 +16,7 @@

tasks:
# System setup
- name: Check WSL version (0=not WSL, 1=WSL1, 2=WSL2)
- name: Check WSL version (0=not WSL, 1=WSL1, 2=WSL2) # noqa: risky-shell-pipe
ansible.builtin.shell: |
if ! grep -q -i microsoft /proc/version && ! uname -r | grep -q microsoft; then
exit 0
Expand All @@ -32,7 +32,7 @@
exit 0
fi
register: wsl_check
ignore_errors: yes
failed_when: false
changed_when: false
tags:
- system
Expand Down Expand Up @@ -80,18 +80,18 @@
# apt update
- name: Update APT cache
ansible.builtin.apt:
update_cache: yes
update_cache: true
cache_valid_time: 3600
become: yes
become: true
tags:
- apt
- update

# apt upgrade
- name: Upgrade all packages
ansible.builtin.apt:
upgrade: yes
become: yes
upgrade: true
become: true
tags:
- apt
- upgrade
Expand All @@ -101,7 +101,7 @@
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 }}"
state: present
become: yes
become: true
tags:
- apt
- prereqs
Expand All @@ -121,7 +121,7 @@
loop_control:
label: "Adding repository: {{ item.name }}"
when: item.supported_architectures is not defined or deb_architecture in item.supported_architectures
become: yes
become: true
tags:
- apt
- repositories
Expand All @@ -131,7 +131,7 @@
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 }}"
state: present
become: yes
become: true
tags:
- apt
- packages
Expand All @@ -141,7 +141,7 @@
ansible.builtin.apt:
name: flatpak
state: present
become: yes
become: true
when: (flatpak_packages | default([], true)) | length > 0
tags:
- flatpak
Expand All @@ -152,7 +152,7 @@
name: flathub
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
state: present
become: yes
become: true
when: (flatpak_packages | default([], true)) | length > 0
tags:
- flatpak
Expand All @@ -163,7 +163,7 @@
name: "{{ item.name }}"
state: present
remote: flathub
become: yes
become: true
loop: "{{ flatpak_packages | default([], true) }}"
when: item.supported_architectures is not defined or deb_architecture in item.supported_architectures
register: flatpak_install_result
Expand Down Expand Up @@ -326,7 +326,7 @@
cmd: uv tool install {{ item }}
when: uv_check.rc == 0
loop: "{{ uv_tools | default([], true) }}"
ignore_errors: yes
failed_when: false
register: uv_tool_install_result
changed_when: "'already installed' not in uv_tool_install_result.stderr"
loop_control:
Expand Down Expand Up @@ -447,7 +447,7 @@
cmd: cursor --install-extension {{ item }}
environment:
PATH: "{{ appimage_install_dir }}:{{ ansible_env.PATH }}"
ignore_errors: yes
failed_when: false
loop: "{{ vscode_extensions | default([], true) }}"
register: cursor_ext_result
changed_when: "'already installed' not in cursor_ext_result.stdout"
Expand Down Expand Up @@ -505,7 +505,7 @@
# Custom elevated commands
- name: Execute custom elevated commands
ansible.builtin.shell: "{{ item.command }}"
become: yes
become: true
loop: "{{ custom_commands_elevated | default([], true) }}"
loop_control:
label: "Executing: {{ item.description }}"
Expand Down
30 changes: 15 additions & 15 deletions fedora/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- name: Setup development environment on Fedora
hosts: localhost
connection: local
gather_facts: yes
gather_facts: true
# Define the become password at the play level so it's available to all tasks
vars:
ansible_become_pass: "{{ lookup('env', 'ANSIBLE_SUDO_PASS') }}"
Expand All @@ -16,7 +16,7 @@

tasks:
# System setup
- name: Check WSL version (0=not WSL, 1=WSL1, 2=WSL2)
- name: Check WSL version (0=not WSL, 1=WSL1, 2=WSL2) # noqa: risky-shell-pipe
ansible.builtin.shell: |
if ! grep -q -i microsoft /proc/version && ! uname -r | grep -q microsoft; then
exit 0
Expand All @@ -32,7 +32,7 @@
exit 0
fi
register: wsl_check
ignore_errors: yes
failed_when: false
changed_when: false
tags:
- system
Expand Down Expand Up @@ -70,8 +70,8 @@
# dnf makecache
- name: Update DNF cache
ansible.builtin.dnf:
update_cache: yes
become: yes
update_cache: true
become: true
tags:
- dnf
- update
Expand All @@ -81,7 +81,7 @@
ansible.builtin.dnf:
name: '*'
state: latest
become: yes
become: true
tags:
- dnf
- upgrade
Expand All @@ -91,7 +91,7 @@
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 }}"
state: present
become: yes
become: true
tags:
- dnf
- prereqs
Expand All @@ -111,7 +111,7 @@
loop_control:
label: "Adding repository: {{ item.name }}"
when: item.supported_architectures is not defined or rpm_architecture in item.supported_architectures
become: yes
become: true
tags:
- dnf
- repositories
Expand All @@ -121,7 +121,7 @@
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 }}"
state: present
become: yes
become: true
tags:
- dnf
- packages
Expand All @@ -131,7 +131,7 @@
ansible.builtin.dnf:
name: flatpak
state: present
become: yes
become: true
when: (flatpak_packages | default([], true)) | length > 0
tags:
- flatpak
Expand All @@ -142,7 +142,7 @@
name: flathub
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
state: present
become: yes
become: true
when: (flatpak_packages | default([], true)) | length > 0
tags:
- flatpak
Expand All @@ -153,7 +153,7 @@
name: "{{ item.name }}"
state: present
remote: flathub
become: yes
become: true
loop: "{{ flatpak_packages | default([], true) }}"
when: item.supported_architectures is not defined or rpm_architecture in item.supported_architectures
register: flatpak_install_result
Expand Down Expand Up @@ -316,7 +316,7 @@
cmd: uv tool install {{ item }}
when: uv_check.rc == 0
loop: "{{ uv_tools | default([], true) }}"
ignore_errors: yes
failed_when: false
register: uv_tool_install_result
changed_when: "'already installed' not in uv_tool_install_result.stderr"
loop_control:
Expand Down Expand Up @@ -437,7 +437,7 @@
cmd: cursor --install-extension {{ item }}
environment:
PATH: "{{ appimage_install_dir }}:{{ ansible_env.PATH }}"
ignore_errors: yes
failed_when: false
loop: "{{ vscode_extensions | default([], true) }}"
register: cursor_ext_result
changed_when: "'already installed' not in cursor_ext_result.stdout"
Expand Down Expand Up @@ -495,7 +495,7 @@
# Custom elevated commands
- name: Execute custom elevated commands
ansible.builtin.shell: "{{ item.command }}"
become: yes
become: true
loop: "{{ custom_commands_elevated | default([], true) }}"
loop_control:
label: "Executing: {{ item.description }}"
Expand Down
Loading