blob: 1f12555708ecdb72f050e874022a5fb6a4f2743e [file] [log] [blame]
Samuli Silvius9367c592019-03-22 09:33:05 +02001---
Samuli Silvius9367c592019-03-22 09:33:05 +02002- name: "Create resource dir {{ resources_dir }}"
3 file:
4 path: "{{ resources_dir }}/{{ subdir }}"
5 state: directory
6
7- name: Create test files for the dummy packages
8 file:
9 path: "{{ item }}"
10 state: touch
11 loop:
12 - "{{ resources_dir }}/resource1.txt"
13 - "{{ resources_dir }}/resource2.txt"
14 - "{{ resources_dir }}/resource3.txt"
15 - "{{ resources_dir }}/{{ subdir }}/resource4.txt"
16 - "{{ resources_dir }}/auxdata"
17
18- name: Create resources tar archive for testing
19 archive:
20 path:
21 - "{{ resources_dir }}/resource*"
22 - "{{ resources_dir }}/{{ subdir }}/resource*"
23 dest: "{{ resources_dir }}/{{ resources_filename }}"
24 when:
25 - resources_filename is defined
26 - resources_filename is not none
27
28- name: Create aux tar archive for testing
29 archive:
30 path: "{{ resources_dir }}/aux*"
31 dest: "{{ resources_dir }}/{{ aux_resources_filename }}"
32 when:
33 - aux_resources_filename is defined
34 - aux_resources_filename is not none
35
36- block:
37 - name: Install nfs-utils
38 package:
39 name: nfs-utils
40 state: present
41
42 - name: Start services
43 systemd:
44 name: "{{ item }}"
45 state: started
46 loop:
47 - rpcbind
48 - nfs
49
50 - name: Create data dir to host machine for nfs mount. Must match with volume mount in molecule.yml
51 file:
52 path: ~{{ resources_dir }}
53 state: directory
54 delegate_to: localhost
55
56 - name: Add hosts to exports
57 template:
58 src: exports.j2
59 dest: /etc/exports
60 vars:
61 nfs_mount_path: "{{ resources_dir }}"
62
63 - name: Export nfs
64 command: exportfs -ar
65 when:
Samuli Silvius9367c592019-03-22 09:33:05 +020066 - resources_on_nfs