In the automox kb the ansible playbook is broken and I wanted to submit my corrections- https://support.automox.com/help/deploying-the-automox-agent-in-bulk:
Deploying with Ansible
You can distribute the Automox agent with Ansible using the Ansible playbook: get-automox.yml. Contact Automox Support for further assistance.
From the directory where the ‘get-automox.yml’ file is located, invoke the playbook with the following command, substituting your unique user key (zone key) as indicated:
ansible-playbook get-automox.yml --extra-vars "zone=YOUR-ZONE-KEY-HERE
In get-automox.yml:
- name: Ensure amagent is enabled and started
service:
name: amagent
state: running <- Causes the playbook to fail.
enabled: yes
state: running is not a valid state.
Changing it to state: started fixes the problem.
Also, the command fails: ansible-playbook get-automox.yml --extra-vars "zone=YOUR-ZONE-KEY-HERE
Changing the command to
ansible-playbook -i hosts get-automox.yml --extra-vars “organization=ZONE_KEY”
The variable zone does not exist, I think it may have been updated but the documentation doesn’t reflect the change. Also the command is missing a trailing double quote.
In get-automox.yml:
vars:
automox_url: https://console.automox.com/downloadInstaller?accesskey={{ organization }} <- variable name is not zone
The organization variable is where the zone variable would be.