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

Sdílet
Vložit
  • čas přidán 13. 06. 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
  • Věda a technologie

Komentáře • 63

  • @aelhamamy
    @aelhamamy Před 3 měsíci +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 :)

  • @Felix-ve9hs
    @Felix-ve9hs Před rokem +30

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

    • @atomictransfusion
      @atomictransfusion Před rokem +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 Před 2 měsíci +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.

  • @JeffGeerling
    @JeffGeerling Před rokem +21

    8:54 heh...

    • @andykrivovjas9256
      @andykrivovjas9256 Před rokem +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 Před rokem +1

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

  • @affinitystablepeanuts
    @affinitystablepeanuts Před 10 dny

    Your content is great, Wolfgang. Thank you. Please keep it coming.

  • @FrankKumro
    @FrankKumro Před rokem +11

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

  • @Flackon
    @Flackon Před rokem +1

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

  • @izocker2907
    @izocker2907 Před rokem

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

  • @dlorp.
    @dlorp. Před rokem

    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!

  • @WolfgangsChannel
    @WolfgangsChannel  Před rokem +3

    Ansible Home Server playlist: czcams.com/play/PLkxWXio1KmRoZd88WbrnSnQM5MJY5PjH2.html
    Code: github.com/notthebee/ansible_homeserver

    • @frisosmit8920
      @frisosmit8920 Před rokem

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

  • @cheebadigga4092
    @cheebadigga4092 Před rokem +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.

  • @accik
    @accik Před rokem

    Things to try out in the weekend, thanks!

  • @mopiranha
    @mopiranha Před rokem

    Can't wait for more episodes of this series!

  • @robertharker
    @robertharker Před rokem +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!

  • @rGunti
    @rGunti Před 8 měsíci +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.

  • @gzoechi
    @gzoechi Před rokem +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

  • @Adrianvdh
    @Adrianvdh Před rokem

    Took you long enough! Finally, thank you sir 🎉

  • @dexterman6361
    @dexterman6361 Před 9 měsíci

    Thanks for the video!

  • @anothertijuano
    @anothertijuano Před rokem

    Great video as always

  • @sarundayo
    @sarundayo Před rokem

    Your thumbnail game is on point my dude

  • @Acceleratedpayloads
    @Acceleratedpayloads Před 5 měsíci

    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 Před rokem +2

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

  • @kaspersergej
    @kaspersergej Před rokem +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.

  • @maxarendorff6521
    @maxarendorff6521 Před rokem +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 Před rokem

    Nice! Thank you very much!

  • @lostolli7766
    @lostolli7766 Před rokem

    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?

  • @phandr1x
    @phandr1x Před rokem

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

  • @a.g8517
    @a.g8517 Před rokem

    great video

  • @edvardfranke
    @edvardfranke Před rokem

    Thx😊

  • @UntrackedEndorphins
    @UntrackedEndorphins Před rokem +2

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

  • @ambronhib5561
    @ambronhib5561 Před rokem

    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?

  • @secretcactus4717
    @secretcactus4717 Před rokem

    Nice!

  • @HugoParedes
    @HugoParedes Před rokem

    Pleeeeaase show your nvim setup. It looks so good

  • @maxnatamo
    @maxnatamo Před rokem

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

  • @alphenit
    @alphenit Před 11 měsíci

    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 Před rokem +4

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

    • @rc3043
      @rc3043 Před rokem

      better use steam OS :D :D :D

  • @VikramSoni2
    @VikramSoni2 Před 9 měsíci

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

  • @rajeshchaudhary883
    @rajeshchaudhary883 Před rokem

    8:23 what is that dashboard?

  • @ktdefron
    @ktdefron Před rokem

    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  Před rokem +1

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

    • @ktdefron
      @ktdefron Před rokem

      @@WolfgangsChannel awesome thanks!

  • @Xac501
    @Xac501 Před rokem

    I thought you switched to Unraid

  • @gitgudchannel
    @gitgudchannel Před rokem +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  Před rokem +1

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

  • @nicolassery5397
    @nicolassery5397 Před rokem

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

    • @WolfgangsChannel
      @WolfgangsChannel  Před rokem +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 Před rokem

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

  • @DrDingus
    @DrDingus Před rokem +1

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

  • @Bill_the_Red_Lichtie
    @Bill_the_Red_Lichtie Před rokem

    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 --> czcams.com/video/Z7p9-m4cimg/video.html

  • @IvanIvanov-qt6ik
    @IvanIvanov-qt6ik Před rokem

    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 Před rokem +1

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

  • @cinnamon4183
    @cinnamon4183 Před rokem +1

    sorry i havent watched even 30 seconds yet but bisexual lighting

  • @-blackcat-4749
    @-blackcat-4749 Před 5 měsíci

    That was 🔐 a unfailing episode. Nothing special

  • @affinitystablepeanuts
    @affinitystablepeanuts Před 10 dny

    Now this one is also "1 year ago"! Time to do another one ;) this time with terraform/opentofu.