Forced --limit

Hi!

I hope everything it’s ok for you.

I would like to know if it’s possible to use mandatory “–limit” when you run :
“ansible-playbook site.yml --limit DEVICE_1”

I explain, if i don’t use --limit, my playbook will deploy on all my devices.
Me, I want my playbook don’t run if --limit is not defined on my run ansible-playbook command

Thank you group !

I use

- hosts: "{{ ansible_limit }}"

V/r,
James Cassell

Thank you James! I'll try that tomorrow!

Have a good day

Thank you, it s work !

But, i have another question :slight_smile:
I use - hosts: “{{ ansible_limit }}” but i need to have “{{ ansible_limit }}” is included in group GROUP_1.

When i use “{{ ansible_limit }}”, it`s work for every host. I want to use var ansible_limit with condition, host is in group_1.

Thank you :slight_smile: