Update All Your Computers With Ansible - It's Easy!

  Рет қаралды 7,598

Jim's Garage

Jim's Garage

Күн бұрын

In this video, the third of the Ansible mini-series, I show how to update remote machines, with privilege escalation, using a playbook.
GitHub Commands:
github.com/JamesTurland/JimsG...
Ansible Documentation:
docs.ansible.com/ansible/late...
Recommended Hardware: github.com/JamesTurland/JimsG...
Support this channel to get access to perks:
/ @jims-garage
Discord: / discord
Twitter: / jimsgarage_
Reddit: / jims-garage
GitHub: github.com/JamesTurland/JimsG...
00:00 - Introduction to Playbooks
00:40 - Playbook Walkthrough
05:35 - Modifying Hosts File
07:34 - Ansible Command
08:20 - Ansible Execution
12:08 - Outro

Пікірлер: 35
@MarcMcMillin
@MarcMcMillin 3 ай бұрын
Hi Jim! Thanks for keeping your series' going. I know that algo isn't always friendly, but I appreciate the deeper dives into scripts and best practices! 🙂
@Jims-Garage
@Jims-Garage 3 ай бұрын
You're welcome, thanks for the continued support!
@camilla7118
@camilla7118 3 ай бұрын
Never used ansible before but i understood everything you explained. You're amazing at teaching 👍
@Jims-Garage
@Jims-Garage 3 ай бұрын
Hey, thanks. Appreciate your feedback
@BenThatOneGuy
@BenThatOneGuy 3 ай бұрын
Of all the other ansible series out there, this one feels like its making things make sense. For the first time im actually getting productive with Ansible. Through some inspiration here, some reading the docs, and tooling around, i was able to make an ansible playbook that deploys new VM's in Hetzner Cloud. Next step is variables, and references for secrets (Like API tokens), and some user-definable options in a separate file so that less experienced users have a "one file to change behavior" experience. Plan to share it soon, and hope those that want to use it can use it in conjunction with projects like this one :) Having a good time learning with Jim and the audience :)
@Jims-Garage
@Jims-Garage 3 ай бұрын
Thanks for the awesome feedback and great work with your own playbooks for VM deployment! That's a big milestone.
@MarcMcMillin
@MarcMcMillin 3 ай бұрын
FYI - For newer versions of ansible the get_md5 is deprecated and it's substitute is get_checksum=false. I just tested it with the playbook and it works great!
@Jims-Garage
@Jims-Garage 3 ай бұрын
Thanks, I'll have to update
@ff34jmr
@ff34jmr 3 ай бұрын
I have been using a similar playbook for years. I just added a line to remove unneeded packages and dependencies. Specially handy to remove old kernel versions for exemple.
@Jims-Garage
@Jims-Garage 3 ай бұрын
Thanks, I've added that to the GitHub.
@davidgulbransen6801
@davidgulbransen6801 3 ай бұрын
Agreed - our company patching automation always has an autoremove step, plus purging all but the new and previous kernels (leaving you one to fall back to in case the update goes badly)
@RobFisherUK
@RobFisherUK 2 ай бұрын
I want to do this on one machine, check if it comes back after the reboot, then do the others. But this is a useful starting point!
@cyberjohn44
@cyberjohn44 3 ай бұрын
Great Video. Need to do a video on Ansible-Semaphore.
@Jims-Garage
@Jims-Garage 3 ай бұрын
Yes, it's on the list. I prefer to peel back the covers and understand what's going on under the hood before simplifying with a gui
@BenThatOneGuy
@BenThatOneGuy 3 ай бұрын
@@Jims-Garage For Semaphore, its best to think of it as a CI plugin for Ansible, or "Cron" for ansible in a GUI. Semaphore didnt help me as much as i had hoped. the project has some rough edges, no in-browser editing, and no filesystem browser for the playbooks directory. It assumes a lot of previous experience and ansible knowledge. Its useful if you know your playbooks, and how they are layed out, but semaphore is definitely not a tool that will help in learning Ansible, its (from my experience) only a way to automate running books as "jobs" after you have your base playbook infrastructure set up. And also a nice GUI to read the logs of what happened when they ran.
@OutOfMySystem
@OutOfMySystem 3 ай бұрын
Locked in for this series.
@Jims-Garage
@Jims-Garage 3 ай бұрын
Thanks, lots more to come!
@shootinputin6332
@shootinputin6332 11 күн бұрын
Hi Jim, this worked great. I'll look into it, but it would be cool if you could specify a task to stop all docker containers before reboot and only commence reboot once all are stopped
@Jims-Garage
@Jims-Garage 11 күн бұрын
I believe the containers are stopped gracefully when you reboot as standard.
@chillgates_
@chillgates_ 3 ай бұрын
Jim I bought 4x 3090s with the confidence of watching your videos, appreciate it greatly! keep up the great work :D
@Jims-Garage
@Jims-Garage 3 ай бұрын
Wow, that's awesome! What are you using them for?
@bluesquadron593
@bluesquadron593 3 ай бұрын
@@Jims-Garageuncensored rendering of ai manga, thanks Jim indeed
@jdratlif
@jdratlif Ай бұрын
I'm curious how you record the VS code window. Are you using some kind of zoom during capture, or is it something you do during editing? It's very readable. I'm a fan.
@Jims-Garage
@Jims-Garage Ай бұрын
I use OBS to record, and simply press ctrl and + in vscode to zoom in.
@rodrimora
@rodrimora 3 ай бұрын
Hi! one question. What if I have a mix of debian based systems like rasperry pi's and ubuntu servers and RedHat-based systems? Can a single playbook work for both? or do I need one for each set of boxes?
@Jims-Garage
@Jims-Garage 3 ай бұрын
You'll typically want a task to check the OS. Then depending on the response it will run a different playbook or task. It's all possible from running a single command though. I'll come on to more advanced features. Essentially, you could use a when clause, "when os=RPI do something"
@jdratlif
@jdratlif Ай бұрын
Pretty sure the force_apt_get=yes isn't needed anymore as it's the default now. I think that option is largely legacy, but feel free to correct if I'm wrong.
@Jims-Garage
@Jims-Garage Ай бұрын
Yes, I believe it is legacy but just in case there's an edge case. I often find Ansible documentation could use some updates.
@Jimmy_Jones
@Jimmy_Jones 3 ай бұрын
It will be interesting to see where your network bottleneck will be. LTT just did a video on Internet speed bottlenecks.
@Jims-Garage
@Jims-Garage 3 ай бұрын
Great, I'll check that out. With 2.5Gb NICs and switch I should be fine. My firewall can handle 10Gb so I don't foresee any issues. I think LTT has 10Gb internet last time I checked which is a whole other level.
@tokar86a
@tokar86a 3 ай бұрын
Nice and good video. Is it a way that Ansible can tell you what package get updated on the machine?
@oliverolsen620
@oliverolsen620 3 ай бұрын
This is what I use. The part you're asking for starts at "register" below. - hosts: all become: true become_user: root tasks: - name: Update apt repo and cache on all Debian/Ubuntu servers apt: update_cache=yes force_apt_get=yes cache_valid_time=3600 - name: Upgrade all packages on servers apt: upgrade=dist force_apt_get=yes autoclean=yes register: result - name: List installed and updated packages shell: grep -E "^$(date +%Y-%m-%d).+ (install|upgrade) " /var/log/dpkg.log |cut -d " " -f 3-5 register: result - name: Show Output debug: msg="{{ result.stdout_lines }}"
@helioradial
@helioradial Ай бұрын
hi Jim, am trying to update some CentOS machines with no success. Any ideas?
@Jims-Garage
@Jims-Garage Ай бұрын
This won't work on cent os as it uses yum. You'll need to write a similar playbook using yum. It is supported by Ansible.
@helioradial
@helioradial Ай бұрын
@@Jims-Garage i've just had a stupid error but have managed to find a solution. was not able to patch the system successfully. working perfectly now. thank you for the quick answer! :)
Internet Upgrade Time, It's CRAZY Fast! (Nearly!)
12:32
Jim's Garage
Рет қаралды 6 М.
Deploy a Website With Ansible and Docker
15:51
Jim's Garage
Рет қаралды 4,4 М.
3 wheeler new bike fitting
00:19
Ruhul Shorts
Рет қаралды 45 МЛН
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 9 МЛН
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 88 МЛН
Deploy Docker & Portainer In Seconds Using Ansible!
19:26
Jim's Garage
Рет қаралды 5 М.
What are Smart Sensors?
2:27
Anzer: Answers for Electronic Manufacturing
Рет қаралды 170
This Should Have Been In CSS Years Ago
1:57
Dev Dive In
Рет қаралды 2 М.
Split A GPU Between Multiple Computers - Proxmox LXC (Unprivileged)
25:59
Ansible: Inventories, When, FQCN, and Multi OS Updates
16:29
Jim's Garage
Рет қаралды 3,7 М.
SSH Connections With Ansible - How To Create & Share SSH Keys
23:51
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 25 МЛН
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 3,2 МЛН
One To Three USB Convert
0:42
Edit Zone 1.8M views
Рет қаралды 441 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 46 МЛН
Мечта Каждого Геймера
0:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 1,6 МЛН
Нашел еще 70+ нововведений в iOS 18!
11:04