UncleNUC Wiki

Second chance for NUCs

User Tools

Site Tools


lab:stack_-_ansible_-_cmos

This is an old revision of the document!


Ansible - CMOS

In our previous step we updated Ubuntu

Now we are going to create and run an Ansible playbook to check the CMOS battery health on the nodes. Using /proc/driver/rtc instead of lm-sensors and sensors because it doesn't show the CMOS battery health.

Purpose:

  • Demonstrate a simple lineinfile checker
  • Check for any CMOS batteries that need to be replaced

Step 1 - Log in to Ansible Control Node

From NUC 1, log in to the Ansible control node, NUC 2.

Steps:

  1. Create file /home/ansible/my-project/cmos-check.yml
    • cmos-check.yml
      ---
      - hosts: nodes
        become: true
        become_user: root
        tasks:
          - name: CMOS battery health
            lineinfile:
              path: /proc/drive/rtc
              line: "batt_status	: okay"
              status: present
            check_mode: true
            register: cmos_battery_ok
          - name Set hardware clock
            - command: hwclock -w
  2. Test the playbook
    • ansible-playbook -i hosts cmos-check.yml

Congratulations on getting this far! Next up is installing Folding at Home (FAH)

lab/stack_-_ansible_-_cmos.1682718772.txt.gz ยท Last modified: 2023/04/28 21:52 by user