Summary
Ansible provides the capability to divide content logically into separate files. This capability helps project developers not repeat the same code over and over again. Roles within Ansible take this capability a step further and wrap some magic around the paths to the content. Roles are tunable, reusable, portable, and shareable blocks of functionality. Ansible Galaxy exists as a community hub for developers to find, rate, and share roles as well as collections. The ansible-galaxy
command-line tool provides a method to interact with the Ansible Galaxy site or other role-sharing mechanisms. These capabilities and tools help with the organization and utilization of common code.
In this chapter, you learned all about inclusion concepts relating to tasks, handlers, variables, and even entire playbooks. Then, you expanded on this knowledge by learning about roles—their structure, setting default variable values, and handling role dependencies. You then proceeded...