Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS version checking #3

Open
vds opened this issue Dec 4, 2019 · 4 comments · May be fixed by #4
Open

OS version checking #3

vds opened this issue Dec 4, 2019 · 4 comments · May be fixed by #4

Comments

@vds
Copy link

vds commented Dec 4, 2019

Is the following line supposed to stop the playbook if applied to something different than Debian stretch?

https://github.com/florianutz/Debian9-CIS/blob/master/tasks/main.yml#L8

I'm running the playbook against Debian 10, Buster, there are a few weird things that I still need to triage, but the playbook gets applied.

I run the task through the debug, that's what I get:

ASK [Debian9-CIS : Check OS version and family] ***********************************************************************
task path: /home/debian/Debian9_CIS/Debian9-CIS/tasks/main.yml:3                                                       
ok: [localhost] => {
    "msg": "ansible_distribution = Debian, ansible_distribution_release = buster"                                      
}

Probably the code should look like:

- name: Check OS version and family
  fail:
      msg: "This role can only be run against Debian stretch. {{ ansible_distribution }} {{ ansible_distribution_release }} is not supported."
  when: (ansible_distribution != "Debian") or
        (ansible_distribution_release != "stretch")
  tags:
      - always
          

@rmbleeker
Copy link

No, this Ansible role is tailored specifically to Debian 9 "Stretch". Sure it may work on Buster, but that needs to be tested thoroughly and also the CIS-CAT requirements for Buster may have changed. I suggest forking this repo and then tailoring the fork to Debian 10 "Buster".

@vds
Copy link
Author

vds commented Dec 11, 2019

@rmbleeker, thanks for your reply. I tried to apply to playbook to Debian 10 Buster, I was expecting it to fail, but the playbook was actually applied.
What I'm saying is that the current check does not seem to work.
With the changes I proposed, when I try to apply the playbook to Debian 10 Buster, it fails and return a message.

@rmbleeker
Copy link

I see what you mean now, also the message still speaks of Ubuntu while the checks are for Debian. So I agree with your changes, you should probably make a pull request.

@vds
Copy link
Author

vds commented Dec 11, 2019

Will do ASAP, thanks.

@vds vds linked a pull request Dec 12, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants