Automate your Docker deployments with Ansible

Поділитися
Вставка
  • Опубліковано 27 сер 2024

КОМЕНТАРІ • 77

  • @christianlempa
    @christianlempa  3 роки тому +12

    Note, if you haven't installed ansible before via pip and you're doing a fresh installation via pip, make sure you add this line to your .bashrc or .zshrc file!
    export PATH=$PATH:$HOME/.local/bin

    • @mmrk_
      @mmrk_ 3 роки тому

      Hello! Was wondering what does `export PATH=$PATH:$HOME/.local/bin` do for us in this case? Is there a particular spot in the .bashrc config that we should add this line?

    • @mmrk_
      @mmrk_ 3 роки тому +4

      After some research. "export PATH=$PATH:$HOME/.local/bin" will add Ansible to your Path and will let you use the "ansible" command. You can add this line to the top of the .bashrc file. You have to use the following command after adding it to your .bashrc file in order for it to work. ". .bashrc" or `source .bashrc` Hope this helps others that ran into the same roadblock.

    • @christianlempa
      @christianlempa  3 роки тому

      @@mmrk_ Thanks for sharing! :)

    • @devvar912
      @devvar912 Рік тому

      Thanks for your work! But can you explain why it says Unable to connect, when i installed portainer and trying to check connection? Not on vm, neither on host

    • @kjakobsen
      @kjakobsen Рік тому

      I'm installing a control node on WSL Ubuntu 22.04, after adding the path it works perfect. :)

  • @unit7psyclone35
    @unit7psyclone35 3 роки тому +3

    Excellent Tutorial for Ansible and Docker. Thanks Again Christian.

  • @TuxTechLabs
    @TuxTechLabs 9 місяців тому +1

    Cool things shared by Christian as always.

  • @Phillisteum
    @Phillisteum 2 роки тому +5

    Great video! Docker stack definition in an Ansible playbook?! Wow! So much potential to automate deployments and update a running stack.

    • @christianlempa
      @christianlempa  2 роки тому +1

      Thank you so much! :) That's indeed pretty useful!

  • @Ultimaus
    @Ultimaus 11 місяців тому +1

    So I'm just diving into what I need to setup a home lab. Honestly the technical stuff is a treat. Drilling holes for and mapping the cables and drywall is the unwanted brain challenge. I am just getting my feet wet into deploying virtual machines using, home assistant, Linux cli, docker and... well basically everything your channel is about. But my skills are currently just trying to swim through Linux and docker and docker networking. I was looking through some ansible content online and as we tech guys are... we understand why automation is powerful. We understand the power of macro commands and scripted deployment. But as selfish creatures with undefined capacity I still didn't understand why ansible? As these questions are always user defined we just need someone to show how they use it and why. I don't know what it is exactly in your video that made me connect the dots and shout ah hah! But I want you to know it happened and I want to thank you for your time and effort.

  • @rob280
    @rob280 9 місяців тому

    Enjoyed your video, was not able to find your docker-install.yaml it your boiler plate folders but did find enough to get docker installed then was able to read your video to get the python package manager and python sdk installed. Overall this video was well done and had a lot of information in it. Thank you.

  • @user-de7vk7gm7b
    @user-de7vk7gm7b 2 роки тому +1

    Благодарю, очень полезное видео!!
    I grateful to you for this a very useful video!

  • @annahri
    @annahri 2 роки тому

    So much interesting topics on your channel. Subscribed!

  • @haralc
    @haralc Рік тому +2

    I'm surprised even after a year later after this video that the "installing" documentation don't give an option to get Ansible as a container image, so people don't really have to care what python version is installed or whether it's even installed.

  • @ronaldagorsah7954
    @ronaldagorsah7954 4 місяці тому

    Thanks for the video but the boilerplate is gone and now i misss the boilerplate to install docker

  • @jeremyr7958
    @jeremyr7958 2 роки тому +2

    Question: If you are not using vagrant, which many don't, what do you enter in the config file instead of the vagrant private key file path?

  • @dedpossum66
    @dedpossum66 2 роки тому

    Excellent video! I appreciate it.

  • @kjakobsen
    @kjakobsen Рік тому

    The YAML syntax requirements gives me a headache. I oftens find myself, staring at what i typed in, and can't spot what i seemed to have mistyped. How do we overcome this?

  • @mohdasgharnaqvi5955
    @mohdasgharnaqvi5955 2 роки тому +1

    U r really helpful thanks

  • @andreaghensi7579
    @andreaghensi7579 2 роки тому

    great tutorial as always! I ran into an error similar of what you talk about at 14:30, but mine occurred because I was adding my ansible user to the docker group just before using the docker_container module (I'm trying a zero-to-homelab playbook here)... all I had to do to solve this was to add a reset_connection task to ensure the ansible user had the right permissions.

    • @christianlempa
      @christianlempa  2 роки тому

      Thanks! Sounds interesting, I was able to fix it all by installing the right packages.

  • @SMAW04
    @SMAW04 3 роки тому +2

    Nice video, got some ideas from it! thank you. One question, which theme are you using in you're WSL ZSH it looks nice!

    • @christianlempa
      @christianlempa  3 роки тому +1

      Hey, thanks! :) I just updated my dotfiles github repo, there you'll find the settings and the color scheme for the Windows Terminal: github.com/xcad2k/dotfiles

  • @Adityakumar-ly6iy
    @Adityakumar-ly6iy 3 роки тому +1

    I am confused as why we have to write a playbook to install wordpress instead we can write a docker-compose file with all required configuration and run the file using ansible on the host.

    • @christianlempa
      @christianlempa  3 роки тому +2

      Works both ways, you can of course also use docker-compose if you want

    • @tekknokrat
      @tekknokrat 2 роки тому

      You can also use ansible playbook that deploys a docker compose file containing ansible variables. That is sometimes neccessary when you have dynamic parameters that can't be injected by environment vars.

  • @gr33nt3a__1
    @gr33nt3a__1 Рік тому

    Hi Christian, when using this playbook it fails at "No package matching 'docker-ce' is available". How would I circumvent this issue? Thanks in advance!

  • @sudeep_jadhav
    @sudeep_jadhav 2 місяці тому

    Docker with Terraform can be done?

  • @Mohan-nf6cu
    @Mohan-nf6cu 3 роки тому

    Thanks a lot. Excellent explanation:) :)

  • @HoaPham-yb1op
    @HoaPham-yb1op Рік тому

    I follow exactly the steps in your video but I'm getting this error:
    msg": "Failed to import the required Python library (requests) on vm-test-rh1's Python /usr/bin/python3.9. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"
    Can you guess why?

  • @jamesT008
    @jamesT008 2 роки тому

    Great....very informative

  • @andyruiz3174
    @andyruiz3174 3 роки тому

    Sehr gutes Video... hast die ein Abo verdient

  • @fauzifirdaus8200
    @fauzifirdaus8200 3 роки тому +1

    Can u give us tutorial how to connect another server to main portainer and how best practice use watchtower if we want to manage docker in few different server?

    • @christianlempa
      @christianlempa  3 роки тому

      I've done a video on Watchtower, that might help you: ua-cam.com/video/5lP_pdjcVMo/v-deo.html
      And also on Portainer Remote Access: ua-cam.com/video/kKDoPohpiNk/v-deo.html
      Hope that is what you're searching for 😀

  • @ebiscaia
    @ebiscaia Рік тому

    Wouldn't it be the case of installing Ansible in a vitual environment?

  • @yolo-cars
    @yolo-cars 2 роки тому

    Thank you for this video. I'm following this video and I got a quick question: in ansible.cfg file you specidied remote_user = vagrant. I'm not using vagrant, so I wonder if remote_user should be a regular user which you create when installing Linux or if it should be a root user? Thanks!

    • @christianlempa
      @christianlempa  2 роки тому +1

      Yep it's the name of a regular Linux user on the remote system

  • @Angelas20
    @Angelas20 2 роки тому +1

    What shell prompt do you use for nice upper blue part?

    • @christianlempa
      @christianlempa  2 роки тому +1

      I've done a video about my setup, here you'll find it :) ua-cam.com/video/oF6gLyhQDdw/v-deo.html

  • @chrissaji6988
    @chrissaji6988 3 роки тому +1

    Thanks for this tutorial.
    Could you please create a tutorial to install collabora on nextcloud (installed on docker)?

    • @christianlempa
      @christianlempa  3 роки тому +2

      Thanks! Well that would need to wait a long time, until I do that, unfortunately :/

  • @belaircomputerguyllc4001
    @belaircomputerguyllc4001 3 роки тому +1

    Do you get into VM's at all? Which hypervisor do you prefer?

    • @christianlempa
      @christianlempa  3 роки тому +2

      I'm currently testing proxmox. Seems pretty good so far

    • @christianlempa
      @christianlempa  3 роки тому +1

      I'm currently testing proxmox. Seems pretty good so far

  • @neoplasma1
    @neoplasma1 2 роки тому +1

    Doesn’t Portainer take away the learning process of actually using Docker?

    • @christianlempa
      @christianlempa  2 роки тому

      To some extend, yes. But people still would need at least some fundamental knowledge of Docker, and I always prefer people to teach the fundamentals first before using tools to simplify the daily workflow.

  • @deanxaka
    @deanxaka 2 роки тому

    What are you using for yaml in vscode to lool like that

  • @KrachaborasJB
    @KrachaborasJB 3 роки тому

    Which vscode extension sets different colors on columns ?

  • @nikhilverma1552
    @nikhilverma1552 3 роки тому

    Hi,
    can u also show me how to down docker-compose from remote host

    • @christianlempa
      @christianlempa  3 роки тому

      Not sure what you mean, remote hosts can be managed with Portainer like local hosts, so also docker-compose stacks.

  • @psicodelico6
    @psicodelico6 3 роки тому

    Excelent tutorial!.. great.. if you migrate cointaner how to get data and then copy en new location docker?

    • @christianlempa
      @christianlempa  3 роки тому +1

      Thanks! Glad that you asked because I'm currently preparing a new video about migrating non-docker to docker containers. I think it would be great to integrate migration of docker volumes as well!

    • @psicodelico6
      @psicodelico6 3 роки тому

      @@christianlempa yes! its would be great.

  • @frenchkaonashi5495
    @frenchkaonashi5495 Рік тому

    My comment is so late, but i want to thank you and ask this:
    What is the tool ur using to get linux command suggestions?

    • @christianlempa
      @christianlempa  Рік тому +1

      I think I was using autosuggestions as a plug-in for zsh at this time

  • @jackbolder5734
    @jackbolder5734 Рік тому

    Is it just me, or is the video quality terrible even at 1080p? Barely can read that yaml (Europe).

    • @christianlempa
      @christianlempa  Рік тому +1

      Idk, maybe that’s an issue with the compression

  • @Knightfall23
    @Knightfall23 2 роки тому

    What is that webpage home setup you have at 15:09?

    • @twinssword
      @twinssword 2 роки тому

      Brave browser default page

  • @johanelmander3787
    @johanelmander3787 3 місяці тому

    This is not automating docker deployment, in remote server you just installed docker and pulled wordpress image from dockerhub. This is not deployment

  • @lonewolfcoding5208
    @lonewolfcoding5208 Рік тому

    i like it because its agentless

  • @techwithbube
    @techwithbube 3 роки тому

    How can i print a mesage when I vagrant ssh into a VM ?

  • @Glatze603
    @Glatze603 3 роки тому

    Hi Christian! Thanks for this video, but yout description doesn't work an ubuntu 20.04. I removed older ansible version, but bevor install new one, I had to install python3-pip - maybe you are a little bit "betriebsblind" because you had it already installed? After installation of ansible (python3 -m pip install ansible) I wasn't able to use it, because system looks at "/usr/bin/ansible". Symlink new one from ~/.local/bin/ to /usr/bin first seems to work (ansible --version > 2.10.8), but next command "ansible-galaxy collection install community.docker" crashes with "Der Befehl 'ansible-galaxy' wurde nicht gefunden kann aber installiert werden mit: sudo apt install ansible"... Whats wrong?!? Maybe you could add some missing details, so that we could profit from this great content? Thanks a lot and please continue in making such nice videos. I would like another video hot to config and deploy a vm with ansible (I already tried, but didn't got it to work).

    • @Glatze603
      @Glatze603 3 роки тому

      Ok, I had to symlink all files from ~/.local/bin to /usr/bin...

    • @christianlempa
      @christianlempa  3 роки тому +1

      @@Glatze603 Danke für's bescheid sagen! Ja das stimmt, ich hatte den symlink erstellen müssen, bzw. du kannst mit "export PATH=$PATH:$HOME/.local/bin" in der .zshrc oder .bashrc datei das einstellen.
      Ich füge das gleich mal ins tutorial hinzu!