This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Get Avi API Version | |
hosts: localhost | |
connection: local | |
gather_facts: false | |
vars_files: | |
- ./login.yml | |
tasks: | |
- name: Get Avi API Version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Ansible x Nutnaix Test | |
hosts: localhost | |
connection: local | |
gather_facts: no | |
vars: | |
prism_address: "Prism IP Address or FQDN" | |
prism_username: "admin" | |
prism_password: "nutanix/4u" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
disable_root: true | |
ssh_pwauth: true | |
package_upgrade: false | |
users: | |
- name: nutanix | |
lock-passwd: false | |
sudo: ALL=(ALL) NOPASSWD:ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ESX = "192.168.10.164" # または esxi01.example.com | |
$VDS = "VDS_A" | |
$VMNIC1 = "vmnic1" | |
$VMNIC2 = "vmnic2" | |
$UPLINK1 = "UpLink_1" | |
$UPLINK2 = "UpLink_2" | |
$UPLINK_PG = "UpLinkPG_A" | |
$PG = "PG_A" | |
# ①VDS_Aへ新規ホストを追加 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: configmap-lab-centos-vm-01 | |
namespace: lab-ns-31 | |
data: | |
hostname: lab-centos-vm-01 | |
user-data: | | |
I2Nsb3VkLWNvbmZpZwp1c2VyczoKICAtIG5hbWU6IGRlbW8KICAgIHNoZWxsOiAvYmluL2Jhc2gK | |
ICAgIHN1ZG86IEFMTD0oQUxMKSBOT1BBU1NXRDpBTEwKY2hwYXNzd2Q6CiAgICBsaXN0OiB8CiAg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: VirtualMachineService | |
apiVersion: vmoperator.vmware.com/v1alpha1 | |
metadata: | |
name: svc-lab-centos-vm-01 | |
namespace: lab-ns-31 | |
spec: | |
type: LoadBalancer | |
ports: | |
- name: ssh | |
port: 22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: VirtualMachine | |
apiVersion: vmoperator.vmware.com/v1alpha1 | |
metadata: | |
name: lab-centos-vm-01 | |
namespace: lab-ns-31 | |
labels: | |
demo: vm-service-01 | |
spec: | |
imageName: centos-stream-8-vmservice-v1alpha1-1619529007339 | |
className: best-effort-xsmall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: configmap-lab-centos-vm-01 | |
namespace: lab-ns-31 | |
data: | |
hostname: lab-centos-vm-01 | |
user-data: | | |
I2Nsb3VkLWNvbmZpZwp1c2VyczoKICAtIG5hbWU6IGRlbW8KICAgIHNoZWxsOiAvYmluL2Jhc2gK | |
ICAgIHN1ZG86IEFMTD0oQUxMKSBOT1BBU1NXRDpBTEwKY2hwYXNzd2Q6CiAgICBsaXN0OiB8CiAg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
users: | |
- name: demo | |
shell: /bin/bash | |
sudo: ALL=(ALL) NOPASSWD:ALL | |
chpasswd: | |
list: | | |
demo:VMware1! | |
expire: false | |
ssh_pwauth: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vm_name = $args[0] | |
Get-VM $vm_name | %{ | |
$vm = $_ | |
$vm | Get-HardDisk | %{ | |
$vmdk = $_ | |
$vmdk_table = @() | |
$vmdk_table += $vmdk.ExtensionData.Backing | |
$parent = $vmdk.ExtensionData.Backing.Parent | |