Ansible: ESXi config backup

By | 28/12/2022

ESXi hostunuzun config backup dosyasini bu playbook ile istedginiz lokasyona kayit edebilirsiniz.

 

---
- name: Esxi Config Backup
  hosts: '{{ delegate_server }}'
  gather_facts: no
  tasks:
  - name: Save the ESXi configuration locally by authenticating against the vCenter and selecting the ESXi host
    community.vmware.vmware_cfg_backup:
      validate_certs: False
      hostname: "{{ vcenter_hostname }}"
      username: "{{ vcenter_username }}"
      password: "{{ vcenter_password }}"
      esxi_hostname: "{{ esxi_hostname }}"
      state: saved
      dest: /tmp/
    delegate_to: '{{ delegate_server }}'
    register: backupresulth

  - name: Copy Backup File
    ansible.builtin.copy:
      src: "{{ backupresulth.dest_file }}"
      dest: /tmp/ozgur.tar.gz
      backup: yes
      remote_src: yes
    delegate_to: '{{ delegate_server }}'

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir