From 1b3cc5d9bc0cdc248a32f8333a4097deb57b992b Mon Sep 17 00:00:00 2001 From: Rene Date: Sat, 19 Nov 2022 17:58:21 +0100 Subject: [PATCH] added playbook to update all hosts at once --- update.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 update.yml diff --git a/update.yml b/update.yml new file mode 100644 index 0000000..0da78e8 --- /dev/null +++ b/update.yml @@ -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' \ No newline at end of file