-
Notifications
You must be signed in to change notification settings - Fork 63
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
Network devices prelim task failure (devel branch) #73
Comments
The latest Feb changes seem to have introduced this: f706c12 Breaks my automation today but fully understand we all have other work to do as well, just trying to be as helpful as possible folks. Best Regards, |
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
hi @fnschroeder Thank you for the feedback and the added detail. I have written a new branch issue_73 that should resolve the problem. The system we test on has no wireless adapter, so i didnt experience this issue. I am hoping that this branch captures this case? Many thanks again uk-bolly |
Hi @uk-bolly , that worked like a charm, thanks a LOT!! |
When this one is merged into the devel branch, I will switch my code but for now just pointing to your branch covers it. FYI: I did have to add ubtu20cis_set_root_password: false on the vars cause I am using it on building AWS AMIs so we don't care for changing the password as it will be different already every time. Thanks again for all your work! |
I have created the PR that should put this into devel. Sorry about the delay in this! |
…Included FIX PR #81 Signed-off-by: Stephen Williams <stephenw@mindpointgroup.com>
This has been added to devel branch from PR [#83] Please feel free to test it out and get back to us. |
Describe the Issue
When attempting to run the role from the devel branch, I am getting this bit executed:
ansible.builtin.shell: find /sys/class/net/*/wireless | awk -F'/' awk '{print $5}'
failed_when: wireless_interfaces.rc not in [ 0, 2 ]
changed_when: false
register: wireless_interfaces
when:
- ubtu20cis_rule_3_1_2
tags:
- rule_3.1.2
- section3
Then it should have registered a value in wireless_interfaces for it to be used with the next task:
ansible.builtin.package:
name: network-manager
state: present
when:
- wireless_interfaces.stdout | length > 0
- ubtu20cis_install_network_manager
- ubtu20cis_rule_3_1_2
- not ubtu20cis_system_is_container
tags:
- rule_3.1.2
- section3
But it throws me an error, see details below.
Expected Behavior
The prelim task to not fail when there are not network adapters or perhaps just run this not as prelim but as a regular role task.
Actual Behavior
fatal: [default]: FAILED! => {"msg": "The conditional check 'wireless_interfaces.stdout | length > 0' failed. The error was: error while evaluating conditional (wireless_interfaces.stdout | length > 0): 'dict object' has no attribute 'stdout'
The error appears to be in '/root/.ansible/roles/ubuntu-20-lockdown/tasks/prelim.yml': line 56, column 3, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
Control(s) Affected
Rule 3_1_2
Possible Solution
main branch already doesn't have that added to prelim, perhaps doing it that way would be great.
** My role vars **
- role: ubuntu-20-lockdown
vars:
ubtu20cis_warning_banner: "{{ banner_text }}"
ansible_python_interpreter: /usr/bin/python3
ubtu20cis_grub_pw: "grub.pbkdf2.sha512.10000.{{ ansible_ops_cred }}"
ubtu20cis_set_root_password: false
** Additional Notes**
I would love to use the main branch but that one has the known bug which was fixed on devel:
2023-03-06T15:55:38Z: ubuntu20-ami-build.amazon-ebs.ubuntu_20_ami: TASK [ubuntu-20-lockdown : AUTOMATED | 1.3.2 | PATCH | Ensure filesystem integrity is regularly checked] ***
2023-03-06T15:55:39Z: ubuntu20-ami-build.amazon-ebs.ubuntu_20_ami: fatal: [default]: FAILED! => {"changed": false, "msg": "Will not manage /etc/crontab via cron_file, see documentation."}
The text was updated successfully, but these errors were encountered: