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

Поделиться
HTML-код
  • Опубликовано: 11 июл 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
  • НаукаНаука

Комментарии • 63

  • @JeffGeerling
    @JeffGeerling Год назад +22

    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.

  • @Felix-ve9hs
    @Felix-ve9hs Год назад +31

    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 3 месяца назад +2

    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 4 месяца назад +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 :)

  • @FrankKumro
    @FrankKumro Год назад +11

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

  • @affinitystablepeanuts
    @affinitystablepeanuts Месяц назад

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

  • @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.

  • @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!

  • @robertharker
    @robertharker Год назад +2

    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 9 месяцев назад +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.

  • @WolfgangsChannel
    @WolfgangsChannel  Год назад +3

    Ansible Home Server playlist: ruclips.net/p/PLkxWXio1KmRoZd88WbrnSnQM5MJY5PjH2
    Code: github.com/notthebee/ansible_homeserver

    • @frisosmit8920
      @frisosmit8920 Год назад

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

  • @accik
    @accik Год назад

    Things to try out in the weekend, thanks!

  • @mopiranha
    @mopiranha Год назад

    Can't wait for more episodes of this series!

  • @Adrianvdh
    @Adrianvdh Год назад

    Took you long enough! Finally, thank you sir 🎉

  • @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

  • @anothertijuano
    @anothertijuano Год назад

    Great video as always

  • @dexterman6361
    @dexterman6361 10 месяцев назад

    Thanks for the video!

  • @sarundayo
    @sarundayo Год назад

    Your thumbnail game is on point my dude

  • @nichtgestalt
    @nichtgestalt Год назад

    Nice! Thank you very much!

  • @Acceleratedpayloads
    @Acceleratedpayloads 5 месяцев назад

    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

  • @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.

  • @a.g8517
    @a.g8517 Год назад

    great video

  • @user-kv9dw4tp3y
    @user-kv9dw4tp3y Год назад +2

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

  • @phandr1x
    @phandr1x Год назад

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

  • @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.

  • @secretcactus4717
    @secretcactus4717 Год назад

    Nice!

  • @edvardfranke
    @edvardfranke Год назад

    Thx😊

  • @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?

  • @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

  • @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?

  • @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

  • @maxnatamo
    @maxnatamo Год назад

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

  • @alphenit
    @alphenit Год назад

    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 ?

  • @VikramSoni2
    @VikramSoni2 10 месяцев назад

    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!

  • @rajeshchaudhary883
    @rajeshchaudhary883 Год назад

    8:23 what is that dashboard?

  • @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 😁

  • @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 :)

  • @-blackcat-4749
    @-blackcat-4749 6 месяцев назад

    Latter manifestation is normal. 📚 It happened again

  • @Xac501
    @Xac501 Год назад

    I thought you switched to Unraid

  • @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 --> ruclips.net/video/Z7p9-m4cimg/видео.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

  • @affinitystablepeanuts
    @affinitystablepeanuts Месяц назад

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