# Module user WARNING:Found existing ssh key

**URL:** <https://forum.ansible.com/t/module-user-warning-found-existing-ssh-key/45021>\
**Category:** Get Help\
**Tags:** idempotent\
**Created:** [December 23, 2025, 4:07am UTC](https://forum.ansible.com/t/module-user-warning-found-existing-ssh-key/45021 "2025-12-23T04:07:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![U880D](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/u880d/32/10032_2.png) [@U880D](https://forum.ansible.com/u/U880D)\
**Post date:** [December 23, 2025, 8:58am UTC](https://forum.ansible.com/t/module-user-warning-found-existing-ssh-key/45021/2 "2025-12-23T08:58:05Z")

</div>

Assuming you don’t want to use the parameter [`force: true`](https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/user_module.html#parameter-force), which would generate a `[WARNING]` message anyway

```yaml
TASK [ansible.builtin.user] ***********************************************
[WARNING]: Overwriting existing ssh key private file "/root/.ssh/id_rsa"
[WARNING]: Overwriting existing ssh key public file "/root/.ssh/id_rsa.pub"
changed: [localhost]

```

and you also don’t want to patch the [user.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/user.py#L1238) module itself at

```auto
if os.path.exists(ssh_key_file):
...

```

I think the only option left is to disable in [Ansible Configuration Settings](https://docs.ansible.com/projects/ansible/latest/reference_appendices/config.html) the [`ACTION_WARNINGS`](https://docs.ansible.com/projects/ansible/latest/reference_appendices/config.html#action-warnings)

> By default, Ansible will issue a `WARNING` when received from a task action (module or action plugin). These warnings can be silenced by adjusting this setting to `False`.

by setting in example

```auto
grep 'defaults\|warnings' ansible.cfg
[defaults]
deprecation_warnings = False
action_warnings = False

```

and then resulting into an output of

```yaml
TASK [ansible.builtin.user] ******************
ok: [localhost]

PLAY RECAP ***********************************
localhost : ok=1 changed=0

```

---

_[View the full topic](https://forum.ansible.com/t/module-user-warning-found-existing-ssh-key/45021)._
