--- # installer checks the package's Apple signature and refuses an unsigned or # altered one, a second check after the checksum. - name: Install the downloaded package ansible.builtin.command: installer -pkg /private/var/tmp/osquery.pkg -target / changed_when: true notify: Restart osqueryd # Before the daemon is first loaded there is nothing to restart, and loading # it later starts it with the new files. - name: Restart osqueryd ansible.builtin.shell: | launchctl print system/io.osquery.agent > /dev/null 2>&1 || exit 0 launchctl kickstart -k system/io.osquery.agent changed_when: true