Idempotent
Running the same playbook again should converge on the intended state rather than create damage or duplicate configuration.
Practical Ansible, shell and systemd work—without pretending the homelab is a thousand-node enterprise.
I use automation where repeatability matters: installing packages, applying Linux defaults, deploying agents, creating users, loading nftables policy, maintaining services and documenting recovery.
- name: Install baseline packages
ansible.builtin.apt:
name: "{{ baseline_packages }}"
state: present
update_cache: true
- name: Deploy service configuration
ansible.builtin.template:
src: service.conf.j2
dest: /etc/example/service.conf
notify: restart service
- name: Ensure service is enabled
ansible.builtin.systemd_service:
name: example
enabled: true
state: startedRunning the same playbook again should converge on the intended state rather than create damage or duplicate configuration.
Infrastructure changes belong in readable files that can be compared, versioned and explained during troubleshooting.
Automation complements backups and testing; it never replaces safe upgrade planning or service-specific recovery steps.