Getting started with Ansible 07 - The 'when' Conditional

Поделиться
HTML-код
  • Опубликовано: 4 авг 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 #7, we take a look at differentiating our playbook based on the distribution of the target.
    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 (Writing our First Playbook): linux.video/ansible6
    Part 7 (This video)
    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
    Wiki article for this video:
    www.learnlinux.tv/getting-sta...
    🙌 Support me on Patreon and get early access to new content!
    ➡️ learnlinux.link/patron
    🛒 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
    #Ansible #Linux #LearnLinux
  • НаукаНаука

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

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

    So grateful for this useful series. Wish you all best things

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

    Great addition to my learning of ansible. Awesome!

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

    Thank you thank you for making this so simple and clear. I love the pace and clarifications of what all the modules and abbreviations mean. Best video on Ansible so far.

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

    I love to learn best practices from the beginning to get used to work properly to face a real job with confidence. Thanks for that. After the job is done, you git it. Just like breathing, you just do it.

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

    great video, very simple yet useful, thanks man !!

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

    Smashing T-shirt, Jay :). Thumbs-up just for the T-shirt, before watching the video :)

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

    Youre amazing !! Thank you for this series its really good and i find it so usefull!!

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

    Thank you for this series 😊😊😊😊😊

  • @loren683
    @loren683 3 месяца назад

    great series, thanks for sharing🤩

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

    Great content
    Thank you so much.

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

    Nice T man, thanks for the videos.

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

    Awesome!

  • @user-go5fw5zw2l
    @user-go5fw5zw2l 11 месяцев назад

    Brilliant 👍

  • @hussamel-maghraby2077
    @hussamel-maghraby2077 2 года назад +1

    amazing shirt :], VGood tutorial!!!

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

    love the shirt :)

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

    thanks a lot

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

    Hey there Jay, thanks for the great video!!!, i was wondering if you can elaborate on how to add Centos 8 machine to the Ansible that i have on my Ubuntu 18.04.

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

    Hello sir , How do I compare if variable passed as a parameter exists in (output stored in) register? The register: policies (is in json format. )

  • @LudoArts
    @LudoArts 3 года назад +6

    Hi Jay, great tutorial again! Kudos!
    There's a little flaw in this video though. On the steps in de playbook where you update_cache, you are testing against "ansible_distribution_version" instead of "ansible_distibution"
    Appearantly it still works though ;-)
    Regards, Ludo

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

      May be it didnt make any difference, lol

    • @sashosfhc
      @sashosfhc 3 месяца назад

      It did make a difference, it works because both variables were correct - ansible_distribution == "CentOS" and ansible_distribution_version == "8.2", so both will work, even if you just specify one of them.

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

    Sir, I know when condition in runbook what it will do .. but my question was like when: {how to know here what to write} from ansible facts we have to choose.

  • @talhajavaid2778
    @talhajavaid2778 15 дней назад

    where did you setup these multiple servers?

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

    How can I create multiple VM with static IP's in Windows10 with VirtualBox just like in this series? Tried but couldn't make it...

  • @Ms.Robot.
    @Ms.Robot. 2 года назад +1

    You included so much other info, I totally missed the when condition.

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

    How to specify centos passwd as it is different in centos than ubuntu

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

    Is there a difference between "git push origin main" and "git push origin master"? I noticed in earlier videos you went with "main" and now it's "master"

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

      I's just an unusual name for the master branch. Github has become 'woke' recently and in a fit of political correctness they changed the default name for the master branch from master to main and are also trying very hard to force this nonsense onto unsuspecting users, even going as far as renaming their user's existing local(!) branches without their consent, etc. You can still keep using the master branch if you do not let github create an empty default repostory for you and avoid executing their malicious code snippet when pushing your existing repository to github for the first time.

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

    I'm watching a video on ansible, and the most puzzling thing was: " How the f... did he cut and paste in nano?? ;-)

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

      @kjakobsen If you look at the bottom of the editor, there is a list of commands you can use. The ^ character means CTRL. So, saving (Write Out) is CTRL + O, Cut text is CTRL+K and paste is CTRL+U.
      EDIT: At around 12:48 in the video, Jay marks text and then issues a copy and paste. I found a guide here, even with pictures included, apparently: www.tecmint.com/learn-nano-text-editor-in-linux/ in the section ”Copy/Paste/Cut Text in Nano”.

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

    Hi, l have RedHat 8 and after watching this tutorrial httpd is not getting installed ? , how l can troubleshoot ?

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

      It's ok. l have found where there was a problem , thanks

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

    Apt then when feels backwards. I'm used to condition first.

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

    when: ansible_distribution == ["Debian", "Ubuntu", "Pop!_OS"] fails...Anyway to get popos in there? version 20.04

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

      check the correct syntax. You should change == with in just like Jay show us from 09:11 to 09:50

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

    Am still speechless

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

    Teach me anisble and git at the same time 🤣🤣

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

    Is anyone else getting the error "fatal: [10.0.0.21]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (dnf) module: when Supported parameters include: allow_downgrade, autoremove, bugfix, conf_file, disable_excludes, disable_gpg_check, disable_plugin, disablerepo, download_dir, download_only, enable_plugin, enablerepo, exclude, install_repoquery, install_weak_deps, installroot, list, lock_timeout, name, releasever, security, skip_broken, state, update_cache, update_only, validate_certs"}"?

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

      I finally figured why I am getting the error. the ansible version that comes with my aws amazon linux 2 does not support "when" module. I had to read the error msg so many times and test the without the when module. the ansible 08 does away with when module.
      hope this helps