--- # defaults # ======== - name: create defaults directory file: path: "{{ role_dest }}/defaults" state: directory when: role_defaults - name: create defaults/main.yml template: src: defaults/main.yml.j2 dest: "{{ role_dest }}/defaults/main.yml" force: "{{ role_force }}" when: role_defaults # files # ===== - name: create files directory file: path: "{{ role_dest }}/files" state: directory when: role_files # TODO: you might want to remove .gitkeep after the dir has actual contents # but this would keep creating it. - name: create a .gitkeep in the files directory copy: content: "" dest: "{{ role_dest }}/files/.gitkeep" force: "{{ role_force }}" when: role_files # handlers # ======== - name: create handlers directory file: path: "{{ role_dest }}/handlers" state: directory when: role_handlers - name: create handlers/main.yml template: src: handlers/main.yml.j2 dest: "{{ role_dest }}/handlers/main.yml" force: "{{ role_force }}" when: role_handlers # meta # ==== - name: create meta directory file: path: "{{ role_dest }}/meta" state: directory when: role_meta - name: create meta/main.yml template: src: meta/main.yml.j2 dest: "{{ role_dest }}/meta/main.yml" force: "{{ role_force }}" when: role_meta # tasks # ===== - name: create tasks directory file: path: "{{ role_dest }}/tasks" state: directory when: role_tasks - name: create tasks/main.yml template: src: tasks/main.yml.j2 dest: "{{ role_dest }}/tasks/main.yml" force: "{{ role_force }}" when: role_tasks # templates # ========= - name: create templates directory file: path: "{{ role_dest }}/templates" state: directory when: role_templates # TODO: you might want to remove .gitkeep after the dir has actual contents # but this would keep creating it. - name: create a .gitkeep in the templates directory copy: content: "" dest: "{{ role_dest }}/templates/.gitkeep" force: "{{ role_force }}" when: role_templates # vars # ==== - name: create vars directory file: path: "{{ role_dest }}/vars" state: directory when: role_vars - name: create vars/main.yml template: src: vars/main.yml.j2 dest: "{{ role_dest }}/vars/main.yml" force: "{{ role_force }}" when: role_vars # readme # ====== - name: create README.md template: src: README.md.j2 dest: "{{ role_dest }}/README.md" force: "{{ role_force }}" when: role_readme # library # ======= - name: create library directory file: path: "{{ role_dest }}/library" state: directory when: role_library - name: create a .gitkeep in the library directory copy: content: "" dest: "{{ role_dest }}/library/.gitkeep" force: "{{ role_force }}" when: role_library # modules # ======= - include: module.yml with_items: "{{ role_modules }}" loop_control: loop_var: role_module # Plugins # ===================================================================== # Filter PLugins # --------------------------------------------------------------------- - when: role_filter_plugins|length > 0 name: >- Generate filter plugin files. include: >- {{ role_path }}/tasks/plugins/filter_plugins.yml