-
Notifications
You must be signed in to change notification settings - Fork 926
Description
As an Ansible developer, I want Ansible modules to read/update the state when doing vCenter's local SSO Password Policy configuration. The Ansible module can use govc and should read, update, confirm the operation when updates local SSO Password Policy.
So:
Need to extend govc functionality with GetLocalPasswordPolicy and UpdateLocalPasswordPolicy methods in the proper way
Looking into the details (the solution):
The structure does exist in govmomi - https://github.com/vmware/govmomi/blob/master/ssoadmin/types/types.go#L318
The request and response types are also defined:
https://github.com/vmware/govmomi/blob/master/ssoadmin/types/types.go#L1219
https://github.com/vmware/govmomi/blob/master/ssoadmin/types/types.go#L1903
The methods are defined in ssoadmin:
https://github.com/vmware/govmomi/blob/master/ssoadmin/methods/methods.go#L886
https://github.com/vmware/govmomi/blob/master/ssoadmin/methods/methods.go#L1614
And the methods are missing from ssoadmin client - https://github.com/vmware/govmomi/blob/master/ssoadmin/client.go
The work to achieve the new commands is similar to #2946
The difference is that a complete new commands for govc must be created:
sso.lpp.get , sso.lpp.update - to update and set the Local Password Policy
After some coding, right now I have:
abo@vinkel:~/Code/govmomi/govc$ go run . sso.lpp.get
Description: SSS
MinLength: 0
MaxLength: 1
MinAlphabeticCount: 0
MinUppercaseCount: 0
MinLowercaseCount: 0
MinNumericCount: 0
MinSpecialCharCount: 0
MaxIdenticalAdjacentCharacters: 1
ProhibitedPreviousPasswordsCount: 1
PasswordLifetimeDays: 666
abo@vinkel:~/Code/govmomi/govc$ go run . sso.lpp.update -PasswordLifetimeDays 0
abo@vinkel:~/Code/govmomi/govc$ go run . sso.lpp.get | grep PasswordLifetimeDays
PasswordLifetimeDays: 0