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
---
- 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
[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:
- Successful
ansible -m ping
to both VMs - Identical playbook code
- SSH key permissions for the user
- I’ve tried Increasing Ansible verbosity(-vvv)
- Manually SSH’ing into
us3tab02
VM as atableau-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!