Getting started with Ansible 04 - Running ad-hoc Commands

Поделиться
HTML-код
  • Опубликовано: 30 июл 2020
  • Ansible is an incredible configuration management and provisioning utility that enables you to automate all the things. In this series, you'll learn everything you need to know in order to use Ansible for your day-to-day administration duties. In the fourth episode, we install Ansible and use it to run some ad-hoc commands.
    Full series:
    Part 1 (Introduction): linux.video/ansible1
    Part 2 (SSH Overview & Setup): linux.video/ansible2
    Part 3 (Setting up the Git Repository): linux.video/ansible3
    Part 4 (This video)
    Part 5 (Running Elevated Commands): linux.video/ansible5
    Part 6 (Writing our first Playbook): linux.video/ansible6
    Part 7 (The "when" Conditional): linux.video/ansible7
    Part 8 (Improving your Playbook): linux.video/ansible8
    Part 9 (Targeting Specific Nodes): linux.video/ansible9
    Part 10 (Tags): linux.video/ansible10
    Part 11 (Managing Files): linux.video/ansible11
    Part 12 (Managing Services): linux.video/ansible12
    Part 13 (Adding Users & Bootstrapping): linux.video/ansible13
    Part 14 (Roles): linux.video/ansible14
    Part 15 (Host Variables): linux.video/ansible15
    Part 16 (Templates): linux.video/ansible16
    🙌 Support me on Patreon and get early access to new content!
    ➡️ learnlinux.link/patron
    Protect your servers and eliminate downtime with CloudLinux and KernelCare Limited-time Bundle: lp.kernelcare.com/bundle-lltv
    🛒 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
    Wiki article for this video:
    www.learnlinux.tv/getting-sta...
    🐦 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
    #Ansible #LearnAnsible #DevOps
  • НаукаНаука

Комментарии • 80

  • @philipsheaff
    @philipsheaff 3 года назад +92

    This is the best beginner Ansible tutorial on the Internet.

  • @DanCalloway
    @DanCalloway 3 года назад +31

    Great video series, Jay. The video, however, shows Part 3 rather than 4 at or around 00:34. Thought you may wish to correct. Thanks.

  • @juliengs
    @juliengs 3 года назад +2

    Thank you! It finally clicked! This is the best Ansible tutorial, hands down.

  • @boulouizmohammed6827
    @boulouizmohammed6827 3 года назад +1

    Best Ansible tutorial thanks king, i had searched for a long time a good tutorial

  • @JoeKingstonS
    @JoeKingstonS 2 года назад +5

    This is got to be one of the best Ansible videos. I learned so much, and the lessons are straightforward to follow. I appreciate the hard work you put into making this video.

  • @fredrik354
    @fredrik354 2 года назад +2

    This is a great start for someone who hasn't even seen Ansible before. Highly appreciated!

  • @mathewkargarzadeh3158
    @mathewkargarzadeh3158 2 года назад +6

    one of the best Ansible Tutorial I have seen so far. I love the pace of teaching and material. my friend my hat off to you. much appreciated. Thanks again !!. Mat

  • @sagarvispute
    @sagarvispute Год назад +4

    Jay you are doing great job. Explaining things nicely & calmly… keep up good work…👍🏻

  • @Practical-IT
    @Practical-IT 3 года назад +2

    Another great video in this series. Thanks so much!

  • @davidtalturejman9185
    @davidtalturejman9185 10 месяцев назад

    Thank you man.
    Youre just amazing.
    I really enjoy your videos, great teaching

  • @GaussscherEliminator
    @GaussscherEliminator 7 месяцев назад

    I just love it! Thank you so much for the whole tutorial!

  • @arghosinha1424
    @arghosinha1424 8 месяцев назад

    Thanks a lot, can't wait to check the next one.

  • @nivedithav1087
    @nivedithav1087 Год назад

    This is the best tutorial on Ansible Thank you Jay

  • @underbelle2374
    @underbelle2374 6 месяцев назад

    Thank you for this content, Very simplified.

  • @Cyko359
    @Cyko359 2 месяца назад

    Awesome tutorial, Thank you!!

  • @agroleau04
    @agroleau04 3 года назад

    Awesome content, thanks Jay!

  • @sussusamogus7831
    @sussusamogus7831 8 месяцев назад

    Great guide Jay

  • @karthickram3804
    @karthickram3804 9 месяцев назад

    Best video to learn about Ansible

  • @fabrice9848
    @fabrice9848 Год назад

    Great job Jay! Thaaaaank you.

  • @vialomur__vialomur5682
    @vialomur__vialomur5682 Год назад

    Thanks a lot for those videos!

  • @juancarlosaristizabal4838
    @juancarlosaristizabal4838 Год назад

    the best videos linux, Thanks so much!!!

  • @MohammadGholami-rb5xx
    @MohammadGholami-rb5xx 2 года назад

    great tutorial. thanks a million

  • @goldmuma
    @goldmuma 3 года назад

    thank you very much for your work

  • @gurudattanadig307
    @gurudattanadig307 3 года назад

    Awesome content.

  • @user-mv2ro9sl1x
    @user-mv2ro9sl1x 10 месяцев назад

    Thanks. Marvelous.

  • @SilentSolution
    @SilentSolution 2 года назад

    Thanks for your information sir

  • @kambizmoradi5723
    @kambizmoradi5723 3 года назад +3

    hi
    the video shows part 3 initial slide (0:34 to 0:42)
    love your channel

  • @davidtalturejman9185
    @davidtalturejman9185 10 месяцев назад

    Amazing! Wow

  • @RaspberryTech
    @RaspberryTech 3 года назад

    Yes I will click that like button, this content is great!

  • @balloney2175
    @balloney2175 2 года назад

    Very cool!

  • @lucasboglione
    @lucasboglione Год назад

    Thank you!!

  • @mihai6564
    @mihai6564 2 года назад

    thank you for the video

  • @mitupanigrahi7564
    @mitupanigrahi7564 10 месяцев назад

    I am glad to be a student of your Jay sir

  • @harunaadoga
    @harunaadoga 11 месяцев назад

    Thank you!

  • @pedronrivera22
    @pedronrivera22 3 года назад

    Thank you!!!

  • @vnetpost
    @vnetpost 2 года назад

    Thanks jay!

  • @petersoderstrom857
    @petersoderstrom857 3 года назад

    I thank you!

  • @kiki-vu9if
    @kiki-vu9if 2 года назад

    you're awesome!

  • @drewskiidub7640
    @drewskiidub7640 Год назад

    Your awesome!!!!!!!!

  • @GOOD_kidVSSATAN
    @GOOD_kidVSSATAN 11 месяцев назад

    very good

  • @dommbrown
    @dommbrown Год назад

    Love ya work. Have you ever had a look at Semaphore for Ansible? How about a tutorial on it you have come across it before?

  • @angelogoncalvesdias4504
    @angelogoncalvesdias4504 2 года назад

    Excellent!. I have a doubt. Since we have established the trust relationship among the servers, why should I pass the --key-file as a command argument? The ansible command will work without it.

  • @grahammccann8554
    @grahammccann8554 3 года назад

    Thank Jay :-)

  • @carloslizarralde4920
    @carloslizarralde4920 3 года назад

    why or what is the diff of apt OS ansible vs other pip ansible?

  • @learner90
    @learner90 Год назад

    Kindly make a series on terraform!

  • @Washout001
    @Washout001 4 месяца назад

    For anyone confused on the 'git push origin master' not working, think they've changed it to 'main' and not 'master' now for new repositories

  • @yavor1
    @yavor1 5 месяцев назад

    Nice work on the videos! To enhance clarity, please keep the top and bottom lines of the video free from text. This will help ensure important content is visible when pausing the video.

  • @dvn8ter
    @dvn8ter 7 месяцев назад

    ⭐️⭐️⭐️⭐️⭐️

  • @hamidja1537
    @hamidja1537 Год назад

    First, thanks for the amazing content.
    I am having one question:
    Was wondering why we are using the private key in this command (06:05)?
    Before creating the ansible.cfg file, I removed the private key file, and executed it, and it was working:
    ansible all -i inventory -m ping
    Does anyone know why?

    • @lukerand
      @lukerand 10 месяцев назад

      Maybe you have a second keypair that doesn't have a passphrase attached?

  • @automationlearner2253
    @automationlearner2253 2 года назад

    when i do ansible ping command its come with success result as expected but when i do ansible list-hosts or gather_facts commands its showing nothing has been connected means no server is been connected ..can you help me to fix this why is so happening

    • @automationlearner2253
      @automationlearner2253 2 года назад

      i fixed it ..needed to first create ansible.cfg then it got connected using same commands

  • @NameCallingIsWeak
    @NameCallingIsWeak 3 года назад

    2:40 create inventory

  • @NSXLA
    @NSXLA 3 года назад

    can't run ansible from home dir. i get error "module_stderr": "Shared connection to 192.168.1.19 closed.
    ",
    "module_stdout": "/bin/sh: /usr/bin/python: No such file or directory
    ",
    "msg": "MODULE FAILURE",
    also i can only use sudo from /etc/ansible and it pings fine - and had to add [centm-hosts:vars] ansible_python_interpreter=/usr/bin/python3
    to host file to get connection.

    • @blahblahblahblah2933
      @blahblahblahblah2933 3 года назад

      python not installed or no symlink to the appropriate binary? What distros did this happen on ?

    • @GuillermoPradoObando
      @GuillermoPradoObando 3 года назад

      Install the same version of python on the remote server "192.168.1.19" that ansible host has.

    • @Glatze603
      @Glatze603 3 года назад +1

      add "ansible_python_interpreter=/usr/bin/python3" to the end of your inventory file

    • @LeeRaymondCM
      @LeeRaymondCM 3 года назад +4

      I did an "apt update" right before "apt install ansible" and still it ended up installing Ansible 2.5 and all sorts of strange message came up. I google ansible installation and added an extra repository and did installation again - ended up with Ansible 2.9 and everything works like what Jay showed.
      edit: these are the commands I found:
      $ sudo apt install software-properties-common
      $ sudo apt-add-repository --yes --update ppa:ansible/ansible
      $ sudo apt install ansible

  • @HariHaran-xv9fp
    @HariHaran-xv9fp 11 месяцев назад

    what is the --key-file .. instead of that why can't we just do ansible all -m ping

  • @kimotroph9683
    @kimotroph9683 2 года назад

    Great tutorial 👌. Sometimes the presentation is ruined for me by a heavy east Indian accent that doesn't sound to me like English.. your delivery was well paced and intelligible

  • @rwm0268
    @rwm0268 2 года назад +1

    gather_facts isn't working for me. It looks like that module might have been replaced with the setup module.

    • @lindas.4376
      @lindas.4376 2 года назад

      It works for me.

    • @rwm0268
      @rwm0268 2 года назад

      @@lindas.4376 You must be running a different version.

    • @Nicklarose
      @Nicklarose 2 года назад

      it does not work for me either. If I run it from /etc/ansible/ it does work though. Trying to figure that out now

    • @TheBoomh
      @TheBoomh 2 года назад

      Rodney's correct. For those having issues, replace gather_facts with setup:
      ansible all -m setup
      Per redhat's documentation, ansible facts are only retrieved when working with playbooks, else you'll want to use setup module when using ad-hoc commands

    • @automationlearner2253
      @automationlearner2253 2 года назад

      @rodney mcbride i am also having same issue with gather_facts and list-hosts both commands ...did u fix it ? if so then please can u help me with that also

  • @user-tf1gk6bi3r
    @user-tf1gk6bi3r 6 месяцев назад

    i am very confused right now

  • @subho1766
    @subho1766 3 года назад +2

    Boy, that CentOS advt. aged like milk.

  • @GC-qe8vc
    @GC-qe8vc 2 года назад

    Thank you for the video series. A little suggestion: there's no need to say "go ahead and (verb)" all the time. Just use the verb. Example: instead of "going ahead and typing the IP adresses", just say "I will now type...". "Going ahead" is RUclipsr-speak and becomes annoying once you notice it (just like "smashing the like button")...

  • @diogocorreia4862
    @diogocorreia4862 Год назад

    Review: The intro image it's not correct

  • @user-yh8ce7tg8l
    @user-yh8ce7tg8l 7 дней назад

    til-d-ah, not til-d-ee

  • @tonyl4839
    @tonyl4839 2 года назад

    Hi Jay,
    Great Series on Ansible!!
    Watch the entire series first time around and now getting to hands-on...
    Running into issue running the command "ansible all --key-file ~/.ssh/ansible -i inventory -m ping
    I get the error "ansible: error: no such option: --key-file" ....has the option for specifying which SSH key been deprecated??
    Kindly help

  • @bhaktisn888
    @bhaktisn888 6 дней назад

    this is an amazing playlist
    I had a problem after running this command
    snb@ubuntu:~/bhakti$ ansible all --key-file ~/.ssh/ansible -i inventory -m ping
    ***.***.**.*** | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: ***.***.**.* Permission denied (publickey,password).",
    "unreachable": true
    }

    • @user-yh8ce7tg8l
      @user-yh8ce7tg8l 6 дней назад

      Verify the key file is actually working first # ssh -i ~/.ssh/ansible