-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyInventory
More file actions
49 lines (45 loc) · 2.1 KB
/
Copy pathMyInventory
File metadata and controls
49 lines (45 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#
# Author: Aniruddha Gokhale
# CS4287-5287 Principles of Cloud Computing
# Created: Fall 2018
# Modified: Fall 2020
#
# This is a sample inventory file used for Ansible. You can name your
# inventory file to whatever you want. Make sure that you reference
# the correct inventory file in your .ansible.cfg file.
#
# Here I have defined an alias to refer to my local VM (in which I will run
# the ansible playbook). These aliases will be referenced in the playbooks.
# Every local machine can be accessed using either localhost or 127.0.0.1
# IP address. Moreover, we tell Ansible, that the connection type to the
# local VM is via local connection. Note that how you name the alias
# is up to you. I just called it MyLocalVMs
#
[MyLocalVMs]
localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3
# Below I define an alias for the two VMs on my NAT network on
# my laptop. Note that, I needed to enable ssh connectivity between
# the two VMs which is passwordless. For this I had to make sure that
# ssh server was running on each (sudo apt install ssh). Then, I ran ssh-add
# to install the private key with the ssh-agent. Then, I used ssh-copy-id
# to store the public keys in the authorized keys on both VMs. After
# that I was able to log into each other via passwordless ssh
# Note that I just reused by chameleon private key but you can create
# Below I define my currently allocated VMs in the Chameleon Cloud and
# their floating IP addresses. Naturally, you will need to change the IP
# addresses to whatever are yours. Also, you can change the alias to
# whatever you like to call it. Just make sure to use that alias in your
# playbooks. Here, since we are going to communicate remotely with
# a cloud-based VM, the connection type used by ansible will be ssh,
# and we tell Ansible the location of our ssh private key.
#
[MyChameleonVMs]
# The following will need to be changed by the user (their floating IP on chameleon and the full name and location of the pem file)
# replace VM2
# replace VM3
# If I have VMs on other cloud platforms, I can have more aliases
[MyAWSVMs]
#
#[MyAzureVMs]
#
# and so on.