Automate EVERYTHING with Ansible! (Ansible for Beginners)

preview_player
Показать описание
Ansible. Need I say more? Well, maybe, if you've never heard of it. Ansible is a simple IT / DevOps automation that anyone can use. You can Automate anything with an SSH connection and WITHOUT installing any agents or clients. Join me as we set up, configure and start automating with Ansible!

See our collection of common homelab ansible playbooks here!

(Affiliate links may be included in this description. I may receive a small commission at no cost to you.)

00:00 - Intro
00:51 - The problem at hand
01:15 - What is Ansible? Ansible 101
01:35 - Ansible use cases
02:18 - Ansible requirements and setting up our workstation
03:22 - Ansible & SSH
04:02 - Ansible Inventory files
05:20 - Ansible module commands
06:18 - sshpass program
06:52 - What are you we going to automate now?
07:14 - Ansible Playbooks
07:48 - Ansible playbooks yml
08:04 - Create a playbook using the Ansible apt module
09:22 - command with ask-become-pass
10:05 - Execute our apt upgrade playbook
11:16 - Create a playbook to install software
13:06 - Create a playbook that uses a template with multiple tasks
15:56 - Execute our playbook that starts / stops / copies file
16:42 - My challenge to you!
17:12 - Do you use Ansible?
17:46 - Stream Highlights - It's overwhelming all of the knowledge I need...

#Ansible #Homelab #TechnoTim

"Hadron Collider" is from Harris Heller's album Ego.

Thank you for watching!
Рекомендации по теме
Комментарии
Автор

What will you automate with Ansible? Updates? Reboots? Software installs? Something else?

TechnoTim
Автор

I swear you somehow read minds or hacked Google algorithm and found my search about Ansible.
Just perfect timing. Thanks for the content!

horatiumarasescu
Автор

This is the automation software I didn’t know I needed. You’ve saved me countless hours remoting into VM’s and RPI’s to update on a weekly maintenance schedule! Thanks Tim!

MPADVISORY
Автор

Would love a part two where you use ssh keys only, have day #1 deployments (new infra), day #2 (maintain existing infra). I have dozen of scripts for day #1 and I’m looking for best practices. Thanks !

pnddesign
Автор

Dude, you've been killing it lately. I stumbled upon your channel a couple weeks ago, and it's amazing how similar our homelabs are. I haven't learned anything new yet, but I'm sticking around just in case. Keep up the good work, man!

jrucker
Автор

Thanks Tim! Ansible has been on my list to dig into for a while and this was clearly presented and easy to understand!

Mtbred
Автор

Bro you are literally a godsend. I've been updating all my servers like a peasant and now i can streamline this whole process! Keep up the fantastic work!

MrBigBoiChevy
Автор

I've been using ansible for years now. Automate machine deployments, updates, config changes, STIG compliance, auditing on and no and on. Awesome tool. Love your video.

beigebetty
Автор

I use Ansible in conjunction with Terraform to create a fictitious customer network of VMs. We use the range for Red Teaming and Cyber exercise practice. The last administrator retired, so now I have inherited this project and still have a lot to learn but it is fascinating and fun! I wish I had watched your video before I started looking at the ansible code but I feel it helped me understand your content better. Thanks for the video!

djmarkmax
Автор

I always wanted to learn Ansible, but all videos and websites were very complicated. You explained in a simple and didactic way what made me excited again to study. Congratulations on the great videos.

JeffersonEPessoa
Автор

This one of the easiest tutorial on youtube. Even I could follow it with any problems and that says alot. Great job!!

I created a playbook which updates all my servers.

tpasiUG
Автор

Dear Tim, thanks for your content, even though there are numerous great channels that do this kind of content there are only a handfull that present this in a interesting and engaging way. Most of the time I watch only the parts to get something running, but I watch all your videos from start to end!

pcfverbeek
Автор

Ansible is so freaking nice. Using it already for my C7000 blade center to setup the 10 blades as a proxmox cluster. Really game-changing ✨

cnema
Автор

Tim, thank you for taking the time to put this together for us. I really appreciate your teaching style and how you compartmentalize different tools and subjects the best you can. For example here you reference best practices via SSH keys, but chose not to go into it. I remember teaching myself about keys from Google and how it seemed like a huge deal at the time. Had that been included in this tutorial, many would have felt it to be overwhelming as you said. I am going to use your strategy of "containerizing" the subjects as I train my team in the future, thanks again.

robmartin
Автор

i loved the intro, I wasn't sure what ansible was. You grave a great overview, and then when into the technical. I got to learn what.I needed/wanted about ansible. I learned that it;s a cool tool for automating repetitive tasks, primarily for ssh tasks.

This is something that I'll never need, it was nice to bug out before the technical, knowing this will be an awesome video, just not my video. But I still throw in a like and this comment to make the interactions high!!! Because it was awesome that I got to not have to sit through technical, trying to figure out what the hell the tool does!!!

johngill
Автор

I would always see Ansible be mentioned on job applications, along with other qualifications I know I don't have. Seeing this video gave me a little more confidence in tech I've yet to understand. Thank you for that!

nacoly
Автор

Thank you so much sir. I was actually not sure why I'm not trying to learn this powerful tool.

mariembuenaventura
Автор

Great video, thanks. I started using Ansible a few months ago, it has been working very well. I have configured things slightly differently, I have used "roles" for each sort of thing I want to be on each system (web server, router, ssh, misc, etc.) and then control that via a playbook that pulls in the roles. For me the nice part about roles is I can have all the templates, config files, etc. all in the role directory of each role so I know what files belong to what role.

NikConwell
Автор

Great content, as usual!

The way you set the timesync configuration is great for ad-hoc runs, first time setup, or to run when you actually know the file changes. Also keeps it easy for first time learners, good job!

However I strongly believe we should be telling Ansible how we want our systems to be rather then what we want to be done (state vs execution)

If you use Ansible in a "keep state" fashion, the timezone task would unnecessarily restart the service every time you run the playbook.

A different practice would be to have a handler on the template, so it would trigger an action only when the file changes

Also, I'm not entirely sure you really need to stop the service before change the config file. I'm not familiar with timesync but generally you don't need to do that for Linux services, a restart (or reload sometimes) after changing the file is enough.

This is my suggestion on how to do that in an idempotent way:

tasks:
...
<stuff>
...
- name: Copy timesyncd config
template:
src: <src file, too lazy to copy yours>
dst: /etc/systemd/timesyncd.conf
notify:
- restart timesyncd

handlers:
- name: restart timesyncd
service: systemd-timesyncd
state: restarted

luisbnet
Автор

Nice introduction to Ansible. I've been doing some of these operations (apt update/upgrade, java check and install) automatically with a script language I've created. Writing code gives more flexibility, but also is more error-prone.

Ansible clearly is a good product, and supporting SSH both with key files and passwords is elegant. My homebrewn solution depends on key-files for SSH and updated /etc/sudoers for non-password sudo.

It would be nice if you post more videos about Ansible, and also let me give you an overall thanks for a lot of interesting topics on this channe (proxmox, freeNAS, kubernetes)!

ruprecht
join shbcf.ru