It's not possible to conditionally run a playbook from another
playbook. Instead, rewrite the playbooks to roles for a
particular HW. For example
shell> cat roles/role2/tasks/main.yml
- debug:
msg: Runing on Dell
The playbook
- hosts: localhost
gather_facts: true
vars:
my_hw: "{{ ansible_system_vendor.split().0 }}"
my_roles:
HP: role1
Dell: role2
Lenovo: role3
tasks:
- debug:
msg: "{{ my_hw }} is in in my_roles: {{ my_hw in my_roles }}"
- include_role:
name: "{{ my_roles[my_hw] }}"
when: my_hw in my_roles
gives
msg: 'Dell is in in my_roles: True'
msg: Runing on Dell
--
Vladimir Botka