Using Ansible "Pull" Mode to Dynamically Automate Server/Workstation Builds

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.ย. 2020
  • Ansible "Pull" is an often overlooked gem, that makes it even easier to manage your server and workstation builds by combining the power of version control with the flexibility of Ansible. In this video, you'll learn everything you need to know in order to use ansible-pull.
    *Time Codes*:
    1:14 - What is "ansible-pull"?
    7:00 - Setting up the Git Repository
    14:13 - Running playbooks via ansible-pull
    🙌 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
    Wiki article for this video:
    www.learnlinux.tv/using-ansib...
    🛒 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
    📖 Check out jay's latest book, Mastering Ubuntu Server 3rd Edition. Available now!
    ➡️ ubuntuserverbook.com
    👨 More about me:
    ➡️ www.jaylacroix.com
    ➡️ www.learnlinux.tv/about-me
    💽 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 48

  • @tmthyrd
    @tmthyrd 3 ปีที่แล้ว +14

    Great video, watching this gives me enough confidence to start using ansible-pull across my infrastructure.
    A couple of times in the video you allude to some "extra-power" e.g. using pull mode with private repos, setting up a notification on error, but you don't go into further detail. I completely understand you excluding these deeper topics to keep the video streamlined, although it would be extra satisfying if you could provide links to further information on these skipped topics.
    Thanks for your hard work on these videos, this is the best working overview of pull mode I've seen so far.

  • @ezsquirt
    @ezsquirt ปีที่แล้ว

    Good video for beginners !
    You could've skipped mentioning "connection: local" in your playbook because ansible-pull will call ansible-playbook with "-c local" anyway.
    Also, you could've replaced "hosts: localhost" with "hosts: all" in your playbook and add the argument "-i $(hostname)," to your ansible-pull command.
    With those 2 changes in place, the same playbook can be called for both push AND pull mode.

  • @frederickalcantara2066
    @frederickalcantara2066 2 ปีที่แล้ว +3

    Great video, I would like to suggest a video on ansible pull with private git repos. I think ppl would look like to see that video as well.

  • @MarkWatsonSMTX
    @MarkWatsonSMTX 2 ปีที่แล้ว +2

    I use terraform to create git repositories. It makes it really easy to keep clean repositories. I really like linode, packer, terraform, ansible-pull, and git combination. You can build things out quickly. Great video.

  • @mcdermg
    @mcdermg 2 ปีที่แล้ว

    No idea how I missed that ansible-pull was a thing. Great video, love the content and the channel

  • @jaykayzen2868
    @jaykayzen2868 2 ปีที่แล้ว +1

    Thank you very much, Jay, for doing such an amazing work and offering it for free! I believe I have learnt some wonderful things that are intended to be shared with the rest of the world, and individuals like you have made that possible!
    I'm hoping to see more fantastic works like this on your TH-cam channel in the near future.

  • @GrishTech
    @GrishTech 3 ปีที่แล้ว +1

    This is awesome. Ansible pull seems is easy to set up. Now I can roll SSH keys if need be and do mass scale configuration. Thanks for the video.

  • @kenmurphy4259
    @kenmurphy4259 2 ปีที่แล้ว

    Nice video Jay, didn't even know this function existed, love the cron job playbook

  • @kodikodi9948
    @kodikodi9948 2 ปีที่แล้ว

    this is great stuff jay. so useful. I'm going to set this up immediately. thanks!

  • @vitshirgazin7845
    @vitshirgazin7845 4 หลายเดือนก่อน

    Thank you very much for your video. That was great

  • @anas6435
    @anas6435 3 ปีที่แล้ว

    Great stuff !
    This is like a reverse way of IaC via Ansible + Gitlab CI where the Gitlab runners take care of the automated provisioning..
    It will be great if you can make a video about it..

  • @murtadha96
    @murtadha96 ปีที่แล้ว

    Thank you so much for this tutorial!

  • @steaders82
    @steaders82 2 ปีที่แล้ว

    Outstanding video!

  • @darylblake1
    @darylblake1 2 ปีที่แล้ว

    Thank you Soooo much this is going to save me so much time

  • @igorkugaudo8212
    @igorkugaudo8212 7 หลายเดือนก่อน

    Thank you for a great content, Jay! Just a quick question, what would you advise to avoid a theoretical overlapping of two provisions? In your case it would possible if one of the updates lasted more than 10 min.

  • @guillaumerousseau9549
    @guillaumerousseau9549 ปีที่แล้ว

    Really cool tuto thank you

  • @nagendrabohora9110
    @nagendrabohora9110 3 ปีที่แล้ว

    thanks for this video

  • @UPPERKEES
    @UPPERKEES 2 ปีที่แล้ว +1

    I'm not sure if I get the "centralize configuration management" thingy here. If you let nodes pull in their Ansible stuff and run it, how do you get a central overview of what's going on then? Then you need to have something easy setup to visualize how these Ansible runs are doing. Otherwise you're flying blind. There are ways to do this, with callback plugins if I recall correctly. But that's not discussed here. So this is not "everything you need to know in order to use ansible-pull".
    Also, Ansible has to run the full playbook, which is quite resource intensive. Why not use Salt if you want a setup like this? Which runs an agent and keeps an eye out for what is out of sync and just applies what's needed for that.

  • @ForrestRhoads
    @ForrestRhoads 3 ปีที่แล้ว

    Excellent

  • @bashardlaleh2110
    @bashardlaleh2110 2 ปีที่แล้ว

    Thanks

  • @stompreaper
    @stompreaper 3 ปีที่แล้ว

    Thanks Jay, great video.

  • @kalifornia909
    @kalifornia909 3 ปีที่แล้ว

    I have been trying to do this in a little bit of a different way. I'm was able to use the $HOME variable in ansible, but I can't get a $USER variable to work so I don't have to relabel if I have a different account name. Can you shed some insight

  • @trido3815
    @trido3815 ปีที่แล้ว

    Thanks very much, Jay. When is your 4th edition book coming out?

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว +1

      No exact date yet, but anytime within 3-6 weeks (my best guess).

  • @RoborobsComputers
    @RoborobsComputers 3 ปีที่แล้ว +1

    Can you do a video on your bootstrap process?

  • @j.h.6672
    @j.h.6672 7 หลายเดือนก่อน

    Please make a video on how to install linux brew via ansible and then manage most packages via brew.

  • @180doman
    @180doman 3 ปีที่แล้ว +1

    Cron solution is a little bit "ugly". I would love to see some webhooks in action for such things. Currently im looking for some simple tool for that. I most familiar with Jenkins but its like shooting a flies with a cannon. Rundeck or Stackstorm look big and bulky as well, not to mention AWX. I could write some python script - requests and jsons are easy there. But im not programmer, i prefer to use others (better written) tools. Maybe you could recommend something lightweight?

    • @180doman
      @180doman 3 ปีที่แล้ว

      But offcource video is great, despite of that.

  • @aadhinarayanan761
    @aadhinarayanan761 3 ปีที่แล้ว

    I have been following your video on ansible and highly appreciate it as I find it useful. I am trying to deploy splunk in a set of hosts using ansible. Instead of the playbooks available in git. Could you make a video on deploying splunk and splunk forwarder by writing an ansible playbook? The playbook to contain wget of splunk url and wget of splunk forwarder url followed by the user name password and the ports and directories to be configured. I find this challenging and appreciate if you could make a video on this.

    • @LearnLinuxTV
      @LearnLinuxTV  3 ปีที่แล้ว +1

      I don't have that on my shortlist currently, but once I'm finished with my backlog you never know what may come next.

    • @aadhinarayanan761
      @aadhinarayanan761 3 ปีที่แล้ว

      @@LearnLinuxTV I'm waiting

    • @Lindguardian
      @Lindguardian 3 ปีที่แล้ว

      @@aadhinarayanan761 i dont think this special problem is very helpful to all viewers.
      you could bootstrap the playbook with ansible-pull, use the ansible modules "uri" or "get_url" (or "shell" if nothing else fit your needs) to obtain data from remote and put that into variables to run your playbook.

    • @aadhinarayanan761
      @aadhinarayanan761 3 ปีที่แล้ว

      @@Lindguardian I think may be I am one who came up to post this here. But that doesn't mean that's a special problem and that is not helpful to others.

  • @nickhuber5476
    @nickhuber5476 3 ปีที่แล้ว

    I can't seem to figure out how to get it to work with a repo that I have hosted on my private server. I always just get a very long error message

  • @nahum35
    @nahum35 3 ปีที่แล้ว

    Thanks so much again!!! awesome, hope you'll keep on doing videos for Ansible. seems like from one videos to another you are uncovering the secrets of Ansible. :)
    what can be the issue, when nothing happens after 10 minutes?
    i'm editing the packages.yml files, then i'm pushing the changes to git, but after 10 minutes nothing happends. i thought the app will be installed, but as i'm watching Crontab logs, after 10 minutes nothing happens, and i've followed every step of this video, and when i triggered the Ansible-pull it ended successfully just like in your screen.
    what do you think can be the issue?

  • @Harridu
    @Harridu 7 หลายเดือนก่อน

    This tool needs a second video: How to manage a set of servers, all with a common set of base packages, but each with its own configuration as well, eg Kubernetes control plane or worker nodes, storage and backup, monitoring, messaging, etc.

  • @blahblahblahblah2933
    @blahblahblahblah2933 3 ปีที่แล้ว +1

    Love the shirt.

  • @paultruzzi911
    @paultruzzi911 2 ปีที่แล้ว

    I know several things have changed in Ansible since this video was produced. But I'm having a problem with the copy sudoers_ansible section.
    - name: copy sudoers_ansible
    copy:
    src: files/sudoers_ansible
    dest: /etc/sudoers.d/ansible
    owner: root
    group: root
    mode: 0440
    I get an error that I can't decypher:
    TASK [copy sudoers_ansible] ***************************************************
    fatal: [localhost]: FAILED! => {"changed": false, "checksum": "9c9e5aae4aa1c02a4934d7172d2c4cd6c057d15d",
    "msg": "Unsupported parameters for (ansible.legacy.copy) module: root Supported parameters include:
    _original_basename, attributes, backup, checksum, content, dest, directory_mode, follow, force, group,
    local_follow, mode, owner, remote_src, selevel, serole, setype, seuser, src, unsafe_writes, validate"}
    As best as I can tell, we are only using 5 parameters, src, dest, owner, group & mode. All of which are identified as being supported.
    Any ideas?

    • @paultruzzi911
      @paultruzzi911 2 ปีที่แล้ว

      I found my problem. I had two different users.yml files and the one being used had root: root rather than group: group

  • @bluesdog88
    @bluesdog88 3 ปีที่แล้ว +1

    OMG How do you get a unicorn in your terminal? lol that's awesome!!

    • @LearnLinuxTV
      @LearnLinuxTV  3 ปีที่แล้ว +3

      It's super easy. If your distribution supports emoji's, then copy this and paste it into the PS1 prompt in your .bashrc: 🦄

    • @bluesdog88
      @bluesdog88 3 ปีที่แล้ว

      @@LearnLinuxTV Thanks!

  • @cgarafulic
    @cgarafulic ปีที่แล้ว

    Using the initial commit, I got the error "ERROR! 'host' is not a valid attribute for a Play". I fixed changing the yml file to:
    ---
    - name: Install htop
    hosts: localhost
    connection: local
    become: true
    tasks:
    - name: Install htop
    apt:
    name: htop

    • @cgarafulic
      @cgarafulic ปีที่แล้ว

      Great video, Jay. Aside from the syntax change that I found, everything went smoothly. Thank you!!!!

  • @Squash_Man
    @Squash_Man 8 หลายเดือนก่อน

    I know this may sound knit picky but I think the title of your video is misleading. To me this is more of using Ansible Pull to manage existing servers. That has nothing to do with workstation or server builds. If you were doing some kind of automated install/build with Kickstart and Ansible Pull then that would be considered a build.