Skip to content

Commit

Permalink
fix(roles): add role prefix to scap-open vars.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP authored and poiana committed Nov 22, 2024
1 parent 20ac670 commit 703e911
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion ansible-playbooks/.ansible-lint-ignore

This file was deleted.

14 changes: 7 additions & 7 deletions ansible-playbooks/roles/scap_open/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
rescue:
- name: Disable Modern Bpf support
ansible.builtin.set_fact:
modern_bpf_supported: false
scap_open_modern_bpf_supported: false
when: result.rc == 95

- name: Check Old Bpf Support
block:
- name: Enable old Bpf support
ansible.builtin.set_fact:
bpf_supported: true
when: ansible_kernel is version(bpf_minimum_kver[ansible_architecture],'>=')
scap_open_bpf_supported: true
when: ansible_kernel is version(scap_open_bpf_minimum_kver[ansible_architecture],'>=')

- name: Prepare the build directory
block:
Expand All @@ -50,7 +50,7 @@
-DUSE_BUNDLED_DEPS=ON
-DBUILD_LIBSCAP_MODERN_BPF=OFF
-DBUILD_LIBSCAP_GVISOR=OFF
-DBUILD_BPF={{ bpf_supported }}
-DBUILD_BPF={{ scap_open_bpf_supported }}
-DCREATE_TEST_TARGETS=OFF
..
chdir: "{{ remote_repos_folder }}/repos/{{ repos['libs'].name }}/build"
Expand Down Expand Up @@ -139,7 +139,7 @@
cmd: make bpf -j {{ cpus }}
chdir: "{{ remote_repos_folder }}/repos/{{ repos['libs'].name }}/build"
register: bpf_probe_result
when: bpf_supported
when: scap_open_bpf_supported
changed_when: false
rescue:
- name: Print error message to stdout --- build bpf probe
Expand All @@ -161,7 +161,7 @@
cmd: /tmp/scap-open --num_events 50 --bpf driver/bpf/probe.o
chdir: "{{ remote_repos_folder }}/repos/{{ repos['libs'].name }}/build"
register: result
when: bpf_supported
when: scap_open_bpf_supported
changed_when: false
rescue:
- name: Print error message to stdout --- scap-open + bpf probe
Expand All @@ -183,7 +183,7 @@
cmd: /tmp/scap-open --num_events 50 --modern_bpf
chdir: "{{ remote_repos_folder }}/repos/{{ repos['libs'].name }}/build"
register: result
when: modern_bpf_supported
when: scap_open_modern_bpf_supported
changed_when: false
rescue:
- name: Print error message to stdout --- scap-open + modern probe
Expand Down
6 changes: 3 additions & 3 deletions ansible-playbooks/roles/scap_open/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
modern_bpf_supported: true
bpf_supported: false
bpf_minimum_kver:
scap_open_modern_bpf_supported: true
scap_open_bpf_supported: false
scap_open_bpf_minimum_kver:
aarch64: '4.17'
x86_64: '4.14'

0 comments on commit 703e911

Please sign in to comment.