1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  
- name: ensure file exists
    
copy:
      
content: ""
      
dest: /etc/nologin
      
force: no
      
group: sys
      
owner: root
      
mode: 0555
  

https://stackoverflow.com/questions/28347717/how-to-create-an-empty-file-with-ansible