Created
July 12, 2017 14:59
-
-
Save samdoran/a6e75762b64e7ddaaa8c84f99796a9cc to your computer and use it in GitHub Desktop.
Get a list of task files and run them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: somehosts | |
become: yes | |
tasks: | |
- name: Get list of task files | |
find: | |
paths: /opt/ansible/tasks | |
patterns: '*.yml' | |
register: _task_files | |
- name: Include tasks | |
include: "{{ task_file.path }}.yml" | |
loop_control: | |
loop_var: task_file | |
with_items: "{{ _task_files.files }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment