So many different ways to define ansible inventory, json, ini, yaml, dynamic, static etc. Here's a straightforward approach, hope that this helps.
inventory.ini
[all:children]
routers
switches
firewalls
[routers]
mx01 ansible_ssh_host=192.168.0.1
mx02 ansible_ssh_host=192.168.0.2
[firewalls]
srx01 ansible_ssh_host=192.168.0.11
srx02 ansible_ssh_host=192.168.0.12
[switches]
qfx01 ansible_ssh_host=192.168.0.21
qfx02 ansible_ssh_host=192.168.0.22
so the above, has 4 groups defined, all, routers, firewalls and switches. You can see that the group "all" is defined so that it will inherit the children from each of the defined groups. Of course you can create your own groupings, or not even have them, but you can see an approach in this example at least.
I've assigned the IP address for each host using the ansible_ssh_host variable, but once again IP addresses could be defined using any variable and then just provide the appropriate substitution when needed.
For device credentials, I'd stick them in a vault for security, but the yaml equivalent would be something like the following:
credentials:
host: "{{ ansible_host }}"
username: autouser
ssh_keyfile: /var/project/ssh_private_key/id_auto_user
port: 22
timeout: 180
So in this example above I'm pointing to a SSH keyfile for authentication, but it could be a "password" too.
Finally, when you create your playbook/role, then you will need to reference those credentials for the provider, e.g.
- name: Gather facts
juniper_junos_facts:
provider: "{{ credentials }}"
register: junos
Not sure if this is enough detail for you to progress further, if you're still blocked, then please shout again and I'll see what I can do to assist.
Regards,