Getting started with Ansible 14 - Roles

  Рет қаралды 75,968

Learn Linux TV

Learn Linux TV

Күн бұрын

Ansible is an incredible configuration management and provisioning utility that enables you to automate all the things. In this series, you'll learn everything you need to know in order to use Ansible for your day-to-day administration duties. In video 14, we get started on roles. Roles in Ansible is one of its most amazing features, that allows you to categorize your hosts based on their intended purpose.
Full series:
Part 1 (Introduction): linux.video/an...
Part 2 (SSH Overview & Setup): linux.video/an...
Part 3 (Setting up the Git Repository): linux.video/an...
Part 4 (Running Commands): linux.video/an...
Part 5 (Running Elevated Commands): linux.video/an...
Part 6 (Writing our First Playbook): linux.video/an...
Part 7 (The 'when' Conditional): linux.video/an...
Part 8 (Improving your Playbook): linux.video/an...
Part 9 (Targeting Specific Nodes): linux.video/an...
Part 10 (Tags): linux.video/an...
Part 11 (Managing Files): linux.video/an...
Part 12 (Managing Services): linux.video/an...
Part 13 (Adding Users): linux.video/an...
Part 14 (Roles): This video
Part 15 (Host Variables): linux.video/an...
Part 16 (Templates): linux.video/an...
🙌 Support me on Patreon and get early access to new content!
➡️ learnlinux.lin...
Wiki article for this video:
www.learnlinux...
🛒 Affiliate store for Linux compatible hardware/accessories (commission earned):
➡️ learnlinux.lin...
💻 Check out the Tiny Pilot KVM for your Homelab (commission earned):
➡️ learnlinux.lin...
🐦 Follow me on Twitter!
➡️ learnlinux.lin...
💬 Official LearnLinux.tv Community:
➡️ community.lear...
📖 Check out jay's latest book, Mastering Ubuntu Server 3rd Edition. Available now!
➡️ ubuntuserverbo...
👨 More about me:
➡️ www.jaylacroix...
➡️ www.learnlinux...
💽 How to create a bootable flash drive for installing Linux:
➡️ linux.video/fl...
🐧 Which distro do I use?
➡️ learnlinux.lin...
🔐 How to better secure OpenSSH:
➡️ linux.video/se...
☁️ How to create a cloud Linux server with Linode:
➡️ learnlinux.lin...
#Ansilbe #AnsibleCourse #AnsibleLinux

Пікірлер: 56
@needMoreInput
@needMoreInput Жыл бұрын
Just a lil tip for making all the folders and files for the structure in his example. Be inside the roles folder and type: mkdir -p {base,db_servers,web_servers,workstations,file_servers}/tasks This will make each folder in curly brackets contains a tasks folder in each.
@MarkusEicher70
@MarkusEicher70 Жыл бұрын
Thanks for the handy tip, Ryan. 🤛
@magnuslator4719
@magnuslator4719 Жыл бұрын
Thanks for the tip. From the project root folder, the following command can be run to create the roles folder and sub-folders: mkdir -p roles/{base,db_servers,web_servers,workstations,file_servers}/tasks
@bfrd9k
@bfrd9k 4 ай бұрын
for role in base db web workstation file ; do ansible-galaxy role init --offline "${role}" ; done
@rafal9ck817
@rafal9ck817 2 ай бұрын
can also do mkdir roles/{base,db_servers,file_servers,web_servers,workstations} ; cd roles ; for i in * ; do mkdir "$i/tasks" ; done ; cd - from repo root
@jacksoncremean1664
@jacksoncremean1664 9 ай бұрын
I always love how you break things down give people the basic tools they need to get started to then play around and familiarize themselves with the tool top quality as always!
@fabrice9848
@fabrice9848 Жыл бұрын
You're an excellent teacher, and a perfect example of how the FOSS philosophy makes the world a better place.
@MCSMIK
@MCSMIK Жыл бұрын
This is probably the first new thing that I did in ansible after watching this video, which actually worked the first time. Really appreciate your effort in making this series!
@bluekornchips
@bluekornchips Жыл бұрын
Fantastic video. I gave a take home assignment for Ansible and your video series is a life saver. Easy to understand, well spoken, and explains concepts immediately when questions may arise. Thank you!
@ice_tee
@ice_tee 2 жыл бұрын
I was wandering here and there trying to learn proper execution of ansible and my search ended here. Slow, practical explanation and each and every step explained. Thank you so much for this !!!
@MarkusEicher70
@MarkusEicher70 Жыл бұрын
Cool stuff, Jay! Thanks for another great part in this series. That makes a much better structure and allows to define custom roles I need in my setup. Now I can't wait to see the further improvements of using host variables. This series was a blast so far! 💪
@LearnLinuxTV
@LearnLinuxTV Жыл бұрын
Glad you enjoyed it!
@dono42
@dono42 3 ай бұрын
Why not simply use "ansible-galaxy init " to setup the folder structure for roles?
@jaecheokkim99
@jaecheokkim99 Жыл бұрын
Jay. thank you for every videos :) it's definitely best ansible tutorial video.
@jhred3315
@jhred3315 2 жыл бұрын
Definitely clear my confusion about role! Thank you so much!
@hideyukikanazawa2761
@hideyukikanazawa2761 3 жыл бұрын
Very nice and concise explanation for a not so intuitive topic.
@vialomur__vialomur5682
@vialomur__vialomur5682 Жыл бұрын
The best series! This is great!
@jgranahan
@jgranahan 4 жыл бұрын
Really great, Jay. This brings a lot together, letting me hone my TMUX and VIM skills as well!! Love it!
@name1355_0ne
@name1355_0ne Жыл бұрын
Thank you very much for the explanation!
@mathewkargarzadeh3158
@mathewkargarzadeh3158 3 жыл бұрын
Thank you Jay !!!. gratitude to you.
@cruepprich
@cruepprich 3 жыл бұрын
Excellent, as all the other videos in this series. Thanks!
@ThePandaGuitar
@ThePandaGuitar 3 жыл бұрын
Clearly explained and easy to follow. Thank you very much!
@shivakarki6887
@shivakarki6887 3 жыл бұрын
You have been very helpful, thank you sir. I wish to learn Jenkins from you too, someday.
@stalinengoma7680
@stalinengoma7680 3 жыл бұрын
Excellente vidéo. I’m speechless
@debadutta75
@debadutta75 Жыл бұрын
You are excellent Jay
@muksyed
@muksyed 2 жыл бұрын
Hi Jay. Great videos. BTW, IMHO the “tree” command helps to see the entire role structure.
@mysydney71
@mysydney71 9 ай бұрын
best Ansible roles explanation/example I have ever seen
@randzioful
@randzioful 3 жыл бұрын
/> mkdir -p roles/{first_role,second_role,third_role}/tasks
@johannesmauser5465
@johannesmauser5465 4 ай бұрын
very good video :) Worked first time
@ayencoscolfield3312
@ayencoscolfield3312 Жыл бұрын
Thank so much cant really thank you enough, you rock man
@MrDominique1992
@MrDominique1992 Жыл бұрын
So nobody knows the command ansible-galaxy? It creates all the role folder/subfolders/files in one command
@majorgear1021
@majorgear1021 2 жыл бұрын
Well done! Btw, I notice you have a System76 linux laptop. Have you done any videos about it? From purchase to setting it up, to features of both the laptop and popos? I’m currently a Mac user, As more and more apps go subscription, I’m thinking about switching to Linux as my daily driver instead of just a server OS.
@JamesGreen-gv4yn
@JamesGreen-gv4yn Жыл бұрын
I find it interesting that you start by making a copy so that you have the original when that is precisely why you are using 'git'. You can go back to the original or see your change at any time by using the git commands.
@arunkumarkt8730
@arunkumarkt8730 3 жыл бұрын
superb explanation. Thanks a lot sir.
@hamidja1537
@hamidja1537 Жыл бұрын
Thanks for sharing
@samsonwong2397
@samsonwong2397 3 жыл бұрын
excellent explanation
@miladvaziri3
@miladvaziri3 2 жыл бұрын
so useful, thanks for teaching me
@SoulJah876
@SoulJah876 2 жыл бұрын
This all worked with me leaving my html file inside the original files folder.
@tsushima33
@tsushima33 3 жыл бұрын
Great, easy to follow
@petermuia9519
@petermuia9519 Жыл бұрын
Hi Jay, I have religiously been following all the steps in all your labs for this Ansible series & have one query. After all the additions: copying & pasting into the relevant main.yml. Does one then remove the plays in the site.yml file that correspond to these copy & pastes. I took the liberty of removing these plays in my site.yml file & when I ran the new site.yml file, I got results not similar to your's. Example apache2 was installed on the other Ubuntu servers. To reiterate, until this Roles lab, all my previous labs corresponding to yours generate all results like your's
@gurlalsidhu2503
@gurlalsidhu2503 3 жыл бұрын
not just ansible, i got to learn linux too :)
@AkebonoRadio
@AkebonoRadio 3 жыл бұрын
Thanks Jay!!!
@mihai6564
@mihai6564 2 жыл бұрын
thanks for the video
@nixoncoronado5558
@nixoncoronado5558 2 жыл бұрын
Hello Jay, I want to create different roles to get status, start and stop supervisorctl. I would like to ask if possible to create one yml file to execute all those roles?
@NH-ly7zc
@NH-ly7zc 2 жыл бұрын
Thank you
@Peet0103
@Peet0103 Жыл бұрын
I understand now
@karobarc
@karobarc Жыл бұрын
i dont see the code for adding roles here
@JackReacher1
@JackReacher1 3 жыл бұрын
Liked it
@tjbredow
@tjbredow 2 жыл бұрын
You must be very patient to do this all in nano.
@pralaybagde4804
@pralaybagde4804 3 жыл бұрын
Can u plz tell me , how to execute .sh file in ansible roles .
@rohitreddy578
@rohitreddy578 3 жыл бұрын
- name: script execution command: sh /home/script.sh
@miyalys
@miyalys 2 жыл бұрын
explicitly calling sh should not be necessary if the hashbang line is set?
@dylanevans2732
@dylanevans2732 3 жыл бұрын
Thanks. You spelled vim wrong.
@fabrice9848
@fabrice9848 Жыл бұрын
Seeing you using nano when you'd rather use vim is truly painful!
@alexanderpoplawski577
@alexanderpoplawski577 3 жыл бұрын
Great series! I can't see the role where the user simone is created, like in the site_before_roles.yml. Did I miss that? EDIT: Found it, it is in the bootstrap.yml.
@hamidja1537
@hamidja1537 Жыл бұрын
Thanks for sharing
Getting started with Ansible 15 - Host Variables and Handlers
16:58
Learn Linux TV
Рет қаралды 43 М.
Linux New User Guide: 10 Things I Wish I Knew
23:31
Learn Linux TV
Рет қаралды 470 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 10 МЛН
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 33 МЛН
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 80 МЛН
Things I wish I knew about Ansible from day 1
10:58
Michael Crilly
Рет қаралды 6 М.
Getting started with Ansible 12 - Managing Services
21:14
Learn Linux TV
Рет қаралды 41 М.
What is Ansible | Ansible Playbook explained | Ansible Tutorial for Beginners
16:41
you need to learn Ansible RIGHT NOW!! (Linux Automation)
21:21
NetworkChuck
Рет қаралды 880 М.
Automate EVERYTHING with Ansible! (Ansible for Beginners)
18:31
Techno Tim
Рет қаралды 239 М.
Problems You will Encounter on Linux (and How to Solve Them)
23:01
Rob Braxman Tech
Рет қаралды 105 М.
Titus Reacts to Linus Tech Tips Linux Daily Drive Challenge
20:21
Chris Titus Tech
Рет қаралды 760 М.
Getting started with Ansible 13 - Adding Users & Bootstrapping
24:35
Learn Linux TV
Рет қаралды 47 М.
🕊️Valera🕊️
00:34
DO$HIK
Рет қаралды 10 МЛН