# Ansible Playbook Succeeds on One GCP VM but has No Effect on Another Identical VM

**URL:** <https://forum.ansible.com/t/ansible-playbook-succeeds-on-one-gcp-vm-but-has-no-effect-on-another-identical-vm/5987>\
**Category:** Get Help\
**Tags:** gcp, playbook, ansible, ubuntu\
**Created:** [May 24, 2024, 6:43pm UTC](https://forum.ansible.com/t/ansible-playbook-succeeds-on-one-gcp-vm-but-has-no-effect-on-another-identical-vm/5987 "2024-05-24T18:43:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wizard](https://avatars.discourse-cdn.com/v4/letter/w/a87d85/32.png) [@Wizard](https://forum.ansible.com/u/Wizard)\
**Post date:** [May 24, 2024, 6:43pm UTC](https://forum.ansible.com/t/ansible-playbook-succeeds-on-one-gcp-vm-but-has-no-effect-on-another-identical-vm/5987/1 "2024-05-24T18:43:11Z")

</div>

Hello all, I am encountering an issue with an Ansible playbook that runs successfully on one GCP Ubuntu VM `us3tab01` but has no effect on another identical VM `us3tab02`. Both VMs are configured similarly, and Ansible can successfully ping both hosts.

**create-file.yaml**

```auto
---
- name: Create a file in the home directory
  hosts: tab_clusters
  become: true 
  become_user: tableau-admin
  gather_facts: true
  tasks:
    - name: Create empty file
      file:
        path: "/home/tableau-admin/test.log"
        state: touch
        mode: '0644'

```

**hosts.ini**

```auto
[tab_clusters]
us3tab01 ansible_host=us3tab01 ansible_ssh_private_key_file=XXXX
us3tab02 ansible_host=us3tab02 ansible_ssh_private_key_file=XXXX

```

- ansible
- ansible-playbook

Steps Taken:

I’ve verified the following:

1. Successful `ansible -m ping` to both VMs
2. Identical playbook code
3. SSH key permissions for the user
4. I’ve tried Increasing Ansible verbosity(-vvv)
5. Manually SSH’ing into `us3tab02` VM as a `tableau-admin` user and can successfully create a file with no issues.

Details:

- Ansible Version: 2.16.7
- OS: Ubuntu 20.04 on both VMs
- SSH Connectivity: Verified, Ansible can ping both VMs successfully.
- User: `tableau-admin` exists on both VMs with identical permissions.
- Disk Space: Adequate on both VMs.
- Filesystem: No errors detected.

Despite these checks, the playbook executes successfully on `us3tab01` and `us3tab02` but does not create the specified files in the `us3tab02` interestingly the file is created successfully in the `us3tab01` VM. The specific verbose output does not show any errors and executed success.

I’ve searched for similar issues on the forum, but haven’t found a solution that works in my case. Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [May 25, 2024, 11:26am UTC](https://forum.ansible.com/t/ansible-playbook-succeeds-on-one-gcp-vm-but-has-no-effect-on-another-identical-vm/5987/2 "2024-05-25T11:26:28Z")

</div>

Hi,

> but has no effect on another identical VM

What do you mean precisely ? Is your tasks marked as ‘changed’ on both hosts when you run your playbook, or is there something else to infer what you say ?

Could you post output for a fresh `ansible-playbook` run (with no existing file at specified destination) ? Also the exact command you’re running.

> Manually SSH’ing into `us3tab02` VM as a `tableau-admin` user and can successfully create a file with no issues.

Dumb question perhaps, but did you try manually create this file on the same defined `path` as your task’s ?

> I’ve tried Increasing Ansible verbosity(-vvv)

Did you see something different between your task on both hosts ?

Is there something else in your playbook you’re not showing in your post ? Other tasks or handlers perhaps ?

Would it be possible “/home/tableau-admin/” mountpoint to be on a shared storage to both VM ?

Also, please note `become_user` is not the same as `ansible_user`; with this playbook as is, you are authenticating on remote hosts as the user you are logged in on your control node (or the one defined in your potential ssh client config), then task would be run on remote hosts with ‘tableau-admin’ user using sudo. Have you manually tried this exact scenario ?

Could it be possible you forgot to pass sudo password to your command, or have not configured sudoers on remote hosts to run this module passwordless ?  
I doubt it if you indeed provisioned and configured both hosts the same way, but better ask !
