-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Giancarlo Garcia
authored and
Giancarlo Garcia
committed
Apr 27, 2020
1 parent
9425e79
commit 2c53a38
Showing
3 changed files
with
140 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# ansible-playbook -b --private-key /Users/giancarlo3g/.ssh/id_rsa_multipass --ask-vault-pass vsr_vm.yml | ||
|
||
# ansible-galaxy install mrlesmithjr.netplan for netplan | ||
# ansible-vault create password.yml -> add password in plain text | ||
|
||
--- | ||
- hosts: packet | ||
vars: | ||
tasks: | ||
roles: | ||
- role: mrlesmithjr.netplan | ||
become: yes | ||
netplan_enabled: true | ||
netplan_remove_existing: no | ||
netplan_config_file: /etc/netplan/my_netplan.yaml | ||
netplan_renderer: networkd | ||
netplan_configuration: | ||
network: | ||
version: 2 | ||
bridges: | ||
br-mgmt: | ||
addresses: | ||
- 192.168.1.1/24 | ||
#gateway4: 192.168.1.1 | ||
br-wan: | ||
dhcp4: yes | ||
netplan_apply: True | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# ansible-playbook -b --private-key /Users/giancarlo3g/.ssh/id_rsa_multipass --ask-vault-pass start_vm.yml | ||
|
||
# sudo pip install passlib is required on MacOS for encrypted passwords | ||
# ansible-galaxy install mrlesmithjr.netplan for netplan | ||
# ansible-vault create password.yml -> add password in plain text | ||
|
||
--- | ||
- hosts: packet | ||
|
||
vars: | ||
license_path: "/Users/giancarlo3g/Downloads/VSR-SIM_R20_license.txt" | ||
xml_path: "/Users/giancarlo3g/Desktop/vsr01-sr1.xml" | ||
image_path: "/Users/giancarlo3g/Downloads/vm/sros-i386/sros-vm.qcow2" | ||
|
||
tasks: | ||
|
||
##################### instantiate VMs ######################### | ||
|
||
- name: define vm | ||
become: yes | ||
virt: | ||
command: define | ||
xml: /etc/libvirt/qemu/vsr01-sr1.xml | ||
- name: start vm | ||
become: yes | ||
virt: | ||
name: vsr01-sr1 | ||
state: running | ||
- name: set autostart for VM | ||
become: yes | ||
virt: | ||
name: vsr01-sr1 | ||
autostart: 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