Getting started with Ansible 06 - Writing our first Playbook

Поделиться
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 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
  • НаукаНаука

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

  • @bensonwaweru4074
    @bensonwaweru4074 Месяц назад +3

    You are an amazing tutor. Am now a pro in ansible and git just by watching your tutorial

    • @Crowncity
      @Crowncity 26 дней назад +1

      Bro you're not lying at all 💯

  • @yichengliu
    @yichengliu 3 года назад +94

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

    • @Weirlive
      @Weirlive 2 года назад +10

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

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

      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 3 месяца назад

      😝 I totally agree!

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

      are you buy mumshad's course ?

  • @zhulianstoyanov9198
    @zhulianstoyanov9198 4 месяца назад +3

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

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

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

  • @KenPryor
    @KenPryor 7 месяцев назад +5

    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  7 месяцев назад +5

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

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

  • @kodikodi9948
    @kodikodi9948 2 года назад +8

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

  • @walterkelt4475
    @walterkelt4475 2 года назад +13

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

  • @CoreyTyhurst
    @CoreyTyhurst 9 месяцев назад +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!!

  • @mathewmickle3116
    @mathewmickle3116 2 месяца назад +1

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

  • @ToGoMania19
    @ToGoMania19 2 месяца назад +1

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

  • @kenrq63
    @kenrq63 3 года назад +5

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

  • @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!

  • @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!

  • @user-wm5rh8hw8q
    @user-wm5rh8hw8q Месяц назад

    so great content on ansible, easy to understand and follow

  • @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. 🤝

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

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

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

    Just another great video from Jay. Thanks a lot!

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

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

    Great content, looking forward to the next video

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

    This playlist is amazing!

  • @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!

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

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

  • @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!

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

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

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

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

    Thanks for this course dude, this is gold content

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

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

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

    You are amazing Jay " keep going "

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

    legit content - well done and well presented

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

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

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

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

    Youre amazing! Thanks for the good content man

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

    Awesome course . Thank You !

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

    Awesome! Thanks!

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

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

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

    Great series 👍🏻

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

    You are so awesome. Thanks for the video

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

    Great Job! Thank you so very much

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

    Awsome! Thank you

  • @chillnacho
    @chillnacho Год назад +1

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

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

    Excellent idea to use apache as example here !

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

    playing your videos in 1.25 speed is perfect

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

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

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

      @@nikikovacs1923 depends on your English and Tech skills 😉

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

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

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

    Thank you!

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

    thanks a lot for the tutorial

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

    Awesome

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

    Thanks!

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

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

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

    Thanks Jay

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

    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?

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

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

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

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

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

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

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

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

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

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

  • @reza.sadriniaa
    @reza.sadriniaa 2 года назад

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

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

    what is the become password

  • @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

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

    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 ?

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

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

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

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

  • @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 8 месяцев назад

      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

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

    What is this become password?

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

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

  • @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 4 месяца назад

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

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

    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?

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

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

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

  • @wysefavor
    @wysefavor 7 дней назад

    i will judge you if it is emacs ..lol