Login
Default
Home
Containers
Host Nodes
Tasks
Definitions
Toggle theme
Light
Dark
Auto
Edit Task Definition
Task Name
Enter the name of the task.
Goal
Describe the goal you want to achieve, such as 'Install Nginx and start the service.'
Task Data (JSON)
- name: Ensure smartmontools is installed ansible.builtin.apt: name: smartmontools state: present update_cache: true - name: Gather all physical disks information ansible.builtin.shell: cmd: "lsblk -o NAME,TYPE | grep 'disk'" register: physical_disks changed_when: false - name: Extract physical disk names set_fact: disk_names: "{{ physical_disks.stdout_lines | map('regex_replace', '^(\\S+)\\s+disk$', '\\1') | list }}" - name: Check SMART status for each physical disk ansible.builtin.command: cmd: "smartctl -H /dev/{{ item }}" loop: "{{ disk_names }}" register: smart_status changed_when: false failed_when: > smart_status.rc not in [0, 32] or 'PASSED' not in smart_status.stdout - name: Report disks with marginal or failed attributes ansible.builtin.debug: msg: > SMART status for disk {{ item.item }} indicates an issue: {{ item.stdout }} loop: "{{ smart_status.results }}" when: "'PASSED' not in item.stdout or item.rc not in [0, 32]"
Save
Regenerate Task Data
Back to List
Delete Task Definition
Loading...