# Ansible shows status as changed even though the LXC has been created

**URL:** <https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726>\
**Category:** Get Help\
**Tags:** proxmox\
**Created:** [April 22, 2026, 9:45am UTC](https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726 "2026-04-22T09:45:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parameter4509](https://avatars.discourse-cdn.com/v4/letter/p/b38774/32.png) [@Parameter4509](https://forum.ansible.com/u/Parameter4509)\
**Post date:** [April 22, 2026, 9:45am UTC](https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726/1 "2026-04-22T09:45:27Z")

</div>

- When I run my playbook on my Proxmox instance to create an LXC, it successfully creates the LXC and shows status as `ok=2 changed=1`

- However, when I run the playbook again, even though nothing inside the LXC changes, the play shows status as `ok=2 changed=1`

- The proxmox tasks, show no rerun either, however, I believe the play should not display `changed=1` in Play Recap either.

- Is this the expected behaviour? I am new to Ansible so please guide me in case my understanding is wrong.

- Version(s) of the relevant software tools, libraries, collections etc  
– ansible `[core 2.20.5]`  
– proxmoxer `[2.2.0]`  
– community.proxmox `[1.6.0]`

- Logs from running the play with `-vvv` flag

```js
changed: [192.168.1.50] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "api_host": "192.168.1.50",
            "api_password": null,
            "api_port": null,
            "api_timeout": 5,
            "api_token_id": "ansible",
            "api_token_secret": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "api_user": "root@pam",
            "ca_path": null,
            "clone": null,
            "clone_type": "opportunistic",
            "cores": 4,
            "cpus": null,
            "cpuunits": null,
            "delete": null,
            "description": "Copyparty LXC",
            "disk": null,
            "disk_volume": {
                "host_path": null,
                "options": null,
                "size": 200,
                "storage": "local-lvm",
                "volume": null
            },
            "features": [
                "nesting=1"
            ],
            "force": false,
            "hookscript": null,
            "hostname": "copyparty-ct",
            "ip_address": null,
            "memory": 4096,
            "mount_volumes": null,
            "mounts": null,
            "nameserver": null,
            "netif": {
                "net0": "name=eth0,bridge=vmbr0,firewall=1,ip=dhcp,ip6=dhcp,type=veth"
            },
            "node": "msi",
            "onboot": true,
            "ostemplate": "local:vztmpl/alpine-3.23-default_20260116_amd64.tar.xz",
            "ostype": "alpine",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "pool": null,
            "purge": false,
            "searchdomain": null,
            "startup": null,
            "state": "present",
            "storage": "local",
            "swap": 512,
            "tags": [
                "copyparty",
                "alpine"
            ],
            "timeout": 30,
            "timezone": "host",
            "unprivileged": true,
            "update": true,
            "validate_certs": false,
            "vmid": 408
        }
    },
    "msg": "VM copyparty-ct (408) has been updated.",
    "vmid": 408
}
```

---

<div class="post-metadata">

**Author:** ![BoerBart](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/boerbart/32/10083_2.png) [@BoerBart](https://forum.ansible.com/u/BoerBart)\
**Post date:** [April 22, 2026, 10:15am UTC](https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726/2 "2026-04-22T10:15:24Z")

</div>

Hi there, first of all, welcome to the forum.

To get a better understanding of what exactly is happening, we’d need to see the actual task(s) within the playbook that happen, but I’ll try to explain what could possibly be the reason.

Depending on how the task is performed, it might be that the task will always be performed, no matter whether it’s necessary. Let’s say i have a task that writes “1” into “file.conf”, that task will always be performed, and thus will show up as changed.  
Same goes for changing the owner:group of a file, even if the value is already correct, it will always show up as changed. Some modules are rather simple, and just perform what you ask it to do, even when the values are already set.

I’m sure there’s others on this forum that can give you a way more descriptive explanation, but above should answer your question, whether it might be partially.

---

<div class="post-metadata">

**Author:** ![Parameter4509](https://avatars.discourse-cdn.com/v4/letter/p/b38774/32.png) [@Parameter4509](https://forum.ansible.com/u/Parameter4509)\
**Post date:** [April 22, 2026, 10:29am UTC](https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726/3 "2026-04-22T10:29:24Z")

</div>

That seems like a plausible explanation, anyways here is the task in question

```yml
---
- hosts: all
  tasks:
    - name: Create a new container for copyparty.
      community.proxmox.proxmox:
        api_host: "192.168.1.50"
        api_token_id: API_TOKEN_ID
        api_token_secret: API_TOKEN_SECRET
        api_user: API_USER
        cores: 4
        description: Copyparty LXC
        disk_volume:
          storage: 'local-lvm'
          size: 200
        features:
          - nesting=1
        hostname: copyparty-ct
        memory: 4096
        netif:
          net0: "name=eth0,bridge=vmbr0,firewall=1,ip=dhcp,ip6=dhcp,type=veth"
        node: NODE_NAME
        onboot: true
        ostemplate: 'local:vztmpl/alpine-3.23-default_20260116_amd64.tar.xz'
        ostype: 'alpine'
        password: 'PASSWORD'
        pubkey: 'ssh-ed25519 PUBKEY'
        state: present
        swap: 512
        tags: ['copyparty', 'alpine']
        timezone: host
        vmid: 408

```

---

<div class="post-metadata">

**Author:** ![BoerBart](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/boerbart/32/10083_2.png) [@BoerBart](https://forum.ansible.com/u/BoerBart)\
**Post date:** [April 22, 2026, 10:58am UTC](https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726/4 "2026-04-22T10:58:30Z")

</div>

Thanks for sharing the task. I don’t have personal experience with the proxmox module, but my assumption remains the same as shared earlier.The API call/ Ansible task writes a few values, and probably sees them as changed, even though they remain the same.

---

<div class="post-metadata">

**Author:** ![IamLunchbox](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamlunchbox/32/10232_2.png) [@IamLunchbox](https://forum.ansible.com/u/IamLunchbox)\
**Post date:** [April 22, 2026, 12:24pm UTC](https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726/5 "2026-04-22T12:24:50Z")

</div>

That is a major drawback of proxmox\_kvm and proxmox - they have historically grown and are not fully idempotent. So until someone does the heavy lifting and refactors those two modules, they will not be idempotent.

Most likely it is caused by the network interface configuration, since the MAC changes whenever the interface is changed. This probably happenened to your container as well.

---

<div class="post-metadata">

**Author:** ![Parameter4509](https://avatars.discourse-cdn.com/v4/letter/p/b38774/32.png) [@Parameter4509](https://forum.ansible.com/u/Parameter4509)\
**Post date:** [April 22, 2026, 3:17pm UTC](https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726/6 "2026-04-22T15:17:50Z")

</div>

Ah yes the MAC address is dynamic. Let me try fixing it and see how it works. If it does not work out then that’s what I will make do with.

---

<div class="post-metadata">

**Author:** ![IamLunchbox](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iamlunchbox/32/10232_2.png) [@IamLunchbox](https://forum.ansible.com/u/IamLunchbox)\
**Post date:** [April 22, 2026, 4:28pm UTC](https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726/7 "2026-04-22T16:28:08Z")

</div>

You may use the dedicated nic module to set the mac address, this will make it idempotent. 🙂

---

<div class="post-metadata">

**Author:** ![Parameter4509](https://avatars.discourse-cdn.com/v4/letter/p/b38774/32.png) [@Parameter4509](https://forum.ansible.com/u/Parameter4509)\
**Post date:** [April 23, 2026, 3:11am UTC](https://forum.ansible.com/t/ansible-shows-status-as-changed-even-though-the-lxc-has-been-created/45726/8 "2026-04-23T03:11:05Z")

</div>

Unfortunately fixing mac address inside the play in question didn’t work.

I tried using the nic module too, however, it fails with the following message, maybe because it is meant to be used with VMs only

`"msg": "Getting information for VM with vmid = 408 failed with exception: 500 Internal Server Error: Configuration file 'nodes/msi/qemu-server/408.conf' does not exist"`
