Wow, this is going to be a large chapter. I would rather use some tasks sequence that first checks things, and based on the results, execute some action. I’m not a big fan of block, rescue & always, it increases complexity, can possible show red output (errors), which can throw of people. ![]() The alwasy will run anyway, no matter what the first ( Start httpd) task does. “If starting httpd fails, install httpd.” (What’s incorrect here is that there can be many more reasons for httpd to fail, plus if it fails, httpd would be installed, but never started. name : Do something hosts : web_servers become : no gather_facts : no tasks : - name : Start the webserver block : - name : Start httpd : name : httpd state : started rescue : - name : Install httpd : name : httpd always : - name : Show a message : msg : " Hello!"Īlthough the example above makes no sense, it does demonstrate how the rescue statement works. Sometimes you want to limit the number of nodes being addressed at one time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |