ansible/playbooks/development.yml
ilia 378b9d4686
Some checks failed
CI / lint-and-test (pull_request) Successful in 1m16s
CI / ansible-validation (pull_request) Successful in 5m54s
CI / secret-scanning (pull_request) Successful in 1m33s
CI / dependency-scan (pull_request) Successful in 2m49s
CI / sast-scan (pull_request) Successful in 8m53s
CI / license-check (pull_request) Successful in 1m16s
CI / vault-check (pull_request) Failing after 9m5s
CI / playbook-test (pull_request) Successful in 6m10s
CI / container-scan (pull_request) Successful in 4m35s
CI / sonar-analysis (pull_request) Successful in 5m55s
CI / workflow-summary (pull_request) Successful in 1m6s
Enhance Makefile and host configurations for improved usability and error handling
- Update `dev` target in Makefile to support optional SUDO and SSH_PASS parameters for better flexibility.
- Correct the IP address for `dev02` in the inventory file.
- Add host variables for `KrakenMint`, including user configuration and vault file for sensitive data.
- Modify `dev02` host variables to skip data science stack installation.
- Implement tasks to remove NodeSource repository across multiple roles to prevent GPG errors during apt operations.
- Update development playbook to handle Node.js installation more robustly, including checks for existing installations and repository configurations.
- Ensure apt cache updates ignore NodeSource errors to improve reliability.
2025-12-25 16:46:47 -05:00

57 lines
2.3 KiB
YAML

---
- 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!"