This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
ansible:ansible_presentation [2024/03/24 19:03] manu |
ansible:ansible_presentation [2024/04/18 00:21] (current) manu [Ansible Role directory structure] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Ansible presentation ====== | ====== Ansible presentation ====== | ||
| - | {{ansible:ansible01.png?600|}} | + | ===== Ansible Architecture Diagram and Ansible components ===== |
| - | Let’s look at what an Ansible Role directory structure looks like. | + | {{ansible:ansible02.png?500|}} |
| - | * **Tasks** : This directory contains one or more files with tasks . These file can also refer to files and templates without needing to provide the exact path. | + | ===== Ansible Role directory structure ===== |
| - | Handlers: Add all your handlers in this directory | + | |
| - | Files: This directory contains all your static files and scripts that might be copied or executed to remote machine. | + | {{ansible:ansible01.png?500|}} |
| - | Templates: This directory is reserved for templates that generate files on remote hosts. | + | |
| - | Vars: You define variables inside this directory and then can be referenced elsewhere in role. | + | * **Tasks:** This directory contains one or more files with tasks . These file can also refer to files and templates without needing to provide the exact path. |
| - | defaults: This directory lets you define default variables for included or dependent role. | + | * **Handlers:** Add all your handlers in this directory |
| - | meta: This directory is used for dependency management such as dependency roles. | + | * **Files:** This directory contains all your static files and scripts that might be copied or executed to remote machine. |
| + | * **Templates:** This directory is reserved for templates that generate files on remote hosts. | ||
| + | * **Vars:** You define variables inside this directory and then can be referenced elsewhere in role. | ||
| + | * **defaults:** This directory lets you define default variables for included or dependent role. | ||
| + | * **meta:** This directory is used for dependency management such as dependency roles. | ||
| + | |||
| + | Each directory must contain a main.yml file (or main.yaml or main) that contains the relevant | ||
| + | content for that directory. You can also use other YAML files in some directories to organize | ||
| + | your tasks or variables better. | ||