summaryrefslogtreecommitdiffstats
path: root/tests/roles/prepare-env/tasks/main.yml
blob: ff92b8735105a0fa53c852a8753b3984a4271a0a (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- name: install required packages for testings
  package:
    name: "{{ item }}"
    state: latest
  with_items:
    - docker
    - python-docker-py
    - buildah
    - docker-distribution
    - ostree
    - httpd 
    - libselinux-python
    - golang
    - make
    - libseccomp-devel

- name: start docker daemon
  systemd: state=started name=docker

- name: create /ostree/repo
  file: path=/ostree/repo state=directory

- name: ensure docker-distribution service is running
  systemd: state=started name=docker-distribution

- name: create tmp directory for buildah testing
  file: path=/tmp/buildah/bud state=directory

- name: download Dockerfile for hello-world from github
  get_url:
    url: https://raw.githubusercontent.com/docker-library/hello-world/master/amd64/hello-world/Dockerfile
    dest: /tmp/buildah/bud/Dockerfile
    force: yes

- name: download hello for the Dockerfile
  get_url:
    url: https://github.com/docker-library/hello-world/raw/master/amd64/hello-world/hello
    dest: /tmp/buildah/bud/hello
    force: yes
    mode: 0755

- name: create a bud directory in /var/www/html
  file: path=/var/www/html/bud state=directory

- name: archive dockerfile into httpd directory
  command: tar zcvf /var/www/html/bud/Dockerfile.tar.gz Dockerfile hello
  args:
    chdir: /tmp/buildah/bud
    # Disables the following warning:
    # Consider using unarchive module rather than running tar
    warn: no

- name: start httpd service
  systemd: state=started name=httpd