Ansible

Ansible

How to Automate Your Configuration


Homelab
ansible configuration homelab

It’s one of those days again.

Something breaks, you lose the past 5 hours of work, if only there were a better way. Ansible to the rescue! Ansible allows you to write infrastructure/configuration as code. Once written, ansible playbooks allow you to automatically and consistently deploy your infrastructure. Here’s a playbook I wrote for my old website:

---
- name: Create cjk website on LXC Host from scratch
  hosts: "{{ node }}.internal.cjk"
  vars:
    username: 'username'
  vars_files:
    - ../vars.yml
  roles:
    - update_upgrade_non_interactive
    - configure_defaults
    - setup_cjk
    - disable_turnkey_prompt

# RUN THIS PLAYBOOK
# clear && ansible-playbook cjk.yml

Have a wonderful rest of your day, and as always, cheers!

© 2024 Cameron Krischel