Centralize the variables describing the configured lxc containers for a host
The idea is to configure in the ansible inventories entries in the form:
corpusops_lxc_containers_mycontainer:
ssh_keys_paths: ssh keys allowed to connect (via filepaths on the ansible master)
ssh_keys: ssh keys allowed to connect (via inline strings)
backing_store: dir
domains: [list of domains to redirect to the host
for 80 & 443 if haproxy is installed]
os_release: xenial
os: ubuntu
lxc_path: /var/lib/lxc
included_config: /usr/share/lxc/config/ubuntu.common.conf
autostart: 0
eth0_ip4: <autogenerated_by_default>
eth0_mac: <autogenerated_by_default>
eth0_bridge: copslxcbr
eth0_gateway: null
eth1_ip4: ...
eth1_mac: ...
eth1_bridge: ...
eth1_gateway: ...
...
eth9_gateway: ...
host_ports:
tcp: {40001: 22}
udp: {40001: 22}
This information will be used later:
- to configure the lxc.conf of the container
- to configure haproxy for http & https proxies
- to configure iptables for network redirections
So to create a container, the workflow is to configure it first, then launch the creation
configure local resolver (resolvconf / resolv.conf)
To see variables for this role, call it directly via
ansible-playbook -l LIMIT -vvv roles/corpusops.roles/lxc_vars/role.yml