Ansible Home Server Pt. 2 - Roles, Handlers, Ansible Galaxy, Filters & Loops

Поділитися
Вставка
  • Опубліковано 29 тра 2024
  • Go to squarespace.com/wolfgang to get a free trial and 10% off your first purchase of a website or domain!
    Follow me:
    Mastodon tilde.zone/@notthebee
    GitHub github.com/notthebee
    Twitch twitch.com/notthebeee
    Support the channel:
    Patreon / wolfgangschannel
    PayPal (one time donation) www.paypal.com/donate/?hosted...
    Music:
    Kitrano - Slow Evening
    Lolek - Cruise Control
    Meod - Crispy Cone
    Steven Beddall - Cuts So Deep (Instrumental Version)
    Videos are edited with Davinci Resolve Studio. I use Affinity Photo for thumbnails and Ableton Live for audio editing.
    Video gear:
    Camera geni.us/K8OOyKV (Amazon)
    Main lens geni.us/jnnElY4 (Amazon)
    Microphone geni.us/tgiSqL (Amazon)
    Key light geni.us/Gi1zE2 (Amazon)
    Softbox geni.us/F86pM (Amazon)
    Secondary light geni.us/aciv (Amazon)
    Other stuff that I use:
    Monitor geni.us/KUzcmcP (Amazon)
    Monitor arm geni.us/5RXu (Amazon)
    Laptop stand geni.us/X5vx9Af (Amazon)
    Keyboard www.amazon.de/HHKB-PD-KB401W-...
    Mouse geni.us/KB7h (Amazon)
    Audio interface geni.us/sdhWsC (Amazon)
    As an Amazon Associate, I earn from qualifying purchases
    Timestamps:
    00:00 Introduction
    00:24 Recap
    00:44 Turning our tasks into a role
    01:32 Role defaults
    02:02 Creating a non-root user
    02:28 Filters (password_hash and regex_replace)
    04:19 Creating groups (loops and lists)
    05:21 Suppressing login message (file module)
    06:27 Restarting SSH on changes (handlers)
    07:20 Complex loops
    08:19 Ansible Galaxy introduction
    08:52 The dangers of dependencies
    09:31 Using a Galaxy role to install Docker
    10:33 Running the playbook
    11:03 Outro
  • Наука та технологія

КОМЕНТАРІ • 61

  • @Felix-ve9hs
    @Felix-ve9hs Рік тому +30

    I won't lie, I completely forgot I ever saw the first part

    • @atomictransfusion
      @atomictransfusion Рік тому +2

      if it makes you feel better i haven't watched the part 1 because i didn't know that there was one

  • @blazenetwork242
    @blazenetwork242 Місяць тому +1

    I am a huge fan of your content. This series has inspired me to build my own home server. I would love to see a continuation, especially one where you could automatically set up and run docker containers (perhaps with docker compose files?). I see that's all set up in your archived repo, but would love a walkthrough.

  • @aelhamamy
    @aelhamamy 2 місяці тому +2

    I first heard about ansible from you, then forgot about it for a long time. Recently I rewatched your ansible demo and these two videos, and Jeff's great series. Now everything in my home server, plus my desktop and laptop, is controlled strictly through ansible. I even no longer use the shell to do anything other than normal navigation, anything to install or remove or change system wide or local config wise, only has to go through ansible, which might be too strict, but gave me a great peace of mind!
    I will always be grateful :)

  • @JeffGeerling
    @JeffGeerling Рік тому +21

    8:54 heh...

    • @andykrivovjas9256
      @andykrivovjas9256 Рік тому +1

      Literally, I just finished watching your ansible series from a couple of years ago. Wanted to use ansible for my home infrastructure and maybe for work. Initially I used ChatGPT to setup my first playbook and get the basics, then found your videos. It helped a lot, I migrated all my home services from my proxmox machine to a tiny raspberry pi (I am from Ukraine and that's the only thing a can power when the electricity goes off). And now I am in love with ansible, wish I found it earlier. The only thing I didn't figure out is how to set the static ip and continue running the playbook; it always stops and I have to re-run other tasks for the new ip.

    • @Jimmy_Jones
      @Jimmy_Jones Рік тому +1

      @@andykrivovjas9256 Damn. Why didn't I think of ChatGPT? I'm definitely finally going to get round to learning it this weekend.

  • @FrankKumro
    @FrankKumro Рік тому +11

    Ansible is great for setting up your homelab, I picked up a few tips from this video, thanks!

  • @izocker2907
    @izocker2907 Рік тому

    Watched part 1 and tried out Ansible just yesterday, perfect timing! The videos are great to get started and provide lots of helpful information!

  • @Flackon
    @Flackon Рік тому +1

    I never thought this video would actually get made. I stand corrected

  • @cheebadigga4092
    @cheebadigga4092 Рік тому +3

    One way to overcome the risks of using other people's roles is to fork them and keep them updated. This way you can also make PRs if you find bugs in a role (maybe encountered after an Ansible update) and this way both of you win.

  • @gzoechi
    @gzoechi Рік тому +4

    The sshd config stuff can be simplified by copying a file to /etc/ssh/sshd_config.d/
    This makes it easier when an sshd update has changes in the default config.
    Check if sshd_config contains "Include /etc/ssh/sshd_config/*.conf".
    I have first seen this structure in Debian Bullseye

  • @dlorp.
    @dlorp. Рік тому

    i saw part 1 a while ago and i was excited to spend my weekend setting it up but as soon as i got home from work the github was cleared out )); excited to see this part 2!

  • @rGunti
    @rGunti 8 місяців тому +1

    Thanks for the explanations. I actually started picking up Ansible using ChatGPT, which is great at giving you something to start with. Then, I continued by having the ansible linter installed in VSCode to give me advise. Eventially, I wanted to have some parts of my code become reusable and the style your video was perfect to give me a good overview on how to do it, rather than watching a 30-60 min course on Ansible just to learn how to write roles.

  • @accik
    @accik Рік тому

    Things to try out in the weekend, thanks!

  • @robertharker
    @robertharker Рік тому +1

    A great video. Fast, sweet and to the point. One suggestion: each time before you clear the screen, count to two. This gives those of us who are typing as you go along an easier time pausing the full terminal screen video at the right time. You don't have a git repo with your examples? Perhaps with commits each time you complete a section of your tutorial. Thanks for the great intro!

  • @mopiranha
    @mopiranha Рік тому

    Can't wait for more episodes of this series!

  • @Adrianvdh
    @Adrianvdh Рік тому

    Took you long enough! Finally, thank you sir 🎉

  • @Acceleratedpayloads
    @Acceleratedpayloads 4 місяці тому

    That inconsistency of being able to list packages you talk about around 5:00 really made me feel like I didn't understand ansible circa 2019. I did, it was just unpredictable

  • @user-kv9dw4tp3y
    @user-kv9dw4tp3y Рік тому +2

    Привет! Спасибо за продолжение)
    В последних видео видно было что исподьзуешь unraid для своего хранилища. Вроде бы раньше пользовался самодельным хрантлищем Ubuntu.
    Дак что в итоге удобнее в твоей ситуации?

  • @dexterman6361
    @dexterman6361 9 місяців тому

    Thanks for the video!

  • @anothertijuano
    @anothertijuano Рік тому

    Great video as always

  • @kaspersergej
    @kaspersergej Рік тому +2

    For loops is best practice to not use “item” as the loop var name. Use loop_control to set a new name with loop_var.

  • @sarundayo
    @sarundayo Рік тому

    Your thumbnail game is on point my dude

  • @phandr1x
    @phandr1x Рік тому

    I see the toolbox 🧰 from „Bauhaus“ in your thumbnail 😂

  • @lostolli7766
    @lostolli7766 Рік тому

    Your videos are great and I am about to build a small server on my own now. That's at least in part thanks to you.
    But there are a lot of options and personally I find it really hard to choose between all those safety feature. ECC RAM or not, powerloss protection or even a ups/usv?
    I am living in Germany (as you?) and power cuts are really rare in my region and many security options seem to be a huge overkill, but it's hard to judge in my opinion.
    I also want to build a somewhat power efficient server and used the list from hradeareluxx you showed in a video. So, if you see this comment, what are you doing to protect your data against a poweloss or similar?

  • @maxarendorff6521
    @maxarendorff6521 Рік тому +1

    Awesome video. Would you consider making a video about how you got into devops as a job? I'd be interesting to hear your perspective.

  • @nichtgestalt
    @nichtgestalt Рік тому

    Nice! Thank you very much!

  • @ambronhib5561
    @ambronhib5561 Рік тому

    Thinking about building an homeserver for jellyfin, nextcloud (for me and my relatives) and a VM to run one or two gameservers to work on before launching them on a "real" server.
    I am trying to find a decent component list to fulfill all my needs without pulling too much Watt. Because the increase in the power-pricing at the moment is let me overthink building a homeserver in general already.
    What would you recommend?

  • @a.g8517
    @a.g8517 Рік тому

    great video

  • @maxnatamo
    @maxnatamo Рік тому

    Is there a reason you always rotate your head a little to the left?

  • @WolfgangsChannel
    @WolfgangsChannel  Рік тому +3

    Ansible Home Server playlist: ua-cam.com/play/PLkxWXio1KmRoZd88WbrnSnQM5MJY5PjH2.html
    Code: github.com/notthebee/ansible_homeserver

    • @frisosmit8920
      @frisosmit8920 Рік тому

      Thanks for the link. The second video is not in the playlist though

  • @-blackcat-4749
    @-blackcat-4749 4 місяці тому

    Is it possible to fully automate Mac deployment and provisioning?

  • @UntrackedEndorphins
    @UntrackedEndorphins Рік тому +2

    You neovim setup looks rad af, are the dotfile available in your github?

  • @HugoParedes
    @HugoParedes Рік тому

    Pleeeeaase show your nvim setup. It looks so good

  • @edvardfranke
    @edvardfranke Рік тому

    Thx😊

  • @secretcactus4717
    @secretcactus4717 Рік тому

    Nice!

  • @rajeshchaudhary883
    @rajeshchaudhary883 Рік тому

    8:23 what is that dashboard?

  • @alphenit
    @alphenit 11 місяців тому

    Quick question: which user is ansible using to actually connect and "do" stuff on the homeserver?
    (Since the playbook has an entry to create the local notthebee user) how is ansible connecting to the homeserver if the local notthebee user does not exist yet ?

  • @bb_poison
    @bb_poison Рік тому +4

    ubuntu server and ansible? I'd figured you'd be up on nixos by now

    • @rc3043
      @rc3043 Рік тому

      better use steam OS :D :D :D

  • @VikramSoni2
    @VikramSoni2 8 місяців тому

    what is this editor? can you make a video of your editor setup ?

  • @ktdefron
    @ktdefron Рік тому

    Could you upload these to a repo somewhere to make them easier to review? Even cooler would be commits matching the timestamps but that'd be like course-levels of effort so totally just awesome bonus-points
    EDIT: Oh I see you did in a repo called infra. I was so busy looking for ansible in the name I missed it XD my bad

    • @WolfgangsChannel
      @WolfgangsChannel  Рік тому +1

      No you're right. infra is for my home infrastracture, not this tutorial
      github.com/notthebee/ansible_homeserver

    • @ktdefron
      @ktdefron Рік тому

      @@WolfgangsChannel awesome thanks!

  • @Xac501
    @Xac501 Рік тому

    I thought you switched to Unraid

  • @nicolassery5397
    @nicolassery5397 Рік тому

    Maybe start thinking about using full templates instead of lineinfile or blockinfile

    • @WolfgangsChannel
      @WolfgangsChannel  Рік тому +1

      Probably not a great idea for SSH. Each distro comes with a slightly different sshd_config, and in this case lineinfile is a better way to only enforce some SSHD options, but not all.
      That being said, I will go through templates in one of the next videos

    • @nicolassery5397
      @nicolassery5397 Рік тому

      I wanded to tell you, I really appreciate your videos about homelab :)

  • @gitgudchannel
    @gitgudchannel Рік тому +1

    Looks like the Algo fkd your views up quite a bit, here's a small boost to get you back up to speed.

    • @WolfgangsChannel
      @WolfgangsChannel  Рік тому +1

      There's a reason why I almost abandoned this series 😁

  • @Bill_the_Red_Lichtie
    @Bill_the_Red_Lichtie Рік тому

    Really well done. It would be great if would delve into the structure of the files and directories and shared some insight about your decisions. Thanks! 👍
    Here is link to part 1 --> ua-cam.com/video/Z7p9-m4cimg/v-deo.html

  • @DrDingus
    @DrDingus Рік тому +1

    Nice tutorial. Please slow down a little, it's not a race.

  • @IvanIvanov-qt6ik
    @IvanIvanov-qt6ik Рік тому

    Personally, not really interested in tools tutorials, would appreciate more theory, news, thoughts and builds.
    P.S. I don't know why, but really interested in what apps do you use on your iPhone and why not Android...
    Best wishes.

    • @Jimmy_Jones
      @Jimmy_Jones Рік тому +1

      Sounds like Level1Tech's channel would be good for you.

  • @cinnamon4183
    @cinnamon4183 Рік тому +1

    sorry i havent watched even 30 seconds yet but bisexual lighting