summaryrefslogtreecommitdiff
path: root/roles/common/tasks/lxc.yml
blob: f10f3a296df8d6a5b9b733c10b262a3b2ce125ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
- name: Bootstrapping 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