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

ansible_distribution_major_version should be treated as a string and not as an integer #165

Closed
xpillons opened this issue Feb 23, 2022 · 0 comments · Fixed by #168
Closed
Assignees
Labels
bug Something isn't working

Comments

@xpillons
Copy link

Describe the Issue
pre_remediation_audit.yml is being skipped because ansible_distribution_major_version is tested as an integer and not as a string

Expected Behavior
Install git if not pesent

Actual Behavior
block "If using git for content set up" is skipped

Control(s) Affected
Audit failed to installed

Environment (please complete the following information):

  • Ansible Version: 2.9.6

Possible Solution
Compare to '8' and '7' instead of 8 and 7

- name: If using git for content set up
  block:
  - name: Install git (rh8 python3)
    package:
        name: git
        state: present
    when: ansible_distribution_major_version == '8'

  - name: Install git (rh7 python2)
    package:
        name: git
        state: present
    vars:
        ansible_python_interpreter: "{{ python2_bin }}"
    when: ansible_distribution_major_version == '7'

@xpillons xpillons added the bug Something isn't working label Feb 23, 2022
georgenalen added a commit that referenced this issue Feb 23, 2022
Signed-off-by: George Nalen <georgen@mindpointgroup.com>
@georgenalen georgenalen self-assigned this Feb 23, 2022
@georgenalen georgenalen linked a pull request Feb 23, 2022 that will close this issue
@georgenalen georgenalen linked a pull request Feb 24, 2022 that will close this issue
georgenalen added a commit that referenced this issue Mar 2, 2022
* Add issue #164 fix

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* issue #165 fix

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* updated git install os compare

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* removed rhel7 git install

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* Adjusted pull_request_target to pull_request

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* put rhel7 git install ref back with corrected version ref, added pull_request_target ref in to use branch from pr, and added 1.4.2 to skip for testing

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* updated readme for discord and pipeline testing area

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* Updated tasks/main.yml tags and other spacing

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* added final missing run_audit

Signed-off-by: George Nalen <georgen@mindpointgroup.com>
georgenalen added a commit that referenced this issue Apr 11, 2022
* Add issue #164 fix

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* issue #165 fix

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* updated git install os compare

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* removed rhel7 git install

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* Adjusted pull_request_target to pull_request

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* put rhel7 git install ref back with corrected version ref, added pull_request_target ref in to use branch from pr, and added 1.4.2 to skip for testing

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* updated readme for discord and pipeline testing area

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* Updated tasks/main.yml tags and other spacing

Signed-off-by: George Nalen <georgen@mindpointgroup.com>

* added final missing run_audit

Signed-off-by: George Nalen <georgen@mindpointgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants