---
- name: Reset and Pull Git Repository
hosts: all
tasks:
- name: Change to iac directory
shell: cd ~/iac
args:
chdir: "/home/{{ ansible_user }}"
environment:
HOME: "/home/{{ ansible_user }}"
- name: Git Pull
shell: git pull
chdir: "/home/{{ ansible_user }}/iac"
- name: Git Reset
shell: git reset --hard origin/main