There are several ways that you can use Ansible to install the Lacework agent in your data center. For this example, we will be using the Lacework installation script. You can download the script from the Agent tab in the Lacework UI. Locate the token that you would like to use, click on the [Show Install Options] button and either download the script locally or copy the link.
Copy the below into a text editor and save it as lacework-ansible.ym
- hosts: lw # the hosts on which you want to deploy the agent sudo: yes tasks: - name: copy the agent installation script to remote servers template: src=install.sh dest=~/install.sh - name: run the agent install script shell: bash ~/install.sh args: creates: /var/lib/lacework/config/config.json
Add an lw group to your hosts file, which will include all of the servers on which you would like to install and run the agent.
[lw] server_01.example.com server_02.example.com ....
After you have created the lw group, you are ready to run the playbook:
If you are planning to install the agent on a large number of servers, Lacework recommends starting with an initial lw group size of 2 or 3 in a lab setting and checking agent status in the Lacework UI. If all agents in the trial run are operating as expected, you can expand the deployment.