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 Наука
So grateful for this useful series. Wish you all best things
Great addition to my learning of ansible. Awesome!
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.
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.
great video, very simple yet useful, thanks man !!
Smashing T-shirt, Jay :). Thumbs-up just for the T-shirt, before watching the video :)
Youre amazing !! Thank you for this series its really good and i find it so usefull!!
Thank you for this series 😊😊😊😊😊
great series, thanks for sharing🤩
Great content
Thank you so much.
Nice T man, thanks for the videos.
Awesome!
Brilliant 👍
amazing shirt :], VGood tutorial!!!
love the shirt :)
thanks a lot
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.
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. )
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
May be it didnt make any difference, lol
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.
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.
where did you setup these multiple servers?
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...
You included so much other info, I totally missed the when condition.
How to specify centos passwd as it is different in centos than ubuntu
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"
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.
I'm watching a video on ansible, and the most puzzling thing was: " How the f... did he cut and paste in nano?? ;-)
@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”.
Hi, l have RedHat 8 and after watching this tutorrial httpd is not getting installed ? , how l can troubleshoot ?
It's ok. l have found where there was a problem , thanks
Apt then when feels backwards. I'm used to condition first.
when: ansible_distribution == ["Debian", "Ubuntu", "Pop!_OS"] fails...Anyway to get popos in there? version 20.04
check the correct syntax. You should change == with in just like Jay show us from 09:11 to 09:50
Am still speechless
Teach me anisble and git at the same time 🤣🤣
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"}"?
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