alannix-lw / lacework-agent-ansible-role Goto Github PK
View Code? Open in Web Editor NEWAn Ansible Role to install the Lacework Datacollector Agent
License: MIT License
An Ansible Role to install the Lacework Datacollector Agent
License: MIT License
Hi there,
The step lacework : add the lacework key (apt)
is failing on my server, it is not apparent why this is failing and I do not know enough about apt-key to debug this myself.
FAILED! => {"after": ["EE0CC692", "80AFD0B6", "0C9A5DF9", "C0B21F32", "EFE21092", "991BC93C"], "before": ["EE0CC692", "80AFD0B6", "0C9A5DF9", "C0B21F32", "EFE21092", "991BC93C"], "changed": true, "fp": "18E76630", "id": "18E76630", "key_id": "18E76630", "msg": "apt-key did not return an error, but failed to add the key (check that the id is correct and *not* a subkey)", "short_id": "18E76630"}
It appears to be for this step: https://github.com/alannix-lw/lacework-agent-ansible-role/blob/main/tasks/main.yml#L13
Received the following warning when using the playbook.
[DEPRECATION WARNING]: "include" is deprecated, use include_tasks/import_tasks instead. This feature
will be removed in version 2.16. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
tasks/main.yml uses include
based on the message this should be changed to include_tasks
.
Ansible Version
% ansible-playbook --version
ansible-playbook [core 2.13.7]
config file = /home/nhairs/git/finder/security/ansible/sec-apps/ansible.cfg
configured module search path = ['/home/nhairs/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/nhairs/.local/lib/python3.8/site-packages/ansible
ansible collection location = /home/nhairs/.ansible/collections:/usr/share/ansible/collections:/home/nhairs/git/finder/security/ansible/sec-apps/collections
executable location = /home/nhairs/.local/bin/ansible-playbook
python version = 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]
jinja version = 3.0.3
libyaml = True
Lacework Role Version
- src: alannix_lw.lacework_agent_ansible_role
name: lacework
version: v2.4.0
Hi,
encountering this issue:
TASK [alannix_lw.lacework_agent_ansible_role : generate config.json] ***************************************************************************************************************************************************************fatal: [server_a]: FAILED! => {"changed": false, "msg": "AnsibleError: template error while templating string: no filter named 'tojson'. String: \n{\n "tokens": {\n "AccessToken" : "{{ lacework_accessToken }}"\n }\n {%- if lacework_cmdAllow is defined or lacework_cmdDisallow is defined %},\n "cmdlinefilter" : {\n "allow" : "{{ lacework_cmdAllow | default("") }}",\n "disallow" : "{{ lacework_cmdDisallow | default("") }}"\n }\n {%- endif %}\n {%- if lacework_fimFilePath is defined or lacework_fimFileIgnore is defined %},\n "fim" : {\n {%- if lacework_fimFilePath is defined %}\n "filepath" : {{ lacework_fimFilePath | tojson }}\n {%- endif %}\n {%- if lacework_fimFilePath is defined and lacework_fimFileIgnore is defined %},{%- endif %}\n {%- if lacework_fimFileIgnore is defined %}\n "fileignore" : {{ lacework_fimFileIgnore | tojson }}\n {%- endif %}\n }\n {%- endif %}\n {%- if lacework_autoUpgrade is defined %},\n "AutoUpgrade" : "{{ lacework_autoUpgrade }}"\n {%- endif %}\n {%- if lacework_checkfreq is defined %},\n "checkfreq" : "{{ lacework_checkfreq }}"\n {%- endif %}\n {%- if lacework_cpuLimit is defined %},\n "cpulimit" : "{{ lacework_cpuLimit }}"\n {%- endif %}\n {%- if lacework_dbSize is defined %},\n "DbSize" : "{{ lacework_dbSize }}"\n {%- endif %}\n {%- if lacework_interfaceConnectionSize is defined %},\n "InterfaceConnectionSize" : "{{ lacework_interfaceConnectionSize }}"\n {%- endif %}\n {%- if lacework_memLimit is defined %},\n "memlimit" : "{{ lacework_memLimit }}"\n {%- endif %}\n {%- if lacework_perfMode is defined %},\n "perfmode" : "{{ lacework_perfMode }}"\n {%- endif %}\n {%- if lacework_proxyUrl is defined %},\n "ProxyUrl" : "{{ lacework_proxyUrl }}"\n {%- endif %}\n {%- if lacework_tags is defined %},\n "Tags": {{ lacework_tags |tojson }}\n {%- endif %}\n}\n"}
Please consider replacing "tojson" in templates folder with "to_json" which is included in Ansible.
See ansible/ansible#25381 which provides a few more details to the issue.
I used Ansible version 2.9.23.
I wonder why your role isn't referenced in the Lacework documentation. There is just an incomplete skeleton for Ansible users in the docs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.