Forum Discussion
RiverFish
Altostratus
Jan 07, 2022Ansible bigip - confirm only two local user accounts
Greetings. For security compliance purposes I'm trying to confirm that only two local user accounts exist on each F5 but not having any luck. Below are the two methods I've tried and the error messag...
RiverFish
Altostratus
Jan 11, 2022Well I found one way to do it. Instead of counting the occurrence of a specific string/word in the output, you can just count the length of the output. The length of two local user accounts is 6. So if someone tried to secretly create another user account the length would be greater than 6.
- name: local users
bigip_device_info:
gather_subset:
- users
provider: "{{ providerA }}"
register: user_output
- name: count the length of user_output.users
debug:
msg: "User-ouput.users length is: {{ user_output.users | length }}"
failed_when: user_output.users|length > 2
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects