diff options
Diffstat (limited to 'roles/common')
-rw-r--r-- | roles/common/tasks/lxc.yml | 24 |
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 |