Goal

  • Get the intel NUC running as a code server with Ansible

2025-01-23 10:11

  • Updating the desktop VMs was due today. Took a long time. Need to take that into account the next time I start my day.
  • 10:31: Checked a little bit of how to go about running nginx as a docker container. Decided this was overkill for the home network. Ansible managing it is good enough for me.
  • 10:40: this is now a loop. need something done in ansible, try it. does not work. look up ansible docs to figure ansible stuff. cast about on the net to figure my own stuff. put it all together. groan when stuff does not work. change things. retry. change things. retry. this inner loop goes on, until stuff works the way i want it. then move one to the next thing i want done in ansible. ad nauseam
  • 11:02: ok off to read Ansible up and running. rather skim it rapidly. i need the background, so as not to be surprised at every new ansible keyword / concept i come across
  • 11:31: am very tempted to use the books advice and write stuff at a higher level of abstraction, but I know it won’t serve me well now as I learn. As soon as the pain of repetition / redoing stuff gets greater than actually doing it, I’ll begin to abstract things out
  • 11:46: found ansible-lint. ran it against my in progress file. ooh! what a nag! pretty handy though. empties my mind of a lot of thought.
  • 11:55: was irked enough by Ansible Lint’s nagging to fix the two shell outputs that always showed up as changed
  • Checks the book suggests, before considering a playbook done.
$ ansible-playbook --syntax-check webservers-tls.yml
$ ansible-lint webservers-tls.yml
$ yamllint webservers-tls.yml
$ ansible-inventory --host testserver -i inventory/inventory.ini
  • Note to self: Read Serge van Ginderachter’s posts on Ansible Inventory. One, two, and three. Also, his posts make me want to post my scribbles online as well!
  • sometimes this feels like slow going, but better to get all this stuff under my belt now, rather than later
  • 12:24: Done for now.

2025-01-23 12:30

  • Client Meeting

2025-01-23 16:15

  • Started up Ansible again.
  • Figured my first idiomatic way to make shell commands idempotic. Earlier I was just checking if the output of the command was 0 and then skipping ahead. Now I just assert via a creates argument, that the file I want exists at the path I specify. For e.g. if /etc/apt/keyrings/syncthing-archive-keyring.gpg exists, the play won’t download the sig again.
- name: Add Syncthing Signing Key
  ansible.builtin.shell: |
    curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
   args:
     creates: /etc/apt/keyrings/syncthing-archive-keyring.gpg

2025-01-23 17:55

  • Was on a customer call for the past 30m
  • Back to reading the book
  • The next chapter focuses on a realistic example of deploying an application.

  • Woot! Rubs palms! Let’s goooo…
  • The book’s taking the same approach as I’ve naively taken when doing mything. Good to know I’m on the right path.
  • Approach: break the thing in to tasks and steps. and then iteratively get things done
  • Reached Ch. 9 and they’ve now begun breaking big things down into smol things into folders and discrete components. Light bulb moment: I can split my main yaml into smoller things based on the functions i want installed.
  • I can use ansible-galaxy to scaffold a whole set of folders I need. Priyanka had taught me this a long time ago. I forgot!
$ ansible-galaxy role init --init-path playbooks/roles syncthing
  • 20:43: if there’s anything faster than skimming, i’m doing that now. Just looking for things that i might use. the book is now delving into more and more complex topics and use cases
  • Rapid reading now, does not seem to be a problem, because these advanced chapters are written like blog posts. One short post per topic
  • 21:50: Ok done! Off to bed!


Feedback on this post?
Mail me at feedback at this domain.

P.S. Subscribe to my mailing list!
Forward these posts and letters to your friends and get them to subscribe!
P.P.S. Feed my insatiable reading habit.