Skip to content

Commit d30d434

Browse files
test: fixed required dependencies install after ec2 provision (#698)
Co-authored-by: Grigorii Merkushev <brushknight@gmail.com>
1 parent 9a4099f commit d30d434

File tree

5 files changed

+33
-19
lines changed

5 files changed

+33
-19
lines changed

test/automated/ansible/roles/install-gpg/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
state: present
77
update_cache: yes
88
when: inventory_hostname in instances_without_gpg and
9-
(ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu')
9+
(inventory_hostname is search("debian") or inventory_hostname is search("ubuntu"))
1010

1111
...
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
---
22

3-
- name: 'install libcap2'
4-
ansible.builtin.package:
5-
name: libcap
3+
- name: 'install libcap-progs'
4+
community.general.zypper:
5+
name: libcap-progs
66
state: present
7-
when: "inventory_hostname in instances_requiring_libcap"
7+
update_cache: yes
8+
when: inventory_hostname in instances_requiring_libcap_progs and
9+
(inventory_hostname is search("sles"))
810

9-
- name: 'install libcap-progs'
10-
ansible.builtin.package:
11-
name: libcap2
11+
- name: 'install libcap2'
12+
apt:
13+
name:
14+
- libcap2
15+
- libcap2-bin
1216
state: present
13-
when: "inventory_hostname in instances_requiring_libcap2"
17+
update_cache: yes
18+
when: inventory_hostname in instances_requiring_libcap2 and
19+
(inventory_hostname is match("debian-stretch"))
1420

1521
...

test/automated/ansible/roles/install-libcap/vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
instances_requiring_libcap:
1+
instances_requiring_libcap_progs:
22
- "amd64:sles-12.4"
33
instances_requiring_libcap2:
44
- "amd64:debian-stretch"
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
---
22

33
- name: build harvest tests for every os/arch combination
4-
ansible.builtin.shell: "GOOS={{item.0}} GOARCH={{item.1}} make build-harvest-tests && mv {{ default_binary_name }} {{ os_arch_binary_name_tpl | replace('%GOOS%', item.0) | replace('%GOARCH%', item.1) }}"
4+
ansible.builtin.shell: "GOOS=linux GOARCH={{item}} make build-harvest-tests && mv {{ default_binary_name }} {{ os_arch_binary_name_tpl | replace('%GOOS%', 'linux') | replace('%GOARCH%', item) }}"
55
args:
66
chdir: "{{ agent_root_dir }}"
7-
loop: "{{ goos|product(goarch)|list }}"
7+
loop: "{{ goos_arch.linux }}"
8+
9+
10+
- name: build harvest tests for every os/arch combination
11+
ansible.builtin.shell: "GOOS=darwin GOARCH={{item}} make build-harvest-tests && mv {{ default_binary_name }} {{ os_arch_binary_name_tpl | replace('%GOOS%', 'darwin') | replace('%GOARCH%', item) }}"
12+
args:
13+
chdir: "{{ agent_root_dir }}"
14+
loop: "{{ goos_arch.darwin }}"
15+
816

917
...

test/harvest/ansible/roles/build-harvest-tests/vars/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
agent_root_dir: ""
44
default_binary_name: "harvest.test"
55
os_arch_binary_name_tpl: "harvest_%GOOS%_%GOARCH%.test"
6-
goos:
7-
- "linux"
8-
- "darwin"
9-
goarch:
10-
- "amd64"
11-
- "arm"
12-
- "arm64"
6+
goos_arch:
7+
linux:
8+
- "amd64"
9+
- "arm"
10+
- "arm64"
11+
darwin:
12+
- "amd64"
1313

1414
...

0 commit comments

Comments
 (0)