Summary
In this chapter, you learned how to create multiple objects iteratively. We started with an overview of the omnipotent with
statement and its various forms. Then, we dove deeper into iterating the two most essential data structures, which are, arrays and hashes. The php5-fpm
role takes an array with a list of packages and creates a task to install those in a loop. To create MySQL databases and users, we defined variable dictionaries or hashes and iterated them. Finally, we added Nginx template configurations to create multiple virtual hosts serving PHP applications by iterating a nested dictionary.
In the next chapter, you will learn how to discover information about other nodes using magic variables.