Ansible playbooks for setup lxc host and containers on Ubuntu 14.04 or CentOS 6 I tested these playbooks in two Vagrant boxes below.
config.vm.box = "hnakamur/ubuntu-14.04-x64"
config.vm.box = "hnakamur/centos6.5-x64"
- Ansible is installed with the Vagrant shell provisioner.
- The lxc host is configured.
- Two lxc containers is created.
Nginx will be installed in the lxc hosts and containers. The nginx in the lxc host proxys to nginx in containers. You can access nginx in containers with urls:
- The lxc host accesses containers using Ansible Connection Plugin for lxc containers instead of ssh.
- IP Addresses of containers are determined by DHCP.