added playbook to update all hosts at once

This commit is contained in:
2022-11-19 17:58:21 +01:00
parent b6882eb594
commit 1b3cc5d9bc

31
update.yml Normal file
View File

@@ -0,0 +1,31 @@
---
- hosts: all
tasks:
- name: "update git url"
become: yes
command:
cmd: "git remote set-url origin ssh://git@gitea.mewissen.site:22422/rene/dotfiles.git"
chdir: "{{ ansible_user_dir }}/dotfiles"
- name: "git default settings"
become: yes
command:
cmd: "git config pull.rebase false"
chdir: "{{ ansible_user_dir }}/dotfiles"
# - name: "git pull"
# become: yes
# command:
# cmd: "git pull"
# chdir: "{{ ansible_user_dir }}/dotfiles"
- name: "add cronjob for ansible"
become: yes
cron:
name: "ansible provision"
user: "{{ ansible_user_id }}"
job: 'ansible-pull --vault-password-file=~/.vaultpass -U "https://gitea.mewissen.site/rene/ansible-pull.git" -d "/opt/ansible-pull" -C master'
state: present
minute: 0
hour: 1
- name: "update ansible-pull once"
become: yes
command:
cmd: 'ansible-pull --vault-password-file=~/.vaultpass -U "https://gitea.mewissen.site/rene/ansible-pull.git" -d "/opt/ansible-pull" -C master'