Debian Codegraph @

test/integration/targets/ansible-galaxy/setup.yml

raw
1 - hosts: localhost
2 vars:
3 ws_dir: '{{ lookup("env", "OUTPUT_DIR") }}/ansible-galaxy-webserver'
4 tasks:
5 - name: install git & OpenSSL
6 package:
7 name: git
8 when: ansible_distribution not in ["MacOSX", "Alpine"]
9 register: git_install
10
11 - name: install OpenSSL
12 package:
13 name: openssl
14 when: ansible_distribution not in ["MacOSX", "Alpine"]
15 register: openssl_install
16
17 - name: install OpenSSL
18 command: apk add openssl
19 when: ansible_distribution == "Alpine"
20 register: openssl_install
21
22 - name: setup webserver dir
23 file:
24 state: directory
25 path: "{{ ws_dir }}"
26
27 - name: copy webserver
28 copy:
29 src: testserver.py
30 dest: "{{ ws_dir }}"
31
32 - name: Create rand file
33 command: dd if=/dev/urandom of="{{ ws_dir }}/.rnd" bs=256 count=1
34
35 - name: Create self-signed cert
36 shell: RANDFILE={{ ws_dir }}/.rnd openssl req -x509 -newkey rsa:2048 \
37 -nodes -days 365 -keyout "{{ ws_dir }}/key.pem" -out "{{ ws_dir }}/cert.pem" \
38 -subj "/C=GB/O=Red Hat/OU=Ansible/CN=ansible-test-cert"
39
40 - name: start SimpleHTTPServer
41 shell: cd {{ ws_dir }} && {{ ansible_python.executable }} {{ ws_dir }}/testserver.py
42 async: 120 # this test set can take ~1m to run on FreeBSD (via Shippable)
43 poll: 0
44
45 - wait_for:
46 path: '{{ ws_dir }}/testserver.json'
47 timeout: 10
48
49 - wait_for:
50 port: 4443
51 timeout: 10
52
53 - name: save results
54 copy:
55 content: "{{ item.content }}"
56 dest: '{{ lookup("env", "OUTPUT_DIR") }}/{{ item.key }}.json'
57 loop:
58 - key: git_install
59 content: "{{ git_install }}"
60 - key: openssl_install
61 content: "{{ openssl_install }}"
62 - key: ws_dir
63 content: "{{ ws_dir | to_json }}"