Skip to content
Snippets Groups Projects
Commit 80a40df6 authored by ynerant's avatar ynerant Committed by ynerant
Browse files

[proxmox] Automatically synchronize Debian images


Signed-off-by: ynerant's avatarYohann D'ANELLO <ynerant@crans.org>
parent 9f71b1cb
No related branches found
No related tags found
1 merge request!285[proxmox] Automatically synchronize Debian images
---
glob_debian_images:
cron_timer: '39 06 * * *'
rsync_host: "eclat.adm.crans.org"
......@@ -11,6 +11,9 @@ glob_ntp_client:
debian_mirror: http://mirror.cachan-adm.crans.org/debian
proxmox_mirror: http://mirror.cachan-adm.crans.org/proxmox/debian/pve
loc_debian_images:
rsync_host: 'mirror.cachan-adm.crans.org'
loc_postgres:
subnets:
- 172.17.10.0/24
......
#!/usr/bin/env ansible-playbook
---
- hosts: virtu
vars:
debian_images: '{{ glob_debian_images | default({}) | combine(loc_debian_images | default({})) }}'
roles:
- proxmox-apt-sources
- proxmox-debian-images
......@@ -13,6 +13,7 @@
- import_playbook: baie.yml
- import_playbook: utilities.yml
- import_playbook: slapd.yml
- import_playbook: proxmox.yml
- hosts: server,!sssd
vars:
......
---
- name: Auto-sync debian CD images to always have up-to-date Debian images
template:
src: cron.d/debian-images.j2
dest: /etc/cron.d/debian-images
- name: Install rsync
apt:
update_cache: true
name: rsync
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Initial synchronization to download Debian images
shell: "rsync --verbose --dirs --compress --times --update --delete-after --delete-excluded --include 'debian-[0-9]*-amd64-netinst.iso' --exclude '*' rsync://eclat.adm.crans.org/mirror/cdimage-debian/release/current/amd64/iso-cd/ /var/lib/vz/template/iso/"
register: rsync_output
changed_when: '"debian" in rsync_output.stdout'
{{ ansible_header | comment }}
{{ debian_images.cron_timer }} root rsync --info=name1 --dirs --compress --times --update --delete-after --delete-excluded --include 'debian-[0-9]*-amd64-netinst.iso' --exclude '*' rsync://{{ debian_images.rsync_host }}/mirror/cdimage-debian/release/current/amd64/iso-cd/ /var/lib/vz/template/iso/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment