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

Fixed Issue 2435 - bigip_profile_server_ssl fails to create server SSL profile if SSL key is passphrase protected #2444

Merged
merged 4 commits into from
Jan 15, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- bigip_profile_server_ssl - Fixed bug - create server SSL profile if SSL key is passphrase protected
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ class Parameters(AnsibleF5Parameters):
'caFile',
'authenticateName',
'tmOptions',
'passphrase'
]

returnables = [
Expand Down Expand Up @@ -440,6 +441,14 @@ def options(self):
return []
return options

@property
def passphrase(self):
if self._values['passphrase'] is None:
return None
if self._values['passphrase'] in ['', 'none']:
return ''
return self._values['passphrase']


class Changes(Parameters):
def to_return(self):
Expand Down Expand Up @@ -699,6 +708,7 @@ def create_on_device(self):
self.client.provider['server'],
self.client.provider['server_port']
)
params['passphrase'] = self.want.passphrase
resp = self.client.api.post(uri, json=params)
try:
response = resp.json()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ def test_module_parameters(self):
name='foo',
server_name='foo.bar.com',
secure_renegotiation='require',
passphrase="F5site02"
)

p = ModuleParameters(params=args)
assert p.name == 'foo'
assert p.server_name == 'foo.bar.com'
assert p.secure_renegotiation == 'require'
assert p.passphrase == 'F5site02'

def test_api_parameters(self):
args = load_fixture('load_ltm_profile_serverssl_1.json')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: Create a client SSL profile with a cert/key/chain setting
bigip_profile_client_ssl:
state: present
name: PRD.DEVTTY.LOCAL_CLIENTSSL
server_name: prd.devtty.local
cert_key_chain:
- cert: tc.crt
key: tc.key
passphrase: "F5site02"
true_names: true

- name: Create a new server SSL profile with a cert/key/chain setting
bigip_profile_server_ssl:
state: present
name: PRD.DEVTTY.LOCAL_SERVERSSL
server_name: prd.devtty.local
certificate: tc.crt
key: tc.key
passphrase: "F5site02"
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- import_tasks: setup.yaml

- name: Create a base server SSL profile
Expand Down Expand Up @@ -72,11 +71,10 @@
- result is not changed
- result is success


- name: Change OCSP - empty - Idempotent check
bigip_profile_server_ssl:
name: foo
ocsp_profile: ''
ocsp_profile: ""
register: result

- name: Assert Change OCSP - empty - Idempotent check
Expand Down Expand Up @@ -461,7 +459,7 @@
- name: Set server_name - empty - Idempotent check
bigip_profile_server_ssl:
name: "{{ profile_2 }}"
server_name: ''
server_name: ""
register: result

- name: Assert Set server_name - empty - Idempotent check
Expand Down Expand Up @@ -494,3 +492,6 @@

- import_tasks: issue-01609.yaml
tags: issue-01609

- import_tasks: issue-02435.yaml
tags: issue-02435