summaryrefslogtreecommitdiff
path: root/roles/common/tasks/lxc.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/common/tasks/lxc.yml')
-rw-r--r--roles/common/tasks/lxc.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/roles/common/tasks/lxc.yml b/roles/common/tasks/lxc.yml
new file mode 100644
index 0000000..887aa03
--- /dev/null
+++ b/roles/common/tasks/lxc.yml
@@ -0,0 +1,24 @@
+---
+- name: Bootstrap container
+ hosts: local
+
+ tasks:
+
+ - name: Creating container
+ lxc_container:
+ name: "{{ lxc_base }}"
+ clone_name: "{{ lxc_name }}"
+ backing_store: dir
+ state: stopped
+
+ - name: Starting container
+ lxc_container:
+ name: "{{ lxc_name }}"
+ state: started
+
+ - name: Waiting for container
+ shell: until ping -c1 {{ lxc_name }}.lxc; do :; done
+ changed_when: false
+
+ become: true
+ become_user: root