-
Notifications
You must be signed in to change notification settings - Fork 0
VM Ansible
cypx edited this page Nov 17, 2014
·
3 revisions
IPv4: 5.196.203.189
Virtual MAC: 02:00:00:a0:6c:e0
OS: Ubuntu 14.04
Installed from VM-template
Configure network interface
$ vi /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 5.196.203.189
netmask 255.255.255.255
broadcast 5.196.203.189
post-up route add 37.59.46.254 dev eth0
post-up route add default gw 37.59.46.254
pre-down route del 37.59.46.254 dev eth0
pre-down route del default gw 37.59.46.254
dns-nameservers 8.8.8.8 8.8.4.4
Change hostname
$ echo "ansible" | sudo tee /etc/hostname
$ vi /etc/hosts
127.0.0.1 localhost
127.0.1.1 ansible
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Install Ansible
$ sudo apt-get install python-pip python-dev
$ sudo easy_install markupsafe
$ sudo pip install ansible
$ sudo mkdir -p /etc/ansible/playbooks
$ sudo adduser ansible
$ sudo adduser ansible sudo
$ sudo su - ansible -c ssh-keygen
$ sudo vi /home/ansible/.bashrc
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
Managed via PVE interface:
- Global configuration:
- Input policy: Drop
- Output policy: Accept
- Proxmox server specific configuration
- Input Accept SSH macro