Skip to content

Instantly share code, notes, and snippets.

@gowatana
Created August 25, 2023 14:03
Show Gist options
  • Select an option

  • Save gowatana/7cdabeef0c2463edb5aa002ffa5b07cc to your computer and use it in GitHub Desktop.

Select an option

Save gowatana/7cdabeef0c2463edb5aa002ffa5b07cc to your computer and use it in GitHub Desktop.
---
- name: Create snapshot
hosts: localhost
connection: local
gather_facts: no
collections:
- nutanix.ncp
module_defaults:
group/nutanix.ncp.ntnx:
nutanix_host: "lab-ndb-01.go-lab.jp"
nutanix_username: "admin"
nutanix_password: "nutanix/4u"
validate_certs: false
tasks:
- name: Get the current date
set_fact:
timestamp_string: "{{ lookup('pipe', 'date \"+%Y-%m%d-%H%M%S\"') }}"
- name: Create Snapshot
ntnx_ndb_database_snapshots:
name: "snap-{{ timestamp_string }}"
time_machine_uuid: "db046ea5-d4d1-4ed5-afb7-c57c184cd3f1"
expiry_days: 2
register: result
- name: Get Snapshot UUID
set_fact:
snapshot_uuid: "{{result.snapshot_uuid}}"
- name: Output Snapshot UUID
debug:
var: snapshot_uuid
@gowatana
Copy link
Author

下記の投稿むけ。

Nutanix DevStation から NDB を操作してみる。(Nutanix Meetup Hybrid 23.08)
https://blog.ntnx.jp/entry/2023/08/24/090623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment