Regarding Ansible Testing For Linux, Mac and Windows #4248
Replies: 4 comments 5 replies
-
@ssbarnea / @cidrblock / @audgirka / @alisonlhart ---- Hello, Need Quick Help/ Guidance would be much Appreciated 👍 |
Beta Was this translation helpful? Give feedback.
-
@mavsravikiran - Can you explain a bit further? Do you have multiple roles per repository as in a collection or do you have one role in a repository and you're trying to test that? I can't speak for Windows, but we run Molecule in MacOS as well as Linux to test individual roles, playbooks and also multiple roles within a collection. |
Beta Was this translation helpful? Give feedback.
-
@isuftin /@ssbarnea / @cidrblock / @audgirka / @alisonlhart --- Quick Help/Support is much Appreciated 🙂 |
Beta Was this translation helpful? Give feedback.
-
What I've done is set things up as an actual collection, included a /playbooks/ directory which includes one playbook per role I'm testing. I then override Molecule's converge playbook just run each playbook which, in turn, runs each role. Here's what that looks like:
molecule/common/converge.yml looks like: ---
- name: Run SSL Certificates Playbook
import_playbook: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/playbooks/ssl_certificates/site.yml"
- name: Run Docker Playbook
import_playbook: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/playbooks/docker/site.yml" playbooks/docker/site.yml looks like: ---
- name: Docker
hosts: all
gather_facts: false
tasks:
- name: Include Docker Role
ansible.builtin.include_role:
name: wma.general.docker (note that my collection's namespace is wma and name is general). I have it locally inside of a directory path that is in /home/myuser I also have .ansible.cfg that includes: [default]
collections_path=~/.ansible/collections:/usr/share/ansible/collections:/home/myuser/ansible/collections/ansible_collections/ Let me know if you have questions about that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Scripting
maven
Requirement
Ask / Help
Please kindly help on this and quick support is much Appreciated 👍
Beta Was this translation helpful? Give feedback.
All reactions