Ansible - Powerful Open Source system management and task automation tooling!

Published 2024-05-30
=== Links ===
Show Notes
wiki.opensourceisawesome.com/books/ansible-automat…

Ansible Series from Learn Linux TV
   • Getting started with Ansible 01 - Int...  

Get the AwesomeOpenSource Merchandise
awesomeopensource.creator-spr...

Support my Channel and ongoing efforts through Patreon:
patreon.com/awesomeopensource

Buy Me a Coffee or Beer
paypal.me/BrianMcGonagill?country.x=US&locale.x=en…

=== Timestamps ===
00:00 Beginning
00:08 Introduction to Ansible
04:04 Thank you to my Patrons over at Patreon
04:41 What You'll Need
06:18 Setup SSH Key Pair
09:31 Send SSH Keys to Target Machines
11:32 Install Ansible
13:22 Setup our Ansible Project Space
13:57 Setup Our Inventory File
20:22 Testing Ansible with Ansible-Ping
23:02 Make an Ansible Playbook

=== Contact ===
Twitter: @mickintx
Telegram: @MickInTx
Mastodon: @[email protected]

Try out SSDNodes VPS Services! Amazing Specs for incredibly low costs. I'm running a 32 GB RAM / $ CPU Server for only $9 a month! Seriously. FOr long term server usage, this is the way to go!
www.ssdnodes.com/manage/aff.php?aff=1011

Get a $50.00 credit for Digital Ocean by signing up with this link:
m.do.co/c/a6a61ae55242

Use Hover as your Domain Name Registrar to get some great control over you domains / sub-domains:
hover.com/SHPaiirr

Support my Channel and ongoing efforts through Patreon:
patreon.com/awesomeopensource

What does the money go to?
To Pay for Digital Ocean droplets, donations to open source projects I feature, any hardware I may need to purchase for future episodes (which I will then give to a subscriber in a drawing or contest).

All Comments (18)
  • @bugdozer314
    A few considerations. One, if you're using virtualization, build the pubkey into your base image, so you can clone or deploy a new VM and you get the keys being pre-installed for "free". This is scriptable on Proxmox. Two, another benefit to having things (machine configurations, not just actions like "upgrade apt") in Ansible is they are repeatable and idempotent. If there's any question about a configuration, just run Ansible again. Three, put all this Ansible configuration into git and you have a history of your previous settings should reverting to them become interesting. Your git repo becomes your "source", and makes it easy to move between workspaces. Great content as always. Lots to encourage here, well done.
  • @KenPryor
    Very helpful! I've used Ansible before and it was great. I only did basic stuff with it but I'm planning to add it to my homelab to learn more. Regarding Wazuh, I've been working with it a little lately. Some things are really easy, other things not so much. The basic setup is very easy and it works very well. I'm looking forward to your video on it!
  • @jeffherdz
    Ansible is a great tool for all you 're computers needs. Not only for the Linux/Unix world. But I use it in our Windows Environment here at work. We update 12 Linux servers, and over 300 Desktop computers and another 15 Windows ..2019 servers. Which Ansible really comes in handy when they ALL (Windows Servers/Desktop computers) need to be rebooted, after an update. Actually, they get rebooted once a month...regardless. They just turn to garbage if they are not rebooted once a month. Linux/Unix machines when a kernel update gets pushed. So once or twice a year.
  • @AndreasHanfelt
    Here is a tip for you that I stumbled upon, Defguard Wireguard 2fa open source project. Thanks for this video and all the other.
  • @BrianGiuffre
    A couple of pointers. When you use Become at the top level, that is saying EVERY playbook task is run elevated. Typically this isnt ideal as "most" tasks do not require elevation. At the individual task level, you can add become to run that specific task elevated. If your playbook requires every task in the playbook to be run elevated, putting it at the top level is sufficient, and you dont need to redundantly add it on the individual tasks. As a best practice, it is also recommended that you use FQDN for the modules you are running for the tasks, it helps with readability and identifying if a playbook that is shared requires additional galaxy roles/collections to be added (you didnt touch on these, but its important). IE: instead of apt, it should be ansible.builtin.apt and so on. You can also set a variable in your inventory to identify either by individual groups of hosts, or the entire inventory of hosts, which SSH key to use, so that you dont need to convolute your playbook run command.
  • I wish more businesses would use tools like Ansible instead of Microsoft top to bottom....
  • @bugdozer314
    Passphrases are easy and cheap. If you don't want to type the passphrase in for every use, you have two options. 1) use the ssh-agent, and typically all you really need to do in a usual Linux desktop environment is type "ssh-add" and enter the passphrase, which will add keys to the agent. It'll be available and not requested again for the duration of that logged in desktop session. Note, you can also "give up" the credential when you're done. 2) use control-master in ssh config. This will activate a persistent ssh session (definable), so you don't then need to re-establish connection details. This MAY NOT help you much at all in this ansible case (each connection to a new target host would still require establishing a connection), however, if you have a bunch of playbooks against a small number of hosts, it may be a net win in terms of not typing passwords, and it may also be a net win in terms of time by re-using established sessions were possible. I do both.
  • @Sam-oz8tw
    Great video! Some feedback. Because ssh keys are so ubiquitous and documentation is literally everywhere, I wish you would have spent those 5 minutes walking through your lxd install. If you are going to skip something to make a video shorter, let it be ssh key pairs. But otherwise, great. Personal preference. Thank you!
  • @jhonyortiz5
    If you soend a considerable amount of time configuring your laptop or pc, especially developers that need to setup development environments, ansible is great. I use it to setup my laptop and pc. Ansible can handle differences pretty well. Its something better than a bunch of bash scripts but its also not NixOs. My understanding is that NixOs is more concerned with reproducible buils. Ansible cares more about declarative automation. So ansible is not as flexible but makes automation very easy to understand.
  • @ws_stelzi79
    By the way from the man-page off ssh-keygen "The type of key to be generated is specified with the -t option. If invoked without any arguments, ssh-keygen will generate an Ed25519 key." But I think that is a fairly recent thing. 1 or 2 versions they used the more insecure RSA.
  • @jaqrab
    An idea for a future video, are there any open source business rule engines that might be added to your MSP series.
  • It it a good option to clone the system to another machine or should I use clonezilla?
  • @CC-rk4zx
    Thanks for the Video. One question: Public SSH key wasn‘t Set up with passphrase. So if a Client got hacked and the Hacker has the public key they could login to the server without anything else, right?