Skip to content

Commit 6a582c2

Browse files
authored
feat(agent_install): only install required packages [SMAGENT-6558] (#465)
rework the role so to only install the packages required by the selected driver (and therefore, the respective dependencies). Also, remove packages which are no longer required by the selected driver type. Notice we need to craft a list augmented with the selected version, if one is present. Most of the selection logic (namely, based on the version) resides in the 'agent' filter which is probably far from ideal but gets the job done. Side changes to make CI pass on this PR: * DO NOT delete environment file in case of kmod (otherwise agent 13.1.0 will fail) * DO NOT RUN tests on Ubuntu 18.04 (due older systemd not accepting non-absolute path for kill -- otherwise agent 13.1.0 will fail) * execute local forwarder test on EC2 instead of container (due to systemd unit)
1 parent d581653 commit 6a582c2

File tree

14 files changed

+99
-387
lines changed

14 files changed

+99
-387
lines changed

molecule/agent-local-forwarder/Dockerfile.j2

Lines changed: 0 additions & 22 deletions
This file was deleted.

molecule/agent-local-forwarder/converge.yml.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- name: Converge
33
hosts: all
44
strategy: free
5+
become: true
56
roles:
67
- role: sysdig.agent.agent_install
78
vars:

molecule/agent-local-forwarder/create.yml

Lines changed: 0 additions & 202 deletions
This file was deleted.

molecule/agent-local-forwarder/molecule.yml renamed to molecule/agent-local-forwarder/molecule.yml.template

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
dependency:
33
name: galaxy
44
driver:
5-
name: docker
5+
name: ec2
66
platforms:
7-
- name: centos-stream8
8-
image: quay.io/centos/centos:stream8
9-
pre_build_image: true
10-
privileged: true
7+
- name: amazon-2023-x86_64
8+
image: ami-05f216df7591e93b1
9+
instance_type: ${INSTANCE_TYPE_X86}
10+
region: ${REGION}
11+
vpc_subnet_id: ${VPC_SUBNET_ID}
1112
provisioner:
1213
name: ansible
14+
playbooks:
15+
create: ../resources/playbooks/create.yml
16+
destroy: ../resources/playbooks/destroy.yml
17+
prepare: ../resources/playbooks/prepare.yml
1318
scenario:
1419
create_sequence:
1520
- create

molecule/agent-local-forwarder/tasks/create_network.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

molecule/agent-local-forwarder/tasks/delete_network.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
def test_forwarder_emitter(host):
2-
f = host.file("/opt/draios/logs/draios.log")
3-
assert f.contains("local forwarder enabled: true")
2+
with host.sudo():
3+
f = host.file("/opt/draios/logs/draios.log")
4+
assert f.contains("local forwarder enabled: true")

molecule/agent-local-forwarder/validate-dockerfile.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)