Getting started with Ansible 06 - Writing our first Playbook

แชร์
ฝัง
  • เผยแพร่เมื่อ 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 video #6, we get started on writing playbooks, which is how we'll use Ansible from here on out.
    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 (Running Commands): linux.video/ansible4
    Part 5 (Running Elevated Commands): linux.video/ansible5
    Part 6 (This video)
    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
    ☁️ Get $100 in credit toward deploying your very own Linux servers on 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
    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
    #AnsiblePlaybook #Ansible #LearnAnsible
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    this guy is amazing, even better than the videos that i pay on udemy

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

      right? they are really well done.. I love that he went over basics like SSH keys prior to doing any Ansible content.

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

      Couldn't agree more. He's an excellent teacher and doesn't gloss over the issues that other instructors just take for granted are already known.

    • @c1sc0m
      @c1sc0m 2 หลายเดือนก่อน

      😝 I totally agree!

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

      are you buy mumshad's course ?

  • @ToGoMania19
    @ToGoMania19 หลายเดือนก่อน +1

    Thanks! I’m enjoying this Ansible series with Git also!

  • @zhulianstoyanov9198
    @zhulianstoyanov9198 2 หลายเดือนก่อน +2

    the pace of the explanation is awesome. just what I needed. thank you for sharing your knowledge with us.

  • @user-wm5rh8hw8q
    @user-wm5rh8hw8q 7 วันที่ผ่านมา

    so great content on ansible, easy to understand and follow

  • @mathewmickle3116
    @mathewmickle3116 หลายเดือนก่อน +1

    Thank you soo much for this series and all the other ones you do.

  • @CoreyTyhurst
    @CoreyTyhurst 7 หลายเดือนก่อน +3

    I finally found the time to sit down and set this up on my homelab. Not only does it feel great to have ansible/automation working, but this also has been a great way to truly understand how ssh keys and git work from the command line. Top notch content. Thank you so much for enabling all of us noobs to upskill and do cool stuff!!

  • @HungNguyen-si2xe
    @HungNguyen-si2xe 2 ปีที่แล้ว +2

    For the amount of videos that I have been watching, none is better than Jay's. Bless you and your family.

  • @fabrice9848
    @fabrice9848 11 หลายเดือนก่อน +7

    I wish there were more youtubers like you... This Ansible series is fantastic!

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

    this is a really great series. i never thought i could get this kind of quality instruction on youtube.

  • @KenPryor
    @KenPryor 5 หลายเดือนก่อน +4

    I've started and stopped with Ansible videos before because they just didn't explain everything I needed to know. I'm so happy I found this series because I am finally getting all the info I need to get it working. I appreciate how you explain everything and make it so easy to understand. Thank you!

    • @LearnLinuxTV
      @LearnLinuxTV  5 หลายเดือนก่อน +4

      I m really glad you found value and thank u for the kind comment

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

    One of the finest technical presentation series I've seen. Well done ! thank you

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

    A good series, thank you. I look forward to the next episodes.

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

    Awesome course . Thank You !

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

    Awsome! Thank you

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

    I like how easily you explain the yaml basics, just enough for what we need in this video. Thanks to you I'm getting the hang of git commands and ansible!

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

    Dear Jay, your illustration of the first playbook was amazing. I loved it. Thank you again !!. Mat.

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

    Great introduction to Ansible. The depth and pace you adopt are just right. The section on ssh, git was very useful to have a great start in doing things the right way.

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

    Great stuff, Jay. Thank you. Playbooks are bringing a lot of fun and efficiency into this. That's what I'm here for. Very helpful playlist so far. 🤝

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

    This playlist is amazing!

  • @davidtalturejman9185
    @davidtalturejman9185 9 หลายเดือนก่อน

    Youre amazing! Thanks for the good content man

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

    I have to say, your videos are perfect! At first I saw other shorter tutorials about ansible on youtube but I had many questions that werent answered there. Then followed your tutorial and I am not even half your course yet but I can say that your course is great. It is as if you know what is in my head becouse you always explain everything I have in mind watching your tutorial. Perfectly organized and it just all makes sense . Great job and thank you for your work!

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

    Just another great video from Jay. Thanks a lot!

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

    Amazing series Jay! It's highly recommended! Thanks a lot for share!

  • @user-mv2ro9sl1x
    @user-mv2ro9sl1x 9 หลายเดือนก่อน

    Excellent idea to use apache as example here !

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

    Great content, looking forward to the next video

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

    Going through the series. And have to say ... Love ya work chap.

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

    Man, you are seriously amazing. Thank you!

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

    Thanks for sharing such amazing contents, very helpful to learn ansible.

  • @uripessach
    @uripessach 9 หลายเดือนก่อน

    Thanks a lot for this great Ansible course ! much appreciated 🙂

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

    Thanks for this course dude, this is gold content

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

    what a nice tutorial.. starting from the foundation practices.

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

    You are amazing Jay " keep going "

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

    you are so awesome _ great topic plus easy explanation ever seen

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

    Great series 👍🏻

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

    Thank you for this so much. I use Ansible (and the free AWX GUI) to launch and combine playbooks and combines plays at work. While I’m very comfortable on the operational side, I still need this little boost with understanding the core authoring of playbooks. Really, thank you.

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

    legit content - well done and well presented

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

    Jay, great series on Ansible! Just to let you know, I created three identical Ubuntu 20.04 LTS Server VMs in Virtual Box (by creating one and cloning the other two), then changed the hostnames on the 2nd and 3rd VM and set all Servers to static IP addresses before following your video series on running ansible playbooks. I performed all of this by setting up the VMs on my FerenOS Main PC allocating 1GB VRAM to the Servers, then did everything else from my Acer Aspire laptop. I was totally successful in running everything that you did in your videos. Being a retired IT guy myself, I found it extremely rewarding to be able to run multiple command executions on multiple servers simultaneously on a Linux (versus Windows) network. Great job!

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

    playing your videos in 1.25 speed is perfect

    • @nikikovacs1923
      @nikikovacs1923 25 วันที่ผ่านมา

      I just tried that, and my blood pressure instantly went up a notch. Nah, 1.00 is fine.

    • @bashardlaleh2110
      @bashardlaleh2110 25 วันที่ผ่านมา

      @@nikikovacs1923 depends on your English and Tech skills 😉

    • @nikikovacs1923
      @nikikovacs1923 25 วันที่ผ่านมา

      @@bashardlaleh2110 I could probably watch the whole thing in 2.0 (I teach Linux system administration at our local university and I'm a tech writer for the Linux Professional Institute). But do I really want to do that? Nope. Chi va piano va sano. :o)

  • @akashpatel2338
    @akashpatel2338 6 หลายเดือนก่อน

    Awesome! Thanks!

  • @jean-philippehenry5805
    @jean-philippehenry5805 3 ปีที่แล้ว +4

    "I won't judge you even if it's emacs", lol, you killed me
    Thank you so much for your work. Know that it helps a lot demystifying Ansible.

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

    You are so awesome. Thanks for the video

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

    Thanks for the great series. Though I am not new to ansible, one can always learn something from others so I decided to watch them all.
    I know it may sound trivial, but I think it is an important correction, or at least something that should be conveyed.
    You refer to tasks within a play as plays. This may trip folks up if/when they ever test or go to certify on the topic.
    For example:
    ---
    # Simple playbook with two plays
    - name: name of first play
    hosts: all
    tasks:
    - name: name of first task
    - name: name of second task
    - name: name of second play
    - name: name of first task
    - name: name of second task
    In all honesty, most of us simply execute all of our items within a single play but as individual tasks... however I think its fairly important to distinguish the differences between plays and tasks. Another way to look at it is that the first, non-tabbed column are individual plays, everything indented underneath them is part of that play.
    I hope this just came through as a suggestion for completeness and not a nitpick. :) Thanks again for taking the time to film, edit, and share your videos.

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

    Someone should make a package called chocobo, just to troll Jay....jk Great video! I'm learning a lot.

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

    Great Job! Thank you so very much

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

    thanks a lot for the tutorial

  • @harunaadoga
    @harunaadoga 10 หลายเดือนก่อน

    Thank you!

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

    Thanks Jay

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

    Thanks!

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

    Awesome

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

    Awesome videos for free

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

    Your videos are the best on youtube! Thanks for all your efforts - I am learning lots. How about somrthing about password management? I have been usin Lastpass for many years but have become frustrated with it as most passwords seem to be associated with usernames. Any suggestions?

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

    ESC :q! yourself! vim user! :D Enjoyed the series.

  • @devproco8063
    @devproco8063 9 หลายเดือนก่อน

    Just for clarification, @8:40, I am assuming that `ok=2` because there were "two steps" that were performed on the node (including gathering facts) which were successful?

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

    Hello Jay @Learn Linux TV . One question, how do I know the exact name of the package I want to install? is there a list I can look up online? I noticed you knew beforehand that it was named "apache2".

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

    hi sir,
    permission to ask there are tools such as ansible to manage mobile apps?? thanks

  • @danielpamiesteruel203
    @danielpamiesteruel203 5 หลายเดือนก่อน

    god video, do you do make video for playbook installing a dns service on each server

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

    Great. One comment: when you changed the state to absent to uninstall Apache, you should have probably change the name of the task (play) as well to read something like "Uninstall apache2 package"

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

    the content is pretty good and demos are awesome, kinda giving good competition to the pluralsight lectures...by Wes Higbee.

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

    Sir the writing format you are using in writing the playbook its a bit confusing as the alignments of sentences are having long spaces or hyphens is this standard change when writing long playbooks. I am new to this sort of thing i don't have any developer/coder background

  • @reza.sadriniaa
    @reza.sadriniaa 2 ปีที่แล้ว

    What is the name of the bar at the bottom of tmux?

  • @MrSandshadow
    @MrSandshadow 10 หลายเดือนก่อน

    how to use ansible in the non interactive way? / how to use become without being asked for password but rather feed it throught var / env-var / stdio ?

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

    I may have misunderstood how Ansible works, but, still..., what's behind the ansible module? In playbooks we can use modules with their respective parameters, but what makes that module execute whatever it says it will execute on an agentless machine? What made the apt module do its job it there is nothing on the targeted machines to interpret that module and do whatever the module is intended to do, in this case to install a package using apt?

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

      The modules are written in Python. So when you call a module, there is a Python script that makes the OS calls, most likely using the os library in Python. So nothing is being installed on the remote machine, it is actually establishing an SSH connection and then running Python commands to do the work.

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

    8:40 ok equals two, what does number two mean ?
    p/s :I understood, number two is the tasks

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

    what is the become password

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

    "even if it's emacs". Suspicious. :-)

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

    at 12:30 he says 'let's add another play', but he should have said 'let's add another task'.

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

    i got this error when running the install_apache.yml:
    ERROR! 'task' is not a valid attribute for a Play
    The error appears to have been in '/home/mojo/ansible_test/install_apache.yml': line 3, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.
    The offending line appears to be:
    - hosts: all
    ^ here

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

      did you fix this error?

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

      that would be the - name, either not alligned correctly to above or no space between the - and name, ansible is super fussy about spacing

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

    I need more assistance learning ansible

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

    "I won't judge you, even if its emacs" 😂

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

    What is this become password?

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

    why compare nano and vim with emacs ... nano and vim is text editors and emacs is a OS ... how can you compare this ?

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

      Emacs is a text editor as well.

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

      @@JamesGaither11 well using shall commands like echo and sed is better to change text files then Emacs so ... well ... emacs is not design to be good for any thing, it is design to do everything and do a really bad job of it because of this

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

      @@zeocamo emacs is an old style text editor. Some people still prefer it. I am not one of those. I was just highlighting to you that it is a text editor since you said it was an OS.

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

      @@JamesGaither11 yea ok i can see that, notepad is a text editor too .. for someone ...

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

      @@zeocamo yes it is?

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

    How dare you sir! Emacs is clearly superior. Sure, I had to have my left hand amputated due to crippling arthritis, but is is a small price to pay for the privilege of using the superior text editor.

  • @ademgokce3136
    @ademgokce3136 3 หลายเดือนก่อน

    his knowledge and explanation is great but both beginning and end of the video is too long which is not related content. Hopefully, he will take care this concern for upcoming series...

  • @nikikovacs1923
    @nikikovacs1923 25 วันที่ผ่านมา

    "I won't judge you even if it's Emacs" ==> HA HA HA HA HA HA HA !!!!

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

    3:06 Did you add `become = True` to `ansible.cfg` like this:
    [privilege_escalation]
    become = True
    Why not add `become_ask_pass = True` there too?

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

    The indentation requirements makes my blood boil.

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

      It does seem really janky. I played around with it at my last job and it seemed like I got constant errors about the config file and lining things up. I have no issue in Python or in other languages with indentation, but for some reason yaml just never felt all that intuitive to me. I'd probably get it if I spent more time with it, but this is the only time I've ever come across that markup language.