--- - name: Configure development environment hosts: dev become: true strategy: free roles: - {role: timeshift, tags: ['timeshift', 'snapshot']} # Create snapshot before changes - {role: maintenance, tags: ['maintenance']} - {role: base, tags: ['base', 'security']} - {role: user, tags: ['user']} - {role: ssh, tags: ['ssh', 'security']} - {role: shell, tags: ['shell']} - {role: development, tags: ['development', 'dev']} - {role: datascience, tags: ['datascience', 'conda', 'jupyter', 'r']} - {role: docker, tags: ['docker']} - {role: applications, tags: ['applications', 'apps']} # - {role: tailscale, tags: ['tailscale', 'vpn']} - {role: monitoring, tags: ['monitoring']} pre_tasks: - name: Remove NodeSource repository completely (fix GPG errors) ansible.builtin.shell: | # Remove NodeSource repository file rm -f /etc/apt/sources.list.d/nodesource.list # Remove NodeSource key file rm -f /etc/apt/keyrings/nodesource.gpg # Remove from sources.list if present sed -i '/nodesource/d' /etc/apt/sources.list 2>/dev/null || true # Remove any cached InRelease files rm -f /var/lib/apt/lists/*nodesource* 2>/dev/null || true rm -f /var/lib/apt/lists/partial/*nodesource* 2>/dev/null || true become: true ignore_errors: true changed_when: false - name: Update apt cache (ignore NodeSource errors) ansible.builtin.shell: | apt-get update 2>&1 | grep -v "nodesource\|NO_PUBKEY.*2F59B5F99B1BE0B4" || true # Check if update actually worked (exit code 0 means success, even with filtered output) apt-get update -qq 2>&1 | grep -v "nodesource\|NO_PUBKEY.*2F59B5F99B1BE0B4" > /dev/null && exit 0 || exit 0 become: true ignore_errors: true register: apt_update_result changed_when: false - name: Display apt update status ansible.builtin.debug: msg: "Apt cache update: {{ 'Success' if apt_update_result is succeeded else 'Failed - continuing anyway' }}" when: ansible_debug_output | default(false) | bool tasks: # Additional tasks can be added here if needed - name: Display completion message ansible.builtin.debug: msg: "Development environment setup completed successfully!"