Using Ansible to automate your Laptop and Desktop configs!

  Рет қаралды 96,244

Learn Linux TV

Learn Linux TV

3 жыл бұрын

You guys asked for it, now I finally deliver - in this video I show you how to use Ansible to configure your laptops and desktops! This works for servers too. This is a long video, but should get you on your way. You'll see a few working examples, and by the end of the video, you will have your very own Ansible desktop/laptop config!
*Time Codes*:
2:29: Notes about my config
17:22: Setting up a Git repo
29:52: Creating the Playbook
📖 Check out Jay's latest book, Mastering Ubuntu Server 4th Edition. Covers Ubuntu 22.04!
➡️ ubuntuserverbook.com
☁️ Wiki article for this video:
➡️ www.learnlinux.tv/using-ansib...
☁️ Here's the Github repo for the code in this video:
➡️ github.com/LearnLinuxTV/ansib...
☁️ Github copy of my personal Ansible settings:
➡️ github.com/LearnLinuxTV/perso...
🙌 Support me on Patreon and get early access to new content!
➡️ learnlinux.link/patron
☁️ Get $100 toward your own cloud server with Linode!
➡️ linode.com/learnlinuxtv
🛒 Affiliate store for Linux compatible hardware/accessories (commission earned):
➡️ learnlinux.link/amazon
💻 Check out the Tiny Pilot KVM for your Homelab (commission earned):
➡️ learnlinux.link/tinypilot
🐦 Follow me on Twitter!
➡️ learnlinux.link/twitter
💬 Official LearnLinux.tv Community:
➡️ community.learnlinux.tv
💽 How to create a bootable flash drive for installing Linux
➡️ linux.video/flash-usb
🐧 Which distro do I use?
➡️ learnlinux.link/mydistro
🔐 How to better secure OpenSSH:
➡️ linux.video/secure-ssh
☁️ How to create a cloud Linux server with Linode:
➡️ learnlinux.link/create-linode
👨 More about me:
➡️ www.jaylacroix.com
➡️ www.learnlinux.tv/about-me
#LearnLinuxTV #Linux

Пікірлер: 142
@DementiaAcerbus
@DementiaAcerbus 3 жыл бұрын
Another very helpful one for the homelab thank you!
@rdwatson
@rdwatson 3 жыл бұрын
Good practical in-depth tutorial. I've messed with Ansible before for ad-hoc commands but never dug into it. This gave me some ideas.
@dimaspangestu4450
@dimaspangestu4450 Жыл бұрын
Huge thanks Jay to made this tutorial very clean and understandable for a beginners.
@rahilarious
@rahilarious 3 жыл бұрын
Great tutorial to show potential of Ansible. Thanks so much. Currently I have 2 git repositories, one for dotfiles in home and other for system configs for /. With ansible config I could just make one repo with all cfgs in one place and it would work everywhere.
@isofruitfruit9357
@isofruitfruit9357 3 жыл бұрын
That was an absolutely fantastic introduction and really wet my beak on what is possible with ansible. I'll be sure to check out your ansible course, thank you so much for taking the time to do this and do it properly, slowly and understandably. It's people like you that help improve this world so much and driving technology through teaching!
@danielsonuk7171
@danielsonuk7171 3 жыл бұрын
Another quality informative tech video. I'm progressing by leaps and bounds with these concise video guides, after struggling on with books or crappy guides. Thanks again
@kristopherleslie8343
@kristopherleslie8343 3 жыл бұрын
I honestly gave up on the books!
@biscuitbaker8693
@biscuitbaker8693 2 жыл бұрын
This is awesome! Thanks for sharing!
@bits2646
@bits2646 3 жыл бұрын
Nice, was great to refresh knowledge, been using it a really really long time ago, but then switched to macos completely for some reason, but now I am without a single macos device, so I'm back to Linux (and some Wins...), so great to dip the toes again..
@deanwaters
@deanwaters 3 жыл бұрын
Jay thanks for the video, it will come in very handy you are the true MVP
@alessandrorossi2164
@alessandrorossi2164 6 ай бұрын
amazing content and quality! Thank you!
@SB-qm5wg
@SB-qm5wg 3 жыл бұрын
Great video. TY for filling in the gaps.
@coertdeneve7567
@coertdeneve7567 3 жыл бұрын
Wow, thanks for sharing Jay! This is great stuff!
@_oly_241
@_oly_241 2 жыл бұрын
Absolutely fantastic video!
@mkro6510
@mkro6510 3 жыл бұрын
Thank you for plus sizing the terminal text.
@riverwolf2174
@riverwolf2174 3 жыл бұрын
Thanks for posting!
@yekutielbenheshel354
@yekutielbenheshel354 2 жыл бұрын
Excellent video. Thank you!
@hakovatube
@hakovatube 3 жыл бұрын
Thank you for sharing your ideas and set ups, as well as your scripts/choices both as examples and as inspirations.
@aritra1414
@aritra1414 2 жыл бұрын
This one was awesome!!
@marcalleaume1853
@marcalleaume1853 3 жыл бұрын
Very interesting video. Always enlightening. Bravo et merci beaucoup.
@ForrestRhoads
@ForrestRhoads 3 жыл бұрын
Awesome tutorial, carefully, thoroughly and clearly done. Thank you.
@victornoagbodji
@victornoagbodji 3 жыл бұрын
😊 😊 🙏 thanks for sharing this presentation
@hexearth8258
@hexearth8258 3 жыл бұрын
More ansible would be great. Thanks.
@juhapenttila5733
@juhapenttila5733 3 жыл бұрын
Very nice! Time to fire up a VM to try this!
@N3cr0m4ncer
@N3cr0m4ncer 3 жыл бұрын
I also manage my desktop / notebook config since almost two years. It's great and was my preferred choice because I use ansible on a daily base. The templating and all other modules are awesome
@N3cr0m4ncer
@N3cr0m4ncer 3 жыл бұрын
Btw. I use Arch 😂
@N3cr0m4ncer
@N3cr0m4ncer 3 жыл бұрын
Oh,and one link in the video description seems to be wrong. I think it should be github.com/LearnLinuxTV/personal_ansible_desktop_configs
@LearnLinuxTV
@LearnLinuxTV 3 жыл бұрын
@@N3cr0m4ncer Thanks, fixed!
@MrNoBSgiven
@MrNoBSgiven 3 жыл бұрын
Thank you very much. This is very impres8ve and useful.
@EdgardMello
@EdgardMello Жыл бұрын
This is a really good learning channel.
@Mario-vt2ss
@Mario-vt2ss 2 жыл бұрын
Amazing, thank you.
@Frustrated_Programmer13
@Frustrated_Programmer13 5 ай бұрын
I need to see this again.
@1edgararias
@1edgararias 3 жыл бұрын
This was cool. Thanks
@mawortz
@mawortz 2 жыл бұрын
so glad I found this channel
@princemarkied8071
@princemarkied8071 3 ай бұрын
SOOOO much fun!
@fuatkaradeniz
@fuatkaradeniz 3 жыл бұрын
Thank you Jay. I have learned a lot from your videos. And my suggestion would be making a series about Puppet configuration management. Thanks again. My best wishes to you.
@evadeflow
@evadeflow 3 жыл бұрын
Seconded! Or perhaps a compare-/contrast-style video such as "Why I switched from Puppet to Ansible" (if that's an accurate assumption on my part), or maybe: "Pros and Cons of Ansible vs Puppet for IT Orchestration". I have only ever used Ansible. The one time I looked into Puppet, I couldn't get past some of the confusing nomenclature ( i.e., 'Masterless Puppet'[??]) so I don't think I gave it a real chance. Since then, I've become a huge fan of Omnibus Gitlab, which (if I'm not mistaken) uses Puppet for installation/upgrades. I've been really impressed at how bullet-proof the Omnibus Gitlab upgrade process has been, so... Puppet seems pretty legit. Are people using Ansible for such things? If I already know Ansible well, is there any benefit to learning Puppet, too?
@fuatkaradeniz
@fuatkaradeniz 3 жыл бұрын
@@evadeflow Puppet is going to give people more perspective about automation by comparing two tools trying to achieve same purpose using different tools and methods. I know Jay is so much into Ansible. And this is a chance to prove his point. And let people decide for themselves. We should not confine ourselves into certain platforms and tools, which is an hindrance to innovation and progress. We should all do our part to democratize our environments and platforms in any way possible, be it a natural or virtual environment/platform. This is how I think and everybody has a right to his/her own. Long live "freedom of expression".
@sethalump
@sethalump 3 жыл бұрын
Always love learning new Ansible tricks. Thank you!
@AndreasLienemann
@AndreasLienemann 3 жыл бұрын
Jay, what a helpful walk-through! Very clear instructions. Thank you. I have come across a problem however. When I run Ansible, it returns an error because "usr/share/backgrounds/" apparently doesn't exist on my system. I run PopOS! 20.04 stock, no modifications at all, so I'm not quite sure why that folder doesn't exist nor what I should do about it. Everything else works flawlessly according to the instructions in your video.
@andreabisio
@andreabisio 3 жыл бұрын
Hi Jay awesome video! Have you any suggestions to automate configuration for kde plasma?
@Chase07450
@Chase07450 3 жыл бұрын
Love your work. The dconf module did not work for me at first, but figured it out?
@arshamrezaei8918
@arshamrezaei8918 3 жыл бұрын
thanks for this great tutorial ;}
@greob
@greob 3 жыл бұрын
Interesting. Thanks for sharing!
@ahmetcan4533
@ahmetcan4533 3 жыл бұрын
well, it was a journey for me , thanks
@TheRowie75
@TheRowie75 3 жыл бұрын
Jay, you are my HERO!!!!! AWESOME Tutorial
@williamseipp9691
@williamseipp9691 3 жыл бұрын
anyone who doesn't understand how important dotfiles are doesn't understand what it feels like to lose them. Lost sleep. Turning Adele's songs up on the radio. Drinking heavily. It's serious business.
@blank001
@blank001 Жыл бұрын
Thankfully I didn't had to face this situations, lets hope I'll never will be.
@ronnierush9379
@ronnierush9379 3 жыл бұрын
Great Video and very clever Thank you:-)
@LearnLinuxTV
@LearnLinuxTV 3 жыл бұрын
Glad you liked it!
@FahadKhan-fq4zw
@FahadKhan-fq4zw Жыл бұрын
Great tutorial , wondering if you have any video or if you can do one for Windows OS. Thanks
@myproject6753
@myproject6753 3 жыл бұрын
Great Tutorial - like always!! I will definitely try it out ...it's "awesome" :-))
@amirsadaghdar3482
@amirsadaghdar3482 2 жыл бұрын
Thank you Jay! Awesome content as always!
@tonythell
@tonythell 3 жыл бұрын
Not to be one of those guys that say, "Ummm, actually...", while pushing my glasses up the bridge of my nose, but...to clarify, there is not really such a thing as an Ansible "server". Ansible playbooks and ad-hoc commands are run from a "control node". An Ansible control node can be *any* system that has Ansible installed on it, including your local desktop/laptop. While I understood your reference, someone who is new to Ansible, but has experience with other servers (eg. web, database, etc...) might not see the difference and think they would need to build out a system specifically to run Ansible.
@kristopherleslie8343
@kristopherleslie8343 3 жыл бұрын
I thought there was Ansible tower
@cosmicspawn6647
@cosmicspawn6647 5 ай бұрын
I have now seen all of your Ansible videos. WOW - it's amazing what a powerful tool Ansible is. But can you tell us what happens when a user input is required? For example, a query from the system during an update.
@garychap8384
@garychap8384 3 жыл бұрын
I use a Xen cluster. I just clone new machines from any store point on any existing machine. It's considerably less work. I can decide to clone it configured and running, part configured, just the base after updates, the original first-boot config... or anywhere I've set a savepoint. I can also fork running machines, to try new configs out... so, the tree for each machine/role is literally full of options. That takes care of the ansible functionality. But I can also migrate running machines across hardware without stopping them, which is a godsend when you need to take a server down for service. I'd say that if you can use a Xenserver, it'll take a lot of the pain out of deployment and administration. If not, ansible is a fine tool for those long deployment chores that eat up your day : /
@benjaminkania581
@benjaminkania581 3 жыл бұрын
The idea is really great. It works even with Windows clients. Thank you very much for sharing. One thing though ... I believe the bootstrapping script you used would be useful to add to the repo as a reference. Once again, thank you!
@DSLDude
@DSLDude 3 жыл бұрын
Would also love to see the deploy/bootstrap script
@madrag
@madrag 3 жыл бұрын
Nice vid, thx! So now.. Can you make a more advanced one with variables, roles very very similar to your setup @ lab ?. Also, how to make this ansible-pull and cron job with private repo?
@emberavenge7162
@emberavenge7162 3 жыл бұрын
For Mobile viewers: Individual sections (copy pasted from the description): 2:29: Notes about my config 17:22: Setting up a Git repo 29:52: Creating the Playbook
@AnzanHoshinRoshi
@AnzanHoshinRoshi 3 жыл бұрын
Thank you, Jay.
@stoneytech5434
@stoneytech5434 3 жыл бұрын
Jay - This video was very helpful. It really helps someone like me who is "distro-hopping" I was wondering what module to use to configure KDE Plasma desktop. Could you please point me to it? Thank you.
@lkm75
@lkm75 2 жыл бұрын
Excellent tutorial, I've only been using Linux for about a week and never heard of ansible. Getting a peek at that bootstrap file would be great... However when I think about it. It has to install git and ansible, also I'm guessing it creates the .ssh directory and associated permissions 600 and copies an ssh private key and creates and writes an entry in the known_hosts file. Am I on the right track with that?
@lptechCT
@lptechCT 2 жыл бұрын
Hey Jay, First thanks for the video, really nice serie. Now here is my question: I am running lxc containers in my proxmox, can you please make a video showing how to manage containers via Ansible? I try to do it but I am getting erros since the containers doesn’t allow me to run sudo with ansibleadmin user. Any advice? Thanks in advance.
@oleholgerson3416
@oleholgerson3416 3 жыл бұрын
Super helpful, thank you!
@Apfelloch
@Apfelloch Жыл бұрын
9:56 I like that idea of having a central point where you keep all your current Git repos. How exactly does your workflow look when working from a computer and accessing the "remote" repos on the Pi? Do you already have a video about this?
@add1989
@add1989 8 ай бұрын
Hi Jay, Is there any chance you could post a link to the bash bootstrap script you use? I get you might need to take parts out but I'm just interested to see what steps you are performing other than apt install ansible
@misium
@misium 3 жыл бұрын
30:00 - skip to the Ansible stuff
@nahum35
@nahum35 3 жыл бұрын
Great video as always :) ...Just wanted to ask how do i deploy the playbook if i have 5 Ansible clients? in this video, you used only 1 client machine. i'll be very grateful if you'll reply to this post.
@theena
@theena 3 жыл бұрын
Relative Linux noob here but I've been wondering if it's possible to export one of my install's configs to another - it's like you read my mind. Can I ask how long it takes for a new machine to pull the playbook and install everything you want? I am going to start working on one for my own. Thank you. You teach so well.
@ahmedshaarawy1471
@ahmedshaarawy1471 3 жыл бұрын
Great Video , but i need urgently to know how to automate joining domain computers to specified domain groups !?
@simbaclaws_youtube
@simbaclaws_youtube 3 жыл бұрын
Hi Jay, I have a question: would you know how to copy wallpapers that are part of the git repository as a submodule? Suppose I have a few git repositories that I want to put inside of my ansible playbook repository, what can I use from ansible to copy those files from those submodules to the correct folders? I'm using this to keep track of some wallpaper repositories that I made. I'm currently trying to do: - name: copy wallpapers copy: src: files/wallpapers/* dest: /usr/share/backgrounds owner: root group: root where the submodule git repositories are named: linux-wallpapers flat-wallpapers etc with their own wallpaper files inside of files/wallpapers/linux-wallpapers and files/wallpapers/flat-wallpapers respectively. These settings are failing and it's telling me to use remote_src.
@jorgesisco981
@jorgesisco981 4 ай бұрын
May I know how did you set vim to open file in that text editor? when I do I I see just the classic vim window inside the terminal.
@AlexanderSkwar
@AlexanderSkwar 2 жыл бұрын
Could you maybe also provide the bootstrap file shown in 6:08?
@simbaclaws_youtube
@simbaclaws_youtube Жыл бұрын
Is there a way to make ansible-pull work from within WSL2 inside a windows machine to provision a windows workstation?
@AlokParlikar
@AlokParlikar 3 жыл бұрын
Thanks, Jay! If I had some differences between how I setup my laptop and desktop (e.g. nfs mounts only in the fstab of desktops) what's the best way to tell ansible/pull what type of setup to perform on localhost? Tags? Roles? Different playbooks? Something else?
@LearnLinuxTV
@LearnLinuxTV 3 жыл бұрын
Take a look at the copy of my personal configs that I added to the description. I use a combination of host_vars and a hosts file for this, so that way if a machine has a specific hostname, it gets specific variables. Then I make several items as variables.
@danielschempf2298
@danielschempf2298 3 жыл бұрын
Thank you very much! Really helpful. Is it with ansible-pull also posible to use a private git repo. I have mine by Strato and cannot access it via https but only via ssh
@Dark_Lobster
@Dark_Lobster 3 жыл бұрын
You can use private repos, yes. Create a personal access token first: docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token. Example use: export OAUTH_TOKEN=1234; ansible-pull -U $OAUTH_TOKEN:x-oauth-basic@github.com/private-repo
@thekillbreathfamily7371
@thekillbreathfamily7371 3 жыл бұрын
at 07:36, how did you get the unicorn in the terminal?
@danvokt5539
@danvokt5539 2 жыл бұрын
Jay, TL;DR Cannot seem to get the ansible-pull aspect of things working. Repo does not have HTTPS only SSH. I have a GitoLite server that I have been using for ages. It has my dot files repository on it that I am slowly trying to convert over to Ansible. Since I have already automated many processes with a bunch of crazy scripts and whatnot I already have keys set up and other necessary accouterments. Works just fine scriptwise. I started to begin to evolve it into something similar to what you have and so far things have been going okay. THE PROBLEM: everything runs fine when I use the Ansible Playbook command (I've set my hosts file and various other goodies in a local ansible.cfg file). However, though I've read the docs, I cannot seem to figure out how to use an SSH based URL instead of an HTTPS URL. Or heaven forbid that the internet goes down and I want several servers to update from a local network or even a file share. Can this be done. Or do I have to modify my GitoLite server to be able to serve HTTPS and how can I keep that secure?
@eliaspizarro0015
@eliaspizarro0015 3 ай бұрын
there are an asible like for windows?
@ThePsyForce
@ThePsyForce 3 жыл бұрын
I think this will be my motivation to learn Ansible more deeply. I have a bash script to set up my dot files, but this is far more extensible. I just have a question about the velociraptor root user. Are there any security concerns regarding a root user running with no password? Or does running with no password also mean it's not available for an interactive login? I suspect you've already thought this through, but you didn't mention it in the video.
@Knirin
@Knirin Жыл бұрын
Normally root doesn’t have no password. They have a disabled password. This is a * in their password field in /etc/passwd or /etc/shadow. This disables console password login and ssh password logins. No password is more accurately a blank password. Which in a non PAM system will allow a login without requesting a password. The modern PAM default is to treat a blank password as a lockout and deny login.
@ThePsyForce
@ThePsyForce Жыл бұрын
@@Knirin Thanks for the clarification!
@camerontgore
@camerontgore 3 жыл бұрын
26:20 How is this (ssh) different than using the regular git clone method where you just use the git URL?
@jordanallison7105
@jordanallison7105 3 жыл бұрын
When you manually added the wallpaper and the velociraptor user so the ansible playbook could see/change them, do you have to do that every time you first run ansible on a machine? Or could you make adding the wallpaper and user plays that are run at the beginning of the playbook? I am probably confused because I am missing how manually adding those things actually saves time if they have to be done every time.
@jonnykopp
@jonnykopp 3 жыл бұрын
The state of the playbook at the end of the video would apply all of it at once. He's slowly adding things piecemeal so you get a feel for how to construct it over time.
@KyrychenkoAnton
@KyrychenkoAnton Жыл бұрын
Is it possible to "roll back" say package installation in ansible? For example in nixos config I can write first to install those packages, and then after some time I feel like some are not needed, so I simply remove package names from the list in file - and nixos understands that and removes them from the system.
@mich4u
@mich4u Жыл бұрын
Can Ansible be used to automate Windows 7 & 10? I work as an IT Administrator for some warehouse in Poland and most computers that I take care of are Desktop computers. The problem with them is that, for most of the time, someone is working on them. I have to wait until another shift comes and then I don't have much time to do anything. There are also many data collectors with Windows CE but there is probably no way to automate them. I'm one person and there are many computers in 2 separate locations. I have remote access to most computers, but I would love to have background access through SSH or something like that. Everyone thinks that their work is so important and I can't force them to understand why I need to do maintenance...
@adrianalb8903
@adrianalb8903 2 жыл бұрын
Must I have git installed on my server to use ansible-pull?
@zachsandvik1867
@zachsandvik1867 3 жыл бұрын
Hi Jay. Thank you so much for your great ansible tutorial. I really appreciate your work. Now I am trying to use a private repo. I added a deployment key. So to my opinion it should be possible to use ansible-pull to pull that specific repo to a server. I am using this tutorial to achieve my goal. Instead https I used ssh://... as a link. I noticed the key failed. Is it possible to create a video on this issue? 2nd how can I use a machine github user? I read a lot about it. I created a second github account as a “machine-user”. In my first github account I added the second github account user as a collaborator to specific private repo. I read lots of documents but it is not clear how to use this setup. Setting up a different server and a new key pair results in Permission Denied warnings. Despite the fact I copied my new pub key to github (account or as a deployment key) I receive Permission denied warnings. How come? Greetz Zack
@williemaddox9919
@williemaddox9919 3 жыл бұрын
Same here. Went through tutorial step by step. Permission Denied when running git clone.
@kihunkim9122
@kihunkim9122 5 ай бұрын
Quick question. My company's image is built by Powershell. Is it possible to build an image by Ansible?
@isellcuddlesessions66
@isellcuddlesessions66 3 жыл бұрын
When you catted the private key, my heart rate had a slight frequency glitch.
@LearnLinuxTV
@LearnLinuxTV 3 жыл бұрын
That means your mindset is in the right place.
@MB-sw3uf
@MB-sw3uf 3 жыл бұрын
What is bad about catting a private key?
@rahilarious
@rahilarious 3 жыл бұрын
@@MB-sw3uf it's bad when you're on screen sharing.
@MB-sw3uf
@MB-sw3uf 3 жыл бұрын
@@rahilarious I see, I was just worried there is an inherent security risk when using cat or something hahaha, thx!
@ShainAndrews
@ShainAndrews 3 жыл бұрын
Is it safe to assume your VM already had a network interface and assigned IP?
@MG-yc6jr
@MG-yc6jr 3 жыл бұрын
I use arch server btw
@patjustpat8178
@patjustpat8178 Жыл бұрын
My man installing caffeine like the absolute chad he is.
@kalifornia909
@kalifornia909 3 жыл бұрын
is there any way to set variables. for instance, instead of typing /home or user you can set it to the current user's variables. Pretty much $HOME or $USER equivalent
@kristopherleslie8343
@kristopherleslie8343 3 жыл бұрын
I was wondering same thing. Just finished an api tutorial.
@john-r-edge
@john-r-edge 3 жыл бұрын
Question about why Ansible is best for such config work, when compared with another language available on all platforms such as Python? Clearly Python can copy files etc. What is the Ansible secret sauce? Existence of suitable configging modules for each OS? Integration with Git? Microsoft might point to Power shell as their multiplatform offering. Certainly has good capability working with Windows and its Registry. Great video though! Thanks. (Edited to say Ansible, not its auto correct value Sensible. Why not tho? Ansible is Sensible)
@kristopherleslie8343
@kristopherleslie8343 3 жыл бұрын
Well Ansible, Butler and other tools do the same thing in general. Also while you could do some of this with Python, how you plan on deploying to a site (not just a node) with just Python? Lol
@JamieAlban
@JamieAlban 3 жыл бұрын
Can't you add the cronjob as the root user?
@marekmdpdesign
@marekmdpdesign 3 жыл бұрын
Hi just wanted to note that you say create „play” but you’re creating new tasks inside existing play. It might confuse some people, specially new to Ansible :) anyway nice video
@SeanPorterPDX
@SeanPorterPDX 3 жыл бұрын
That was driving me nuts... I’m glad I’m not the only one who noticed
@enriquegomez2581
@enriquegomez2581 Ай бұрын
Has anyone had issues setting the wallpaper? For some reason it’s not working for me…
@franciskapsowe9183
@franciskapsowe9183 2 жыл бұрын
Distrotube should watch this
@geogmz8277
@geogmz8277 3 жыл бұрын
Can dconf be installed from the get go with Ansible?
@ThePsyForce
@ThePsyForce 3 жыл бұрын
He mentioned that you could have added python3 to the packages play, so yes you should be able to install any packages there as well.
@williambarrett7108
@williambarrett7108 2 жыл бұрын
Couldn’t I automate configuration just with vim?
@yekutielbenheshel354
@yekutielbenheshel354 2 жыл бұрын
Sure. One could ride a bicycle from Los Angeles to New York. But an airplane would generally be a better choice.
@maratgumerov3523
@maratgumerov3523 5 ай бұрын
Now I know how to use git 😅
@GunterZochbauer
@GunterZochbauer 4 ай бұрын
I did this for a few years but NixOS is much better for this (not converted my raspberries yet, only my desktop, MacBook and a bunch of VMs)
@danvokt5539
@danvokt5539 3 жыл бұрын
Great video! One thing that occurred to me when you did the bashrc play is that there are two categories of "dotfiles" that need to be managed. 1. dotfiles for system and pre-installed (part of OS install) packages 2. dotfiles for any packages added via your ansible setup (local.yml) The system/pre dotfles could be in their own section. However, it would be nice if there was some way to correlate the ansible installed packages with their associated dotfiles. IOW, the syntax of adding all packages as a list makes it difficult to keep track of their associated dotfiles. Have you any ideas on how to install/maintain a package AND its dotfile together?
@LearnLinuxTV
@LearnLinuxTV 3 жыл бұрын
I do actually, if you look at my example Ansible config (my personal one) I basically do that exact thing for installing Syncthing and some others. Check out the Syncthing playbook inside the roles/workstation/tasks/software folder for some insight.
@danvokt5539
@danvokt5539 3 жыл бұрын
@@LearnLinuxTV I should have dug more deeply into your personal setup first! ;-) After my first deep dive I am beginning to understand your directory structure, the use of import _tasks, using vars to map (key: value) package names per distro, and package enable/disable list, etc. But it still seems to me that a lot of human mental correlation is going on. Sure once it is set up its good to go. BUT how would one add/remove a package? How would someone know that there are several related files that have to be modified in concert and what files and where? Perhaps a check script that is based on a file that just contains the package keys that would check all the related files to make sure everything is where it should be?
@danvokt5539
@danvokt5539 3 жыл бұрын
To clarify "BUT how would one add/remove a package" I am referring to the ansible playbooks NOT the packages themselves. Though that begs the question: "what happens if I remove or set false a package flag AFTER it has already been installed?" Seems each package sub task file should also have a another task to change "state: absent" -- when: PKG-FLG == false To simplify perhaps the package handling could be template driven using package key list file mentioned in my previous reply - obviating the individual package play books? That would be amazing!
@evadeflow
@evadeflow 3 жыл бұрын
My preference is to keep my dotfiles and other app configuration (i.e., vim/tmux plugins, etc) in separate repositories outside of the one containing my Ansible playbook. Then I just have the playbook clone those repositories into place after it's done installing the apps. The problem one immediately runs into is: most apps expect their dotfiles to be stored directly in the user's home folder, so... you can't easily keep, say, your vim and tmux configs in separate repos. (If you did, they would both want Git's object tree to be located in `${HOME}/.git`, which isn't possible if the objects come from different repositories.) I *really* like to use a separate repo for each app's config data, though. It's overkill for very simple apps, but some app setups use a plugin manager and require multiple config files to exist, or even a hierarchy of files/folders. I used to keep the configs for all apps interleaved together within a single `dotfiles` repo that I would clone to my home folder-and I still recommend this as a starting point for most people-but... for me, this got to be unmanageable over time. Once I committed to using separate repos for each app's config data, I identified two strategies that would allow these object trees to co-exist under `${HOME}`: 1. Use a symlink farm manager like GNU stow (www.gnu.org/software/stow/) 2. Use vcsh in combination with myrepos The first approach is easier to wrap one's head around, so I usually recommend it for most people. The second approach is almost infinitely flexible, but harder to grok. This article does a much better job of explaining this stuff than I just did: - germano.dev/dotfiles/ And here's a snippet from my Ansible playbook that runs the required `vcsh clone ...` and `mr up` commands: - gist.github.com/evadeflow/2f77371dfe5c29f808a8027de101f1fa
@71AngusYoung
@71AngusYoung 3 жыл бұрын
You cannot just use a bash script in a single file like setup.sh to do all this? Or does that have too many limitations?
@LearnLinuxTV
@LearnLinuxTV 3 жыл бұрын
Too many limitations, Ansible is better for this kind of thing.
@ThePsyForce
@ThePsyForce 3 жыл бұрын
For one, bash syntax is vastly more complicated than the yml syntax. To even do what this video accomplishes would take way more code. Remember that Ansible also checks the current configuration and only performs actions when they require changes. Writing those checks in bash would add quite a lot of complexity for the user.
@bonzaihb3432
@bonzaihb3432 3 жыл бұрын
@@ThePsyForce Just wondering, never worked with Ansible yet: assume a system deployed at customers site, tech people onsite are not supposed to mess with it, but do so anyways (routes config and stuff like that). Would it be possible to detect that and merge the diff or would ansible just reject the new stuff we are trying to apply, or even overwrite the existing (messed with) file? We are in fact using kickstart (for clean installation) and a couple of quite complex bash/sed scripts (for later patches) for that at the moment, wonder if we could replace that with Ansible...
@ThePsyForce
@ThePsyForce 3 жыл бұрын
@@bonzaihb3432 I would suggest researching a bit about the basics of Ansible to see if it's appropriate for your situation.
@kjakobsen
@kjakobsen 3 жыл бұрын
The indentation requirements of YAML makes my blood boil. How do you get past this. Why did that have to be so f...... pedantic. :(
@williemaddox9919
@williemaddox9919 3 жыл бұрын
Made it all the way to this point, kzbin.info/www/bejne/nXqnqqqpfKeknJY and then... Cloning into 'ansible_public'... Warning: Permanently added the RSA host key for IP address '140.82.112.3' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
@williemaddox9919
@williemaddox9919 3 жыл бұрын
SOLVED: I was using a fresh ssh key that I named ~/.ssh/github_id_ed25519. Creating a new key with default naming worked (i.e. ~/.ssh/id_ed25519).
@corewarrior
@corewarrior 3 жыл бұрын
boo nano... otherwise great video
@ablanchi
@ablanchi 3 жыл бұрын
So this is how people live without NixOS, awful lot of work.
@geogmz8277
@geogmz8277 3 жыл бұрын
It's well worth it considering that this is use on CD/CI environment is nice to know how to work with it.. Since it put $$ food on the table.
@RedBlueProductions1
@RedBlueProductions1 2 жыл бұрын
please do not pixelate text. surely you know there's AI designed specifically for the purpose of cracking text that is pixelated. just black it out, for your own sake
船长被天使剪成光头了?#天使 #小丑 #超人不会飞
00:28
超人不会飞
Рет қаралды 25 МЛН
Barriga de grávida aconchegante? 🤔💡
00:10
Polar em português
Рет қаралды 11 МЛН
Лизка заплакала смотря видео котиков🙀😭
00:33
SSH Full Course - EVERYTHING You Need to Know!
1:28:00
Learn Linux TV
Рет қаралды 544 М.
How To Automate Your Dev Setup
15:06
TheAltF4Stream
Рет қаралды 7 М.
You did WHAT with Ansible?!
20:56
Jeff Geerling
Рет қаралды 137 М.
Linux Command-Line Tips & Tricks: Over 15 Examples!
31:37
Learn Linux TV
Рет қаралды 209 М.
Encrypting Files with Ansible Vault
20:48
Learn Linux TV
Рет қаралды 18 М.
Automating my Homelab with Ansible
13:18
Jeff Geerling
Рет қаралды 325 М.
Stow has forever changed the way I manage my dotfiles
8:09
Dreams of Autonomy
Рет қаралды 175 М.
New Linux User: 10 Things I Wish I Knew When I First Started
23:31
Learn Linux TV
Рет қаралды 356 М.
Why Corporate Owned Linux Distributions like Red Hat are a Bad Idea
23:46
Samsung or iPhone
0:19
rishton_vines😇
Рет қаралды 888 М.
Опасная флешка 🤯
0:22
FATA MORGANA
Рет қаралды 666 М.
Что еще за обходная зарядка?
0:30
Не шарю!
Рет қаралды 227 М.