ilia 01d35172e4
Some checks failed
CI / lint-and-test (pull_request) Failing after 58s
CI / ansible-validation (pull_request) Failing after 1m58s
CI / secret-scanning (pull_request) Successful in 58s
CI / dependency-scan (pull_request) Successful in 1m1s
CI / sast-scan (pull_request) Successful in 1m55s
CI / license-check (pull_request) Successful in 58s
CI / vault-check (pull_request) Failing after 1m55s
CI / playbook-test (pull_request) Successful in 1m57s
CI / container-scan (pull_request) Successful in 1m27s
CI / sonar-analysis (pull_request) Successful in 2m4s
CI / workflow-summary (pull_request) Successful in 55s
Fix: Resolve linting errors and improve firewall configuration
- Fix UFW firewall to allow outbound traffic (was blocking all outbound)
- Add HOST parameter support to shell Makefile target
- Fix all ansible-lint errors (trailing spaces, missing newlines, document starts)
- Add changed_when: false to check commands
- Fix variable naming (vault_devGPU -> vault_devgpu)
- Update .ansible-lint config to exclude .gitea/ and allow strategy: free
- Fix NodeSource repository GPG key handling in shell playbook
- Add missing document starts to host_vars files
- Clean up empty lines in datascience role files
2025-12-17 22:51:04 -05:00

53 lines
1.8 KiB
YAML

---
- name: Check if Timeshift is installed
ansible.builtin.command: timeshift --version
register: timeshift_check
failed_when: false
changed_when: false
- name: Install Timeshift
ansible.builtin.apt:
name: timeshift
state: present
become: true
when:
- timeshift_install | default(true) | bool
- timeshift_check.rc != 0
- name: Create Timeshift snapshot directory
ansible.builtin.file:
path: "{{ timeshift_snapshot_location }}"
state: directory
mode: '0755'
become: true
when: timeshift_install | default(true) | bool
- name: Create snapshot before playbook execution
ansible.builtin.command: >
timeshift --create
--comments "{{ timeshift_snapshot_description }}"
--tags {{ timeshift_snapshot_tags | join(',') }}
--scripted
become: true
register: timeshift_snapshot_result
when:
- timeshift_auto_snapshot | default(true) | bool
- timeshift_check.rc == 0 or timeshift_install | default(true) | bool
changed_when: "'Snapshot created successfully' in timeshift_snapshot_result.stdout or 'Created snapshot' in timeshift_snapshot_result.stdout"
failed_when: >
timeshift_snapshot_result.rc != 0
and "'already exists' not in timeshift_snapshot_result.stderr | default('')"
and "'Snapshot created' not in timeshift_snapshot_result.stderr | default('')"
ignore_errors: true
- name: Display snapshot information
ansible.builtin.debug:
msg:
- "Timeshift snapshot operation completed"
- "Output: {{ timeshift_snapshot_result.stdout | default('Check with: sudo timeshift --list') }}"
- "To list snapshots: sudo timeshift --list"
- "To restore: sudo timeshift --restore --snapshot 'SNAPSHOT_NAME'"
when:
- timeshift_auto_snapshot | default(true) | bool
- timeshift_snapshot_result is defined