This repository has been archived on 2025-03-03. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
iac/ansible/playbooks/git-pull-reset.yml

24 lines
No EOL
580 B
YAML

---
- 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
args:
chdir: "/home/{{ ansible_user }}/iac"
environment:
HOME: "/home/{{ ansible_user }}"
- name: Git Reset
shell: git reset --hard origin/main
args:
chdir: "/home/{{ ansible_user }}/iac"
environment:
HOME: "/home/{{ ansible_user }}"