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

Add preparation tasks for LDAP security profile #494

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/494-LDAP-security-profile-task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- sonic_ldap - Add prerequisite task for LDAP security profile (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/494).
10 changes: 6 additions & 4 deletions tests/regression/roles/sonic_ldap/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ module_name: ldap

vrf1: "VrfReg1"
vrf2: "VrfReg2"
secprofile: "default"

preparations_tests:
vrfs:
- name: '{{ vrf1 }}'
- name: '{{ vrf2 }}'
crypto_profile: '{{ secprofile }}'

tests:
- name: test_case_01
Expand Down Expand Up @@ -109,7 +111,7 @@ tests:
retry: 3
scope: one
- name: global
security_profile: "default"
security_profile: '{{ secprofile }}'
map:
map_remote_groups_to_sonic_roles:
- remote_group: "user1"
Expand All @@ -121,7 +123,7 @@ tests:
state: deleted
input:
- name: global
security_profile: "default"
security_profile: '{{ secprofile }}'
vrf: '{{ vrf2 }}'
map:
map_remote_groups_to_sonic_roles:
Expand Down Expand Up @@ -198,7 +200,7 @@ tests:
ssl: 'start_tls'
binddn: "CN=example.com"
source_interface: "{{ interface5 }}"
security_profile: "default"
security_profile: '{{ secprofile }}'
map:
default_attribute:
- from: "attr1"
Expand Down Expand Up @@ -264,7 +266,7 @@ tests:
state: overridden
input:
- name: global
security_profile: "default"
security_profile: '{{ secprofile }}'
servers:
- address: 89.0.142.85
ssl: 'off'
Expand Down
7 changes: 7 additions & 0 deletions tests/regression/roles/sonic_ldap/tasks/cleanup_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@
config: "{{ preparations_tests.vrfs }}"
state: deleted
ignore_errors: yes

- name: Delete crypto security profile
vars:
ansible_connection: network_cli
dellemc.enterprise_sonic.sonic_config:
commands: "no crypto security-profile {{ preparations_tests.crypto_profile }}"
failed_when: false
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@
config: "{{ preparations_tests.vrfs }}"
state: merged
ignore_errors: yes

- name: Create crypto security profile
vars:
ansible_connection: network_cli
dellemc.enterprise_sonic.sonic_config:
commands: "crypto security-profile {{ preparations_tests.crypto_profile }}"
failed_when: false
Loading