Using Ansible to automate your Laptop and Desktop configs!

Sdílet
Vložit
  • čas přidán 10. 12. 2020
  • 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
  • Věda a technologie

Komentáře • 142

  • @rdwatson
    @rdwatson Před 3 lety +1

    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.

  • @DementiaAcerbus
    @DementiaAcerbus Před 3 lety +19

    Another very helpful one for the homelab thank you!

  • @danielsonuk7171
    @danielsonuk7171 Před 3 lety +5

    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

  • @isofruitfruit9357
    @isofruitfruit9357 Před 3 lety +5

    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!

  • @dimaspangestu4450
    @dimaspangestu4450 Před rokem

    Huge thanks Jay to made this tutorial very clean and understandable for a beginners.

  • @coertdeneve7567
    @coertdeneve7567 Před 3 lety +7

    Wow, thanks for sharing Jay! This is great stuff!

  • @rahilarious
    @rahilarious Před 3 lety +1

    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.

  • @deanwaters
    @deanwaters Před 3 lety

    Jay thanks for the video, it will come in very handy you are the true MVP

  • @_oly_241
    @_oly_241 Před 2 lety

    Absolutely fantastic video!

  • @SB-qm5wg
    @SB-qm5wg Před 3 lety

    Great video. TY for filling in the gaps.

  • @biscuitbaker8693
    @biscuitbaker8693 Před 2 lety

    This is awesome! Thanks for sharing!

  • @ForrestRhoads
    @ForrestRhoads Před 3 lety +5

    Awesome tutorial, carefully, thoroughly and clearly done. Thank you.

  • @EdgardMello
    @EdgardMello Před 2 lety

    This is a really good learning channel.

  • @marcalleaume1853
    @marcalleaume1853 Před 3 lety

    Very interesting video. Always enlightening. Bravo et merci beaucoup.

  • @alessandrorossi2164
    @alessandrorossi2164 Před 7 měsíci

    amazing content and quality! Thank you!

  • @mkro6510
    @mkro6510 Před 3 lety

    Thank you for plus sizing the terminal text.

  • @aritra1414
    @aritra1414 Před 2 lety +1

    This one was awesome!!

  • @yekutielbenheshel354
    @yekutielbenheshel354 Před 2 lety

    Excellent video. Thank you!

  • @hakovatube
    @hakovatube Před 3 lety +1

    Thank you for sharing your ideas and set ups, as well as your scripts/choices both as examples and as inspirations.

  • @bits2646
    @bits2646 Před 3 lety

    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..

  • @N3cr0m4ncer
    @N3cr0m4ncer Před 3 lety +1

    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 Před 3 lety

      Btw. I use Arch 😂

    • @N3cr0m4ncer
      @N3cr0m4ncer Před 3 lety +1

      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  Před 3 lety +2

      @@N3cr0m4ncer Thanks, fixed!

  • @hexearth8258
    @hexearth8258 Před 3 lety +1

    More ansible would be great. Thanks.

  • @cosmicspawn6647
    @cosmicspawn6647 Před 6 měsíci +1

    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.

  • @andreabisio
    @andreabisio Před 3 lety +1

    Hi Jay awesome video! Have you any suggestions to automate configuration for kde plasma?

  • @AndreasLienemann
    @AndreasLienemann Před 3 lety

    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.

  • @mawortz
    @mawortz Před 2 lety

    so glad I found this channel

  • @riverwolf2174
    @riverwolf2174 Před 3 lety

    Thanks for posting!

  • @Chase07450
    @Chase07450 Před 3 lety

    Love your work. The dconf module did not work for me at first, but figured it out?

  • @sethalump
    @sethalump Před 3 lety

    Always love learning new Ansible tricks. Thank you!

  • @MrNoBSgiven
    @MrNoBSgiven Před 3 lety

    Thank you very much. This is very impres8ve and useful.

  • @juhapenttila5733
    @juhapenttila5733 Před 3 lety

    Very nice! Time to fire up a VM to try this!

  • @fuatkaradeniz
    @fuatkaradeniz Před 3 lety +2

    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 Před 3 lety

      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 Před 3 lety

      @@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".

  • @TheRowie75
    @TheRowie75 Před 3 lety +1

    Jay, you are my HERO!!!!! AWESOME Tutorial

  • @Frustrated_Programmer13
    @Frustrated_Programmer13 Před 6 měsíci

    I need to see this again.

  • @williamseipp9691
    @williamseipp9691 Před 3 lety +18

    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 Před rokem

      Thankfully I didn't had to face this situations, lets hope I'll never will be.

  • @lkm75
    @lkm75 Před 2 lety +7

    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?

  • @FahadKhan-fq4zw
    @FahadKhan-fq4zw Před rokem

    Great tutorial , wondering if you have any video or if you can do one for Windows OS. Thanks

  • @amirsadaghdar3482
    @amirsadaghdar3482 Před 3 lety

    Thank you Jay!
    Awesome content as always!

  • @victornoagbodji
    @victornoagbodji Před 3 lety

    😊 😊 🙏
    thanks for sharing this presentation

  • @1edgararias
    @1edgararias Před 3 lety

    This was cool. Thanks

  • @Apfelloch
    @Apfelloch Před 2 lety

    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?

  • @Mario-vt2ss
    @Mario-vt2ss Před 2 lety

    Amazing, thank you.

  • @greob
    @greob Před 3 lety +4

    Interesting. Thanks for sharing!

  • @ronnierush9379
    @ronnierush9379 Před 3 lety

    Great Video and very clever Thank you:-)

  • @benjaminkania581
    @benjaminkania581 Před 3 lety +6

    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 Před 3 lety +5

      Would also love to see the deploy/bootstrap script

  • @myproject6753
    @myproject6753 Před 3 lety +2

    Great Tutorial - like always!! I will definitely try it out ...it's "awesome" :-))

  • @madrag
    @madrag Před 3 lety

    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?

  • @princemarkied8071
    @princemarkied8071 Před 4 měsíci

    SOOOO much fun!

  • @lptechCT
    @lptechCT Před 2 lety

    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.

  • @stoneytech5434
    @stoneytech5434 Před 3 lety

    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.

  • @emberavenge7162
    @emberavenge7162 Před 3 lety +20

    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

  • @nahum35
    @nahum35 Před 3 lety

    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.

  • @arshamrezaei8918
    @arshamrezaei8918 Před 3 lety

    thanks for this great tutorial ;}

  • @ahmetcan4533
    @ahmetcan4533 Před 3 lety

    well, it was a journey for me , thanks

  • @add1989
    @add1989 Před 9 měsíci +2

    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

  • @theena
    @theena Před 3 lety +1

    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.

  • @AlexanderSkwar
    @AlexanderSkwar Před 2 lety +3

    Could you maybe also provide the bootstrap file shown in 6:08?

  • @jorgesisco981
    @jorgesisco981 Před 5 měsíci

    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.

  • @garychap8384
    @garychap8384 Před 3 lety

    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 : /

  • @simbaclaws_youtube
    @simbaclaws_youtube Před 3 lety

    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.

  • @ahmedshaarawy1471
    @ahmedshaarawy1471 Před 3 lety

    Great Video , but i need urgently to know how to automate joining domain computers to specified domain groups !?

  • @AlokParlikar
    @AlokParlikar Před 3 lety

    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  Před 3 lety +1

      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 Před 3 lety

    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 Před 3 lety

      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

  • @tonythell
    @tonythell Před 3 lety +2

    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.

  • @thekillbreathfamily7371

    at 07:36, how did you get the unicorn in the terminal?

  • @simbaclaws_youtube
    @simbaclaws_youtube Před rokem

    Is there a way to make ansible-pull work from within WSL2 inside a windows machine to provision a windows workstation?

  • @jordanallison7105
    @jordanallison7105 Před 3 lety

    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 Před 3 lety

      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 Před rokem

    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.

  • @camerontgore
    @camerontgore Před 3 lety

    26:20 How is this (ssh) different than using the regular git clone method where you just use the git URL?

  • @oleholgerson3416
    @oleholgerson3416 Před 3 lety

    Super helpful, thank you!

  • @danvokt5539
    @danvokt5539 Před 2 lety

    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?

  • @ThePsyForce
    @ThePsyForce Před 3 lety +2

    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 Před rokem +2

      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 Před rokem

      @@Knirin Thanks for the clarification!

  • @kihunkim9122
    @kihunkim9122 Před 6 měsíci

    Quick question. My company's image is built by Powershell. Is it possible to build an image by Ansible?

  • @AnzanHoshinRoshi
    @AnzanHoshinRoshi Před 3 lety

    Thank you, Jay.

  • @mich4u
    @mich4u Před rokem

    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 Před 2 lety

    Must I have git installed on my server to use ansible-pull?

  • @eliaspizarro0015
    @eliaspizarro0015 Před 4 měsíci

    there are an asible like for windows?

  • @zachsandvik1867
    @zachsandvik1867 Před 3 lety +2

    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 Před 3 lety

      Same here. Went through tutorial step by step. Permission Denied when running git clone.

  • @misium
    @misium Před 3 lety +2

    30:00 - skip to the Ansible stuff

  • @kalifornia909
    @kalifornia909 Před 3 lety +2

    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

  • @ShainAndrews
    @ShainAndrews Před 3 lety

    Is it safe to assume your VM already had a network interface and assigned IP?

  • @patjustpat8178
    @patjustpat8178 Před rokem

    My man installing caffeine like the absolute chad he is.

  • @geogmz8277
    @geogmz8277 Před 3 lety

    Can dconf be installed from the get go with Ansible?

    • @ThePsyForce
      @ThePsyForce Před 3 lety

      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.

  • @john-r-edge
    @john-r-edge Před 3 lety

    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 Před 3 lety

      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 Před 3 lety

    Can't you add the cronjob as the root user?

  • @marekmdpdesign
    @marekmdpdesign Před 3 lety +1

    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 Před 3 lety +1

      That was driving me nuts... I’m glad I’m not the only one who noticed

  • @enriquegomez2581
    @enriquegomez2581 Před 2 měsíci

    Has anyone had issues setting the wallpaper? For some reason it’s not working for me…

  • @danvokt5539
    @danvokt5539 Před 3 lety

    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  Před 3 lety

      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 Před 3 lety

      @@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 Před 3 lety

      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 Před 3 lety

      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 Před 3 lety

    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  Před 3 lety +1

      Too many limitations, Ansible is better for this kind of thing.

    • @ThePsyForce
      @ThePsyForce Před 3 lety +1

      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 Před 3 lety

      @@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 Před 3 lety

      @@bonzaihb3432 I would suggest researching a bit about the basics of Ansible to see if it's appropriate for your situation.

  • @MG-yc6jr
    @MG-yc6jr Před 3 lety

    I use arch server btw

  • @franciskapsowe9183
    @franciskapsowe9183 Před 2 lety

    Distrotube should watch this

  • @williambarrett7108
    @williambarrett7108 Před 2 lety

    Couldn’t I automate configuration just with vim?

    • @yekutielbenheshel354
      @yekutielbenheshel354 Před 2 lety

      Sure. One could ride a bicycle from Los Angeles to New York. But an airplane would generally be a better choice.

  • @maratgumerov3523
    @maratgumerov3523 Před 6 měsíci

    Now I know how to use git 😅

  • @isellcuddlesessions66
    @isellcuddlesessions66 Před 3 lety

    When you catted the private key, my heart rate had a slight frequency glitch.

    • @LearnLinuxTV
      @LearnLinuxTV  Před 3 lety +3

      That means your mindset is in the right place.

    • @MB-sw3uf
      @MB-sw3uf Před 3 lety

      What is bad about catting a private key?

    • @rahilarious
      @rahilarious Před 3 lety

      @@MB-sw3uf it's bad when you're on screen sharing.

    • @MB-sw3uf
      @MB-sw3uf Před 3 lety

      @@rahilarious I see, I was just worried there is an inherent security risk when using cat or something hahaha, thx!

  • @gzoechi
    @gzoechi Před 5 měsíci

    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)

  • @kjakobsen
    @kjakobsen Před 3 lety

    The indentation requirements of YAML makes my blood boil. How do you get past this.
    Why did that have to be so f...... pedantic. :(

  • @corewarrior
    @corewarrior Před 3 lety +1

    boo nano... otherwise great video

  • @ablanchi
    @ablanchi Před 3 lety +5

    So this is how people live without NixOS, awful lot of work.

    • @geogmz8277
      @geogmz8277 Před 3 lety

      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.

  • @williemaddox9919
    @williemaddox9919 Před 3 lety

    Made it all the way to this point, czcams.com/video/gIDywsGBqf4/video.html 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 Před 3 lety

      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).

  • @RedBlueProductions1
    @RedBlueProductions1 Před 2 lety +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