summaryrefslogtreecommitdiff
path: root/roles/lxc-docker-alpine/main.yml
blob: f0b646d648611d7e387c3a73d7e996b573bee7e8 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
# Target: alpine3.10
# Host: debian, arch
- name: Install Docker on Alpine LXC Container
  hosts: docker_alpine_lxc

  tasks:

  - name: Installing Docker
    apk:
      state: present
      update_cache: yes
      name:
        - docker
        - docker-py

  - name: Ensuring Docker has been started
    service:
      name: docker
      state: started
      enabled: yes

  - name: Copying cgroups mount script to local.d
    copy:
      src: 1-cgroup-docker.start
      dest: /etc/local.d/1-cgroup-docker.start
      mode: '0700'

  - name: Ensuring local service has been started
    service:
      name: local
      state: started
      enabled: yes

  - name: Running hello world test
    shell: docker run hello-world && touch /tmp/.docker-success
    register: output
    args:
      creates: /tmp/.docker-success
  - debug: var=output