# Rename Network Interface

**URL:** <https://forum.ansible.com/t/rename-network-interface/835>\
**Category:** Get Help\
**Tags:** playbook, network\
**Created:** [September 15, 2023, 8:24pm UTC](https://forum.ansible.com/t/rename-network-interface/835 "2023-09-15T20:24:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 15, 2023, 8:24pm UTC](https://forum.ansible.com/t/rename-network-interface/835/1 "2023-09-15T20:24:56Z")

</div>

Hi Community !  
I’m getting failures msg for The task includes on this playbook…

```auto
- name: Rename network interfaces
  hosts: all
  become: true
  vars:
    src_prefix: "eth"
    dst_prefix: "em"
    osnet_conf: "/etc/os-net-config/config.json"
    src_interfaces: "{{ ansible_interfaces | select('match', src_prefix ~ '.*') | sort | list }}"
    undercloud_conf: "~/undercloud.conf"
  tasks:
    - debug:
        msg: "{{ src_interfaces }}"

    - name: Update udev rules
      tags:
        - udev
      lineinfile:
        line: >
          SUBSYSTEM=="net",
          ACTION=="add",
          DRIVERS=="?*",
          ATTR{address}=="{{ ansible_facts[item]['perm_macaddress'] | default(ansible_facts[item]['macaddress']) }}",
          NAME="{{ item | replace(src_prefix, dst_prefix) }}"
        path: /etc/udev/rules.d/70-rhosp-persistent-net.rules
        create: true
      with_items: "{{ src_interfaces | reject('match', '^.*\\..*$') | list }}"

```

Looks like ‘dict object’ has no attribute ‘macaddress’… and - name: Update udev rules no works…

Any Idea ?

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [September 16, 2023, 8:32am UTC](https://forum.ansible.com/t/rename-network-interface/835/2 "2023-09-16T08:32:56Z")

</div>

I believe you missed to scape the scaping character itself on the latest line (with\_items). This revised code works fine for me (I ran it on localhost, just change the host to whatever suits you):

```yaml
- name: Rename network interfaces
  hosts: localhost
  become: true
  vars:
    src_prefix: "eth"
    dst_prefix: "em"
    osnet_conf: "~/os-net-config/config.json"
    src_interfaces: "{{ ansible_interfaces | select('match', src_prefix ~ '.*') | sort | list }}"
    undercloud_conf: "~/undercloud.conf"
  tasks:

    - name: Debug message
      ansible.builtin.debug:
        var: src_interfaces

    - name: Update udev rules
      ansible.builtin.lineinfile:
        line: >-
          SUBSYSTEM=="net",
          ACTION=="add",
          DRIVERS=="?",
          ATTR{address}=="{{ ansible_facts[item]['perm_macaddress'] | default(ansible_facts[item]['macaddress']) }}",
          NAME="{{ item | replace(src_prefix, dst_prefix) }}"
        path: /etc/udev/rules.d/70-rhosp-persistent-net.rules
        create: true
      tags: udev
      with_items: "{{ src_interfaces | reject('match', '^.\\...*$') | list }}"

```

Results log:

```auto
(ansible_ve) [10:24:09] jbericat@localhost:~/DEV/repos/test$ ansible-playbook -i localhost ansible_forum_test.yml --ask-become-pass
BECOME password: 
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [Rename network interfaces] ***************************************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Debug message] ***************************************************************************************************************************************************************************************************
ok: [localhost] => {
    "src_interfaces": [
        "eth0"
    ]
}

TASK [Update udev rules] ***********************************************************************************************************************************************************************************************
changed: [localhost] => (item=eth0)

PLAY RECAP *************************************************************************************************************************************************************************************************************
localhost : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0   

```

```auto
$ cat /etc/udev/rules.d/70-rhosp-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?", ATTR{address}=="00:15:5d:c1:4d:80", NAME="em0"

```

Hope it helps 🙂

Cheers!

PS:

On this forum, I suggest you to wrap `yaml` code with ctrl-e, it will be easier to help 😉  
Also, when coding Ansible is a good practice to use FQDN’s for modules -using `ansible-linter` helps A TON with this and other coding issues

---

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 18, 2023, 1:34pm UTC](https://forum.ansible.com/t/rename-network-interface/835/3 "2023-09-18T13:34:03Z")

</div>

Thanks jbericat

I’m missing something else ! Its not working to me 🙁

So I got this results after playbook revision  
FAILED! =\> {“msg”: “The last includes an option with an undefinied variable. The error was: ‘dict object’ has no attribute ‘macaddress’ \n\nThe error appears to be in (my yml file): line 16, column 7, but may\nbe alsewhere in the file… -name: Update udec rulws\n ^here\n”}

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [September 18, 2023, 4:49pm UTC](https://forum.ansible.com/t/rename-network-interface/835/4 "2023-09-18T16:49:13Z")

</div>

Hello Bruno,

Can you provide the "/etc/os-net-config/config.json” file?

---

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 18, 2023, 6:34pm UTC](https://forum.ansible.com/t/rename-network-interface/835/5 "2023-09-18T18:34:09Z")

</div>

mmm ! You got the point !

I didn’t see any reference for this path ! Should I create on the Ansible host or on the client… To be honest I supposed tha needs to be on some repository I see some examples in the github…

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [September 18, 2023, 7:54pm UTC](https://forum.ansible.com/t/rename-network-interface/835/6 "2023-09-18T19:54:29Z")

</div>

hmmm… Now I think I rushed a little bit to answer in my last post (my bad!). Actually, the issue shouldn’t have nothing to do with the `osnet_conf` var, since it’s not being used on the playbook.

Anyway, to provide you with the proper help I would require more data… More precisely, what this error tells me is that ansible’s does not find the dict element `macaddress` on the `ansible_facts['eth0']` dictionary:

```auto
FAILED! => {“msg”: “The last includes an option with an undefinied variable. The error was: ‘dict object’ has no attribute ‘macaddress’ \n\nThe error appears to be in (my yml file): line 16, column 7, but may\nbe alsewhere in the file… -name: Update udec rulws\n ^here\n”}

```

Could it be that the interface you’re looking for is not included in the `ansible_facts`?

Try to add these tasks to your playbook in order to debug further:

```yaml
    - name: Debug message
      ansible.builtin.debug:
        var: src_interfaces

    - name: Show interface facts
      ansible.builtin.debug:
        var: ansible_facts['eth0']

```

Also, it would be helpful if you give us the whole playbook’s execution log (not only the error) to see what the `src_interfaces` variable has.

PS: This is my `ansible_facts['eth0']`, see if it gives you more clues to workaround the issue.

```auto
TASK [Show interface facts] ***************************************************************************************************************************************************************************************************
ok: [localhost] => {
    "ansible_facts['eth0']": {
        "active": true,
        "device": "eth0",
        "features": {
            ....
        },
        "hw_timestamp_filters": [],
        "ipv4": {
            "address": "x.x.x.x",
            "broadcast": "x.x.x.x",
            "netmask": "x.x.x.x",
            "network": "x.x.x.x",
            "prefix": "20"
        },
        "ipv6": [
            {
                "address": "fe80::215:5dff:fec1:4d80",
                "prefix": "64",
                "scope": "link"
            }
        ],
        "macaddress": "00:00:00:00:00:00",
        "module": "hv_netvsc",
        "mtu": 1500,
        "pciid": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "promisc": false,
        "speed": 10000,
        "timestamping": [
            "tx_software",
            "rx_software",
            "software"
        ],
        "type": "ether"
    }
}

```

---

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 18, 2023, 8:32pm UTC](https://forum.ansible.com/t/rename-network-interface/835/7 "2023-09-18T20:32:53Z")

</div>

> [@jbericat](#):
>
> to your playbook in order to debug further:

Lemme try it and back to you…

This is my target…  
The playbook includes the following operations:

- Adds a udev rules file with the new NIC name to MAC address assignments
- Renames and updates all `eth` device files to the new NIC naming scheme
- Renames and updates all `eth` route files to the new NIC naming scheme
- Performs a final regex on all `ifcfg-*` files to convert any `eth` devices to the new naming scheme

---

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 18, 2023, 9:09pm UTC](https://forum.ansible.com/t/rename-network-interface/835/8 "2023-09-18T21:09:22Z")

</div>

![Debug_line92](https://us1.discourse-cdn.com/ansible/original/1X/1420d69c3e86937edda4702a61134cc70d7dab74.png)

Sorry for this edited print screen… So looks like same error and more debug lines !

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [September 20, 2023, 5:49am UTC](https://forum.ansible.com/t/rename-network-interface/835/9 "2023-09-20T05:49:22Z")

</div>

Hello Bruno, it’s becoming kind-of hard for me to debug your issue without having the whole picture of your environment (actually, I haven’t been able to replicate the same error locally). Maybe we could have a synchronous talk? That’s my id on Matrix @jbericat:matrix.org

Cheers!

---

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 20, 2023, 1:31pm UTC](https://forum.ansible.com/t/rename-network-interface/835/10 "2023-09-20T13:31:31Z")

</div>

Hi Jordi ! I got some progress… So I tried one node that’s worked fine ! And another is now partial failing… It means I need to run on some more hosts…

Thanks for for your help ! 🙂

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [September 20, 2023, 2:03pm UTC](https://forum.ansible.com/t/rename-network-interface/835/11 "2023-09-20T14:03:49Z")

</div>

Awesome! I’m very happy I was somewhat able to help ☺

Good luck with the remaining nodes!

Cheers

---

<div class="post-metadata">

**Author:** ![Leo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leo/32/23_2.png) [@Leo](https://forum.ansible.com/u/Leo)\
**Post date:** [September 20, 2023, 7:03pm UTC](https://forum.ansible.com/t/rename-network-interface/835/12 "2023-09-20T19:03:10Z")

</div>

Hi @bspigari , welcome to the community forum! Let me share a couple of tips on using the forum:

I just edited your first message to include the code blocks for the playbook section, this makes it easier to read as it keeps the playbook format and spacing.

When composing your next messages, you can select the playbook you copy/pasted and use the \</\> button in the tool-bar right at the top of the message window where you are typing, this will automatically put it in the box you see in the messages above.

And if you get to a point where you consider a post by someone helped to solve the issue, please tick the checkbox below their message to mark it as the solution to help other users find the reply faster!

---

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 21, 2023, 6:23pm UTC](https://forum.ansible.com/t/rename-network-interface/835/13 "2023-09-21T18:23:01Z")

</div>

Hi !

We got the issues… but not clue yet…  
We are stuck on sub-interfaces…  
looping eth0, eth0\_1, eth1. the task failure indicates that ansible\_facts[‘eth0’][‘macaddress’] exists, but ansible\_facts[‘eth0\_1’][‘macaddress’] does not

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [September 21, 2023, 10:46pm UTC](https://forum.ansible.com/t/rename-network-interface/835/14 "2023-09-21T22:46:05Z")

</div>

Can you dump `ansible_facts[‘eth0’]` and `ansible_facts[‘eth0_1’]` for us? That would go a long way toward us being able to reproduce your issue. Thanks.

---

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 22, 2023, 1:48pm UTC](https://forum.ansible.com/t/rename-network-interface/835/15 "2023-09-22T13:48:39Z")

</div>

Hi Todd

Sure ! Looks like I have some limitation on this forum… So let me in case This part of dump of the job output is enough

TASK [Debug message] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /app/awxtmp/bwrap\_2947532\_b592cqna/awx\_2947532\_d0izo5ch/project/replace\_nic\_ethx.yml:12  
ok: [10.132.78.192] =\> {  
“src\_interfaces”: [  
“eth0”,  
“eth0\_1”,  
“eth1”  
]  
}

TASK [Debug ansible\_facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /app/awxtmp/bwrap\_2947532\_b592cqna/awx\_2947532\_d0izo5ch/project/replace\_nic\_ethx.yml:15  
ok: [10.132.78.192] =\> {  
“ansible\_facts[‘eth1’]”: {  
“active”: true,  
“device”: “eth1”,  
“features”: {  
“busy\_poll”: “off [fixed]”,  
“fcoe\_mtu”: “off [fixed]”,  
“generic\_receive\_offload”: “on”,  
“generic\_segmentation\_offload”: “on”,  
“highdma”: “on”,  
“hw\_tc\_offload”: “off [fixed]”,  
“l2\_fwd\_offload”: “off [fixed]”,  
“large\_receive\_offload”: “on”,  
“loopback”: “off [fixed]”,  
“netns\_local”: “off [fixed]”,  
“ntuple\_filters”: “off [fixed]”,  
“receive\_hashing”: “on”,  
“rx\_all”: “off [fixed]”,  
“rx\_checksumming”: “on”,  
“rx\_fcs”: “off [fixed]”,  
“rx\_gro\_hw”: “off [fixed]”,  
“rx\_udp\_tunnel\_port\_offload”: “off [fixed]”,  
“rx\_vlan\_filter”: “on [fixed]”,  
“rx\_vlan\_offload”: “on”,  
“rx\_vlan\_stag\_filter”: “off [fixed]”,  
“rx\_vlan\_stag\_hw\_parse”: “off [fixed]”,  
“scatter\_gather”: “on”,  
“tcp\_segmentation\_offload”: “on”,  
“tx\_checksum\_fcoe\_crc”: “off [fixed]”,  
“tx\_checksum\_ip\_generic”: “on”,  
“tx\_checksum\_ipv4”: “off [fixed]”,  
“tx\_checksum\_ipv6”: “off [fixed]”,  
“tx\_checksum\_sctp”: “off [fixed]”,  
“tx\_checksumming”: “on”,  
“tx\_fcoe\_segmentation”: “off [fixed]”,  
“tx\_gre\_csum\_segmentation”: “off [fixed]”,  
“tx\_gre\_segmentation”: “off [fixed]”,  
“tx\_gso\_partial”: “off [fixed]”,  
“tx\_gso\_robust”: “off [fixed]”,  
“tx\_ipip\_segmentation”: “off [fixed]”,  
“tx\_lockless”: “off [fixed]”,  
“tx\_nocache\_copy”: “off”,  
“tx\_scatter\_gather”: “on”,  
“tx\_scatter\_gather\_fraglist”: “off [fixed]”,  
“tx\_sctp\_segmentation”: “off [fixed]”,  
“tx\_sit\_segmentation”: “off [fixed]”,  
“tx\_tcp6\_segmentation”: “on”,  
“tx\_tcp\_ecn\_segmentation”: “off [fixed]”,  
“tx\_tcp\_mangleid\_segmentation”: “off”,  
“tx\_tcp\_segmentation”: “on”,  
“tx\_udp\_tnl\_csum\_segmentation”: “off [fixed]”,  
“tx\_udp\_tnl\_segmentation”: “off [fixed]”,  
“tx\_vlan\_offload”: “on”,  
“tx\_vlan\_stag\_hw\_insert”: “off [fixed]”,  
“udp\_fragmentation\_offload”: “off [fixed]”,  
“vlan\_challenged”: “off [fixed]”  
},  
“hw\_timestamp\_filters”: ,  
“ipv4”: {  
“address”: “10.132.196.252”,  
“broadcast”: “10.132.197.255”,  
“netmask”: “255.255.254.0”,  
“network”: “10.132.196.0”  
},  
“macaddress”: “00:50:56:8d:05:97”,  
“module”: “vmxnet3”,  
“mtu”: 1500,  
“pciid”: “0000:13:00.0”,  
“promisc”: false,  
“speed”: 10000,  
“timestamping”: [  
“rx\_software”,  
“software”  
],  
“type”: “ether”  
}  
}

TASK [Update udev rules] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
.  
.  
.  
},  
“item”: “eth0”,  
“msg”: “line added”  
}  
fatal: [10.132.78.192]: FAILED! =\> {  
“msg”: “The task includes an option with an undefined variable. The error was: ‘dict object’ has no attribute ‘macaddress’\n\nThe error appears to have been in ‘/app/awxtmp/bwrap\_2947532\_b592cqna/awx\_2947532\_d0izo5ch/project/replace\_nic\_ethx.yml’: line 23, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Update udev rules\n ^ here\n”  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
10.132.78.192 : ok=3 changed=0 unreachable=0 failed=1

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [September 22, 2023, 6:12pm UTC](https://forum.ansible.com/t/rename-network-interface/835/16 "2023-09-22T18:12:16Z")

</div>

The `eth0` case seems to be the “normal” one. Is my guess is correct that `eth0_1` is a secondary IP defined on the same hardware/macaddress as `eth0`? I set up a secondary IP on my primary internet interface, but I’m on wireless and that device name is `wlp82s0`, so we’re already enough different — my udev rules are probably not like yours at all (what OS are you on, btw?) — that comparisons may get iffy. Unfortunately, that doesn’t give me an `ansible_wlp82s0_1`. It’s only listed as a `"ipv4_secondaries"` sub-dict under `ansible_wlp82s0`. Hmm.

There was another thread the other day, [get-the-name-of-an-interface-for-a-given-ip](http://forum.ansible.com/t/facts-get-the-name-of-an-interface-for-a-given-ip/712/14), where the same problem was dealt with albeit for a different purpose. The solution there was to loop over the `ansible_<interfaces>` data to add the benign defaults for otherwise missing data for the secondary addresses. The whole point was to avoid blowing up on missing data.

It looks like you’ve got 3 options: (1) use a technique similar to that in the linked thread above so you’ve got sufficiently fleshed out dicts for your secondary IPs, (2) skip the `src_interfaces` that don’t have `macaddress` defined (simplest by far, but has implications wrt why you’re renaming these interfaces), and finally (3) reconsider what’s driving the desire to rename these interfaces and attack _that_ as the problem to solve rather than – to be blunt – tossing away the udev work done by your distro for questionable gain. Granted, why you’re trying to do this has not been discussed, it’s your business not mine, etc. But after the tiny bit of reading I’ve done over the last 48 hours on udev rules and device naming, I’d need to hear an extremely compelling argument before I’d go down that road. And maybe you have one. I just wanted to include #3 because, speaking for myself, sometimes I fixate on implementing a solution to a problem that shouldn’t be solved, but rather eliminated further upstream.

I would still like to see what your `ansible_facts['eth0_1']` looks like (assuming that’s the one blowing up on you).

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [September 22, 2023, 6:27pm UTC](https://forum.ansible.com/t/rename-network-interface/835/17 "2023-09-22T18:27:15Z")

</div>

> [@bspigari](#):
>
> Looks like I have some limitation on this forum…

Hey @bspigari, looks like you haven’t completed the **new user tutorial** , so you got a limited access to the forum. Look for a “Greetings!” notice from @discobot on your notifications, that will enable you to have a better user experience. It takes only 5 minutes 😉

---

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 22, 2023, 6:40pm UTC](https://forum.ansible.com/t/rename-network-interface/835/19 "2023-09-22T18:40:50Z")

</div>

Yes its a secondary IP under same eth0 interface.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [September 22, 2023, 7:11pm UTC](https://forum.ansible.com/t/rename-network-interface/835/20 "2023-09-22T19:11:24Z")

</div>

Ah. And what version of ansible? (`ansible --version`) I’m asking because in later versions, everything in `ansible_facts` got a `ansible_` prefix. The code in that other thread I linked to would expect to see `ansible_facts['ansible_{{ interface }}']` for example.

And what OS / distro?

---

<div class="post-metadata">

**Author:** ![bspigari](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bspigari/32/789_2.png) [@bspigari](https://forum.ansible.com/u/bspigari)\
**Post date:** [September 22, 2023, 7:21pm UTC](https://forum.ansible.com/t/rename-network-interface/835/21 "2023-09-22T19:21:19Z")

</div>

So…  
Tower 3.8.5 Ansible version 2.9.25 for QA  
Tower 3.8.5 Ansible version 2.9.27 for PROD  
And OS / distro \> RHEL 7.9

Identity added: /app/awxtmp/bwrap\_2947532\_b592cqna/awx\_2947532\_d0izo5ch/artifacts/2947532/ssh\_key\_data (/app/awxtmp/bwrap\_2947532\_b592cqna/awx\_2947532\_d0izo5ch/artifacts/2947532/ssh\_key\_data)  
ansible-playbook 2.7.0  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/var/lib/awx/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /app/awxvenv/ansible-2.7/lib/python2.7/site-packages/ansible  
executable location = /app/awxvenv/ansible-2.7/bin/ansible-playbook  
python version = 2.7.5 (default, Aug 13 2020, 02:51:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]  
Using /etc/ansible/ansible.cfg as config file

[Next page](https://forum.ansible.com/t/rename-network-interface/835.md?page=2)
