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 }}"