# Unable to automatically determine host network os. Please manually configure ansible\_network\_os value for this host

**URL:** <https://forum.ansible.com/t/unable-to-automatically-determine-host-network-os-please-manually-configure-ansible-network-os-value-for-this-host/3646>\
**Category:** Get Help\
**Tags:** playbook\
**Created:** [February 4, 2024, 8:19pm UTC](https://forum.ansible.com/t/unable-to-automatically-determine-host-network-os-please-manually-configure-ansible-network-os-value-for-this-host/3646 "2024-02-04T20:19:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyrus](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@cyrus](https://forum.ansible.com/u/cyrus)\
**Post date:** [February 4, 2024, 8:19pm UTC](https://forum.ansible.com/t/unable-to-automatically-determine-host-network-os-please-manually-configure-ansible-network-os-value-for-this-host/3646/1 "2024-02-04T20:19:40Z")

</div>

I’m getting an unable to automatically determine host network os. Please manually configure ansible\_network\_os value for this host. I tried several ways to add ansible\_network\_os to the yml file but it didn’t work. I tried to use a var attribute in the yml file but it didn’t work. Please advise with an example. thanks.

 ![sec5lesson28](https://us1.discourse-cdn.com/ansible/original/2X/9/981fdc7e9694d85bf5739e242a15e7d17267d973.png)

- my code!

 ![getarp1.yml-code](https://us1.discourse-cdn.com/ansible/original/2X/2/21e13b05e3eeed5d0944885afce52b34533481e5.png)

---

<div class="post-metadata">

**Author:** ![akira6592](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akira6592/32/222_2.png) [@akira6592](https://forum.ansible.com/u/akira6592)\
**Post date:** [February 5, 2024, 10:53am UTC](https://forum.ansible.com/t/unable-to-automatically-determine-host-network-os-please-manually-configure-ansible-network-os-value-for-this-host/3646/2 "2024-02-05T10:53:55Z")

</div>

@cyrus Hello.

The images do not seem to be attached properly.

Could you paste it back in as text?

---

<div class="post-metadata">

**Author:** ![gwmngilfen](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gwmngilfen/32/6_2.png) [@gwmngilfen](https://forum.ansible.com/u/gwmngilfen)\
**Post date:** [February 5, 2024, 2:35pm UTC](https://forum.ansible.com/t/unable-to-automatically-determine-host-network-os-please-manually-configure-ansible-network-os-value-for-this-host/3646/3 "2024-02-05T14:35:35Z")

</div>

I fixed the post for @cyrus, although I’d agree with using text as it’s searchable for other users 🙂

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [February 5, 2024, 11:57pm UTC](https://forum.ansible.com/t/unable-to-automatically-determine-host-network-os-please-manually-configure-ansible-network-os-value-for-this-host/3646/4 "2024-02-05T23:57:55Z")

</div>

Have you tried setting the variable in your inventory? [Build Your Inventory — Ansible Documentation](https://docs.ansible.com/ansible/latest/network/getting_started/first_inventory.html#add-variables-to-the-inventory)

Here’s an example setting ansible\_network\_os for all hosts in a group called `ios`: [IOS Platform Options — Ansible Documentation](https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html#example-cli-group-vars-ios-yml).

Or you could use the `vars:` keyword:

```auto
- hosts: all
  vars:
    ansible_network_os: cisco.ios.ios # set for a play
  tasks:
    - ios_command:
        command: "{{ cmd }}"
      vars:
        ansible_network_os: cisco.ios.ios # set for individual task

```

There are a some additional ways to set variables: [Using Variables — Ansible Documentation](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#where-to-set-variables).
