blob: 263cbec3e74fd43ba5cf23ce8b43a9992553eec6 [file] [log] [blame]
---
- hosts: nova-compute-1
remote_user: ubuntu
tasks:
- name: Install software
apt:
name={{ item }}
update_cache=yes
cache_valid_time=3600
become: yes
with_items:
- lxc
# replaces: sudo sed -i 's/lxcbr0/databr/' /etc/lxc/default.conf
- name: set lxc bridge interface to be databr
become: yes
lineinfile:
dest: /etc/lxc/default.conf
regexp: "^lxc.network.link ="
line: "lxc.network.link = databr"
- name: Create testclient
become: yes
shell: lxc-ls | grep testclient || lxc-create -t ubuntu -n testclient
- name: Start testclient
become: yes
shell: lxc-info -n testclient -s | grep RUNNING || lxc-start -n testclient
- name: Set up networking inside the testclient for testing sample CORD subscriber
become: yes
shell: "{{ item }}"
with_items:
- "lxc-attach -n testclient -- bash -c 'ip link show eth0.222 || ip link add link eth0 name eth0.222 type vlan id 222'"
- "lxc-attach -n testclient -- bash -c 'ip link show eth0.222.111 || ip link add link eth0.222 name eth0.222.111 type vlan id 111'"
- "lxc-attach -n testclient -- ifconfig eth0.222 up"
- "lxc-attach -n testclient -- ifconfig eth0.222.111 up"