Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Mondoo Ansible Role

This role installs the Mondoo agent on Linux servers.

It does:

  • Installs the signed mondoo package
  • Registers the agent with Mondoo Cloud
  • Configures the agent for collector mode
  • Enables the systemd service

It supports:

  • RedHat & CentOS
  • Ubuntu
  • Amazon Linux
  • Debian
  • Suse & openSUSE


  • Ansible > 2.5

Role Variables

Name Default Value Description
mondoo_registration_token changeme Mondoo Registration Token that is used to retrieve agent credentials


This role has no role dependencies

Example Playbook

This is an example of how to use the mondoo role with the mondoo_registration_token variable in an ansible playbook:

    - hosts: servers
         - { role: mondoo, mondoo_registration_token: "changeme" }


For testing, this role uses molecule. You can install the dependencies via:

pip install molecule
pip install python-vagrant
pip install 'molecule[vagrant]'

The molecule cli covers the test lifecycle:

# spin up the vms
molecule create
# converge the machines with ansible
molecule converge
# run molecule tests
molecule test
# for degugging, you can login to individual hosts
molecule login --host ubuntu
# destroy the test setup
molecule destroy


Mondoo, Inc


Error 'module' object has no attribute 'HTTPSHandler'

TASK [mondoo : Download Mondoo RPM key] ********************************
    fatal: [suse]: FAILED! => {"changed": false, "module_stderr": "Shared connection to closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/vagrant/.ansible/tmp/ansible-tmp-1562450830.52-85510064926638/\", line 113, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/vagrant/.ansible/tmp/ansible-tmp-1562450830.52-85510064926638/\", line 105, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/vagrant/.ansible/tmp/ansible-tmp-1562450830.52-85510064926638/\", line 48, in invoke_module\r\n    imp.load_module('__main__', mod, module, MOD_DESC)\r\n  File \"/tmp/ansible_get_url_payload_103dVU/\", line 308, in <module>\r\n  File \"/tmp/ansible_get_url_payload_103dVU/\", line 346, in <module>\r\nAttributeError: 'module' object has no attribute 'HTTPSHandler'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
sudo zypper install python python2-urllib3 python3 python3-urllib3
You can’t perform that action at this time.