Learning Ansible by Madhurranjan Mohaan & Ramesh Raithatha
Author:Madhurranjan Mohaan & Ramesh Raithatha [Mohaan, Madhurranjan]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2014-11-26T22:00:00+00:00
Using filters with conditionals
You can use Jinja2 filters with conditionals for checking if the status of a task is failed, changed, success, or skipped. Let's start looking at examples:
In the preceding example, we first checked whether the httpd service was running and stored the output of that module in the httpd_result variable. We then checked whether the previous task failed using the Jinja2 filter, httpd_result|failed. Ansible will skip this task if the when condition fails, that is, if the previous task passed. Likewise, you can use changed, success, or skipped filters.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12587)
Hello! Python by Anthony Briggs(9924)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9800)
The Mikado Method by Ola Ellnestam Daniel Brolund(9784)
Dependency Injection in .NET by Mark Seemann(9347)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8309)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7770)
Grails in Action by Glen Smith Peter Ledbrook(7704)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7566)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7139)
Microservices with Go by Alexander Shuiskov(6902)
Practical Design Patterns for Java Developers by Miroslav Wengner(6819)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6759)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6422)
Angular Projects - Third Edition by Aristeidis Bampakos(6178)
The Art of Crafting User Stories by The Art of Crafting User Stories(5699)
NetSuite for Consultants - Second Edition by Peter Ries(5630)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5443)
Kotlin in Action by Dmitry Jemerov(5072)
