This repository has been archived on 2024-07-30. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-playbooks/git-pull-reset.yml

24 lines
616 B
YAML
Raw Normal View History

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