---
- name: Ensure logfile path with correct ownership
  file:
    path: "{{ logfile }}"
    mode: 0644
    owner: "{{ ansible_user_id }}"
    state: touch
  become: yes

---
- name: Ensure logfile path with correct ownership
  file:
    path: "{{ logfile }}"
    mode: 0644
    owner: "{{ ansible_user_id }}"
    state: touch
    access_time: preserve
    modification_time: preserve
  become: yes

Add access and modification time to logfile touch
Add access and modification time to logfile touch
