62 lines
1.9 KiB
YAML
62 lines
1.9 KiB
YAML
---
|
|
# tasks file for linux_install-sentinelone
|
|
- name: Check that the sentinelctl exists
|
|
stat:
|
|
path: /opt/sentinelone/bin/sentinelctl
|
|
become: true
|
|
register: sentinelctl_exists
|
|
|
|
- name: copy sentinelone to target
|
|
ansible.builtin.copy:
|
|
src: SentinelAgent-linux-v22-3-1-7-x86-64_linux_v22_3_1_7.deb
|
|
dest: /tmp/sentinelone_installer.deb
|
|
follow: yes
|
|
when: ansible_distribution_file_variety != "SUSE"
|
|
|
|
|
|
- name: copy sentinelone to target (SUSE)
|
|
ansible.builtin.copy:
|
|
src: SentinelAgent-v24.1.2.6-linux_x86_64.rpm
|
|
dest: /tmp/sentinelone_installer.rpm
|
|
follow: yes
|
|
when: ansible_distribution_file_variety == "SUSE"
|
|
|
|
- name: Install the Linux Agent on Debian based distro
|
|
command: dpkg -i /tmp/sentinelone_installer.deb
|
|
become: true
|
|
when: sentinelctl_exists.stat.exists == False and ansible_distribution_file_variety != "SUSE"
|
|
|
|
|
|
|
|
- name: Install local sentinelone rpm file
|
|
command: rpm -i /tmp/sentinelone_installer.rpm
|
|
become: true
|
|
when: sentinelctl_exists.stat.exists == False and ansible_distribution_file_variety == "SUSE"
|
|
|
|
- name: Apply the registration token to the agent
|
|
command: /opt/sentinelone/bin/sentinelctl management token set eyJ1cmwiOiAiaHR0cHM6Ly9ldWNlMS0xMDQuc2VudGluZWxvbmUubmV0IiwgInNpdGVfa2V5IjogIjNiOGI1MDlhY2I5OGU5MmYifQ==
|
|
become_user: root
|
|
become_method: sudo
|
|
become: true
|
|
when: sentinelctl_exists.stat.exists == False
|
|
|
|
- name: Start the SentinelOne agent
|
|
command: /opt/sentinelone/bin/sentinelctl control start
|
|
become_user: root
|
|
become_method: sudo
|
|
become: true
|
|
|
|
# - name: Stop microsoft defender service
|
|
# ansible.builtin.systemd:
|
|
# name: mdatp
|
|
# state: stopped
|
|
# enabled: no
|
|
# - name: reload systemctl daemon
|
|
# ansible.builtin.systemd:
|
|
# daemon_reload: yes
|
|
# - name: remove defender client
|
|
# ansible.builtin.apt:
|
|
# name: mdatp
|
|
# state: absent
|
|
# purge: yes
|