anthcourtney / ansible-role-cis-amazon-linux

Ansible role to apply CIS Amazon Linux Benchmark v2.0.0
MIT License
154 stars 140 forks source link

Amazon Linux 2 fails with "not suitable" #72

Open twolsten opened 4 years ago

twolsten commented 4 years ago

Leveraging packer to build Amazon Linux 2 ami and get the following error:

amazon-ebs: TASK [anthcourtney.cis-amazon-linux : Preflight - Fail if host is not suitable for this benchmark] ***
amazon-ebs: fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "This benchmark is not suitable for the destination operating system"}

Using latest Amazon Linux 2 AMI (ami-00dc79254d0461090)

nebul4ck commented 4 years ago

I have added a new item (- "2") at vars/main.yml "cis_target_os_versions:" var and it work for me.

twolsten commented 4 years ago

Thanks, I will try this.

gbvanrenswoude commented 4 years ago

Alternatively you can override discovered facts:

- set_fact:
     ansible_distribution_version: "2017.12"

And then execute the rest.