Then the issue must in the playbook itself.
What does that look like?

On Sat, 16 Oct 2021 at 18:26, James Ngo <[email protected]> wrote:

> Hello everyone,
> I am a pretty new face to Ansible. I can follow instruction pretty good
> however, I need your help with the following scenario.
> I created an .INI style inventory file called "hosts", with basically
> categorize our devices/servers in different groups like below
>
> +++++++++++++++++++
> [Ubuntu]
> 192.168.100.105
> 192.168.100.106
>
> [Windows]
> 192.168.100.200
> 192.168.100.201
>
> [Mac]
> 192.168.100.300
> 192.168.100.301
>
> ++++++++++++++++++++++
> This inventory file is saved in ~/ansible/inventory/hosts
> Playbook file (called play1.yml) is saved in ~/ansible/plabooks/play1:
> check for updates
>
> I can ping the devices in [Windows] group using this command:
> $ ansible -i ./inventory/hosts Windows -m ping --user admin --ask-pass
>
> Now, I try to check for updates for just the devices/machines in [Windows]
> group, using this command:
> $ ansible-playbook ./playbooks/play1.yml --user admin --ask-pass
> --ask-become-pass -i ./inventory/hosts Windows
>
> It returns error that it does not know what devices/machines that I'm
> targeting at. In another word, it does not recognize my flag
> ./inventory/hosts Windows
>
> Could someone guide me how to make the proper reference to a specific
> group of the machines?
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/66ff95de-e6ca-46fb-9718-8ddbe9eb89acn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/66ff95de-e6ca-46fb-9718-8ddbe9eb89acn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwMwKwF%2B-xBp7uS3hDT2VHqXgLPr4%3Dd-LnbizF9K6QUZMQ%40mail.gmail.com.

Reply via email to