From e02d66c6e4b3a6245295cea434d360609821c48a Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Thu, 27 Oct 2022 10:07:08 +0200 Subject: [PATCH] fix molecule configuration --- molecule/default/README.md | 16 ++++++++++++++++ molecule/default/converge.yml | 18 ++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 molecule/default/README.md diff --git a/molecule/default/README.md b/molecule/default/README.md new file mode 100644 index 0000000..9bfac6e --- /dev/null +++ b/molecule/default/README.md @@ -0,0 +1,16 @@ +# Testing + +In order to test the role you'll need Ansible, Molecule and a supported provider such as Vagrant. + +If you also want to test registration, add the following line to [`converge.yml`](converge.yml): + +```yml +sentinelone_token: "..." +``` + +Copy the SentinelONE installation files (`sentinelone_latest.deb`, `sentinelone_latest.rpm`) into this directory and run `molecule`: + +```shell +$ molecule create +$ molecule converge +``` diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index c66cf08..0b9fc15 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -1,7 +1,17 @@ --- - name: Converge hosts: all - tasks: - - name: Include sentinelone_client - include_role: - name: sentinelone_client + pre_tasks: + - name: Set SentinelONE client installation file (Debian) + ansible.builtin.set_fact: + file_sentinelone: sentinelone_latest.deb + when: ansible_os_family == 'Debian' + + - name: Set SentinelONE client installation file (Red Hat) + ansible.builtin.set_fact: + file_sentinelone: sentinelone_latest.rpm + when: ansible_os_family == 'RedHat' + + roles: + - role: stdevel.sentinelone_client + sentinelone_filename: "{{ file_sentinelone }}"