File: _container_create.yml

package info (click to toggle)
python-mitogen 0.3.36-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,708 kB
  • sloc: python: 24,457; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (32 lines) | stat: -rw-r--r-- 946 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
- name: Start containers
  hosts: all
  strategy: mitogen_free
  gather_facts: false
  tasks:
    - name: Start containers
      docker_container:
        name: "{{ inventory_hostname }}"
        image: "{{ docker_base }}"
        command: /bin/bash
        hostname: "mitogen-{{ inventory_hostname }}"
        etc_hosts:
          centos-vault-proxy: host-gateway
        detach: true
        interactive: true
        tty: true
      delegate_to: localhost

    - name: Wait for containers
      # Can't use wait_for_connection yet, not all base images have a python
      command: >-
        docker inspect
        --format "{% raw %}{{.State.Running}}{% endraw %}"
        "{{ inventory_hostname }}"
      register: container_inspect_result
      retries: 5
      delay: 10
      until:
        - container_inspect_result is succeeded
        - container_inspect_result.stdout == "true"
      changed_when: false
      delegate_to: localhost