From 4738a4312843ccf7f8a1f216a8f5d41378d65dd1 Mon Sep 17 00:00:00 2001 From: Brian Candler Date: Thu, 30 Jun 2016 11:45:48 +0000 Subject: [PATCH] Fixup lxd_container operations to match new module Create br-wan profile and apply it to gold-master, so it has networking --- ansible/gold-master.yml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/ansible/gold-master.yml b/ansible/gold-master.yml index 90f4aac..65f03a5 100644 --- a/ansible/gold-master.yml +++ b/ansible/gold-master.yml @@ -4,9 +4,31 @@ - hosts: localhost tasks: + - name: create br-wan profile + lxd_container: + name: br-wan + type: profile + state: present + description: Connect eth0 to br-wan + devices: + eth0: + name: eth0 + nictype: bridged + parent: br-wan + type: nic + # NOTE: on first run this fetches the whole image (~650MB) over the Internet - name: create gold-master container - lxd_container: name=gold-master image=ubuntu:16.04 state=started + lxd_container: + name: gold-master + state: started + source: + type: image + mode: pull + server: https://images.linuxcontainers.org + protocol: lxd + alias: ubuntu/xenial/amd64 + profiles: ["br-wan"] # Ansible cannot run in a container unless python2 is present. # It can't even gather "facts" about it. So we must force @@ -33,8 +55,7 @@ - zip - unzip -# Now shut it down so we can clone it - - hosts: localhost tasks: - - lxd_container: name=gold-master state=stopped + - name: stop container so it can be cloned + lxd_container: name=gold-master state=stopped -- GitLab