iac/ansible/playbooks/git-pull-reset.yml

24 lines
580 B
YAML
Raw Permalink Normal View History

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