You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to make an automated testing tool, in which molecule imports the roles based on a certain name. But the problem is that when you include tasks in any molecule file, it will be executed inside the container, and not on the main machine. Any ideas?
Loop for finding roles in molecule converge.yml:
---
- name: Converge
hosts: all
tasks:
- include_tasks: ../../main.yml
main.yml:
- name: Find all roles starting with empty_
find:
path: "roles/"
file_type: directory
patterns: "empty_*"
register: roles_found
- name: Include all roles found starting with empty_
include_role:
name: '{{ temp_roleinput }}'
loop: "{{ roles_found['files'] | map(attribute='path') | map('regex_replace','^.*/(.*)$','\\1') | list }}"
loop_control:
loop_var: temp_roleinput
Loop result for finding roles locally (executed through normal playbook):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to make an automated testing tool, in which molecule imports the roles based on a certain name. But the problem is that when you include tasks in any molecule file, it will be executed inside the container, and not on the main machine. Any ideas?
Loop for finding roles in molecule converge.yml:
main.yml:
Loop result for finding roles locally (executed through normal playbook):
Loop result with molecule converge:
Beta Was this translation helpful? Give feedback.
All reactions