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

Redfish: implement obtaining AccountService config #9403

Conversation

paulfertser
Copy link
Contributor

@paulfertser paulfertser commented Dec 26, 2024

SUMMARY

The AccountService endpoint provides plenty of essential configuration which might be needed to e.g. backup settings or to check the right setup.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

Redfish

ADDITIONAL INFORMATION

Example result from querying OpenBMC's bmcweb Redfish server:

    changed: false
    failed: false
    redfish_facts:
        accountservice_config:
            entries:
                '@odata.id': /redfish/v1/AccountService
                '@odata.type': '#AccountService.v1_15_0.AccountService'
                AccountLockoutDuration: 0
                AccountLockoutThreshold: 0
                Accounts:
                    '@odata.id': /redfish/v1/AccountService/Accounts
                ActiveDirectory:
                    Authentication:
                        AuthenticationType: UsernameAndPassword
                        Password: null
                        Username: ''
                    LDAPService:
                        SearchSettings:
                            BaseDistinguishedNames:
                            - ''
                            GroupsAttribute: ''
                            UsernameAttribute: ''
                    RemoteRoleMapping: []
                    ServiceAddresses:
                    - ''
                    ServiceEnabled: false
                Description: Account Service
                HTTPBasicAuth: Enabled
                HTTPBasicAuth@AllowableValues:
                - Enabled
                - Disabled
                Id: AccountService
                LDAP:
                    Authentication:
                        AuthenticationType: UsernameAndPassword
                        Password: null
                        Username: ''
                    Certificates:
                        '@odata.id': /redfish/v1/AccountService/LDAP/Certificates
                    LDAPService:
                        SearchSettings:
                            BaseDistinguishedNames:
                            - ''
                            GroupsAttribute: ''
                            UsernameAttribute: ''
                    RemoteRoleMapping: []
                    ServiceAddresses:
                    - ''
                    ServiceEnabled: false
                MaxPasswordLength: 20
                MinPasswordLength: 8
                MultiFactorAuth:
                    ClientCertificate:
                        CertificateMappingAttribute: CommonName
                        Certificates:
                            '@odata.id': /redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates
                            '@odata.type': '#CertificateCollection.CertificateCollection'
                            Members: []
                            [email protected]: 0
                        Enabled: true
                        RespondToUnauthenticatedClients: true
                Name: Account Service
                Oem:
                    OpenBMC:
                        '@odata.id': /redfish/v1/AccountService#/Oem/OpenBMC
                        '@odata.type': '#OpenBMCAccountService.v1_0_0.AccountService'
                        AuthMethods:
                            BasicAuth: true
                            Cookie: true
                            SessionToken: true
                            TLS: true
                            XToken: true
                Roles:
                    '@odata.id': /redfish/v1/AccountService/Roles
                ServiceEnabled: true
            ret: true

@ansibullbot

This comment was marked as outdated.

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI feature This issue/PR relates to a feature request module module module_utils module_utils needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) labels Dec 26, 2024
@paulfertser paulfertser force-pushed the redfish-add-get-accountservice branch 2 times, most recently from 825c11e to 2a820bb Compare December 26, 2024 09:53
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Dec 26, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-10 Automatically create a backport for the stable-10 branch labels Dec 26, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I've added a first comment below.

Example result from querying OpenBMC's bmcweb Redfish server:

```
    changed: false
    failed: false
    redfish_facts:
        accountservice_config:
            entries:
                '@odata.id': /redfish/v1/AccountService
                '@odata.type': '#AccountService.v1_15_0.AccountService'
                AccountLockoutDuration: 0
                AccountLockoutThreshold: 0
                Accounts:
                    '@odata.id': /redfish/v1/AccountService/Accounts
                ActiveDirectory:
                    Authentication:
                        AuthenticationType: UsernameAndPassword
                        Password: null
                        Username: ''
                    LDAPService:
                        SearchSettings:
                            BaseDistinguishedNames:
                            - ''
                            GroupsAttribute: ''
                            UsernameAttribute: ''
                    RemoteRoleMapping: []
                    ServiceAddresses:
                    - ''
                    ServiceEnabled: false
                Description: Account Service
                HTTPBasicAuth: Enabled
                HTTPBasicAuth@AllowableValues:
                - Enabled
                - Disabled
                Id: AccountService
                LDAP:
                    Authentication:
                        AuthenticationType: UsernameAndPassword
                        Password: null
                        Username: ''
                    Certificates:
                        '@odata.id': /redfish/v1/AccountService/LDAP/Certificates
                    LDAPService:
                        SearchSettings:
                            BaseDistinguishedNames:
                            - ''
                            GroupsAttribute: ''
                            UsernameAttribute: ''
                    RemoteRoleMapping: []
                    ServiceAddresses:
                    - ''
                    ServiceEnabled: false
                MaxPasswordLength: 20
                MinPasswordLength: 8
                MultiFactorAuth:
                    ClientCertificate:
                        CertificateMappingAttribute: CommonName
                        Certificates:
                            '@odata.id': /redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates
                            '@odata.type': '#CertificateCollection.CertificateCollection'
                            Members: []
                            [email protected]: 0
                        Enabled: true
                        RespondToUnauthenticatedClients: true
                Name: Account Service
                Oem:
                    OpenBMC:
                        '@odata.id': /redfish/v1/AccountService#/Oem/OpenBMC
                        '@odata.type': '#OpenBMCAccountService.v1_0_0.AccountService'
                        AuthMethods:
                            BasicAuth: true
                            Cookie: true
                            SessionToken: true
                            TLS: true
                            XToken: true
                Roles:
                    '@odata.id': /redfish/v1/AccountService/Roles
                ServiceEnabled: true
            ret: true
```

Signed-off-by: Paul Fertser <[email protected]>
@paulfertser paulfertser force-pushed the redfish-add-get-accountservice branch from 2a820bb to eb935b5 Compare December 26, 2024 13:07
Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from the ansible perspective

@mraineri
Copy link
Contributor

mraineri commented Jan 2, 2025

Looks good to me! Thanks!

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jan 2, 2025
@felixfontein felixfontein merged commit e853bdf into ansible-collections:main Jan 2, 2025
129 checks passed
Copy link

patchback bot commented Jan 2, 2025

Backport to stable-10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-10/e853bdf6f907872fdd39e8c507061269399942e9/pr-9403

Backported as #9511

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jan 2, 2025
Example result from querying OpenBMC's bmcweb Redfish server:

```
    changed: false
    failed: false
    redfish_facts:
        accountservice_config:
            entries:
                '@odata.id': /redfish/v1/AccountService
                '@odata.type': '#AccountService.v1_15_0.AccountService'
                AccountLockoutDuration: 0
                AccountLockoutThreshold: 0
                Accounts:
                    '@odata.id': /redfish/v1/AccountService/Accounts
                ActiveDirectory:
                    Authentication:
                        AuthenticationType: UsernameAndPassword
                        Password: null
                        Username: ''
                    LDAPService:
                        SearchSettings:
                            BaseDistinguishedNames:
                            - ''
                            GroupsAttribute: ''
                            UsernameAttribute: ''
                    RemoteRoleMapping: []
                    ServiceAddresses:
                    - ''
                    ServiceEnabled: false
                Description: Account Service
                HTTPBasicAuth: Enabled
                HTTPBasicAuth@AllowableValues:
                - Enabled
                - Disabled
                Id: AccountService
                LDAP:
                    Authentication:
                        AuthenticationType: UsernameAndPassword
                        Password: null
                        Username: ''
                    Certificates:
                        '@odata.id': /redfish/v1/AccountService/LDAP/Certificates
                    LDAPService:
                        SearchSettings:
                            BaseDistinguishedNames:
                            - ''
                            GroupsAttribute: ''
                            UsernameAttribute: ''
                    RemoteRoleMapping: []
                    ServiceAddresses:
                    - ''
                    ServiceEnabled: false
                MaxPasswordLength: 20
                MinPasswordLength: 8
                MultiFactorAuth:
                    ClientCertificate:
                        CertificateMappingAttribute: CommonName
                        Certificates:
                            '@odata.id': /redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates
                            '@odata.type': '#CertificateCollection.CertificateCollection'
                            Members: []
                            [email protected]: 0
                        Enabled: true
                        RespondToUnauthenticatedClients: true
                Name: Account Service
                Oem:
                    OpenBMC:
                        '@odata.id': /redfish/v1/AccountService#/Oem/OpenBMC
                        '@odata.type': '#OpenBMCAccountService.v1_0_0.AccountService'
                        AuthMethods:
                            BasicAuth: true
                            Cookie: true
                            SessionToken: true
                            TLS: true
                            XToken: true
                Roles:
                    '@odata.id': /redfish/v1/AccountService/Roles
                ServiceEnabled: true
            ret: true
```

Signed-off-by: Paul Fertser <[email protected]>
(cherry picked from commit e853bdf)
@felixfontein
Copy link
Collaborator

@paulfertser thanks for your contribution!
@russoz @mraineri thanks for reviewing this!

felixfontein pushed a commit that referenced this pull request Jan 2, 2025
…AccountService config (#9511)

Redfish: implement obtaining AccountService config (#9403)

Example result from querying OpenBMC's bmcweb Redfish server:

```
    changed: false
    failed: false
    redfish_facts:
        accountservice_config:
            entries:
                '@odata.id': /redfish/v1/AccountService
                '@odata.type': '#AccountService.v1_15_0.AccountService'
                AccountLockoutDuration: 0
                AccountLockoutThreshold: 0
                Accounts:
                    '@odata.id': /redfish/v1/AccountService/Accounts
                ActiveDirectory:
                    Authentication:
                        AuthenticationType: UsernameAndPassword
                        Password: null
                        Username: ''
                    LDAPService:
                        SearchSettings:
                            BaseDistinguishedNames:
                            - ''
                            GroupsAttribute: ''
                            UsernameAttribute: ''
                    RemoteRoleMapping: []
                    ServiceAddresses:
                    - ''
                    ServiceEnabled: false
                Description: Account Service
                HTTPBasicAuth: Enabled
                HTTPBasicAuth@AllowableValues:
                - Enabled
                - Disabled
                Id: AccountService
                LDAP:
                    Authentication:
                        AuthenticationType: UsernameAndPassword
                        Password: null
                        Username: ''
                    Certificates:
                        '@odata.id': /redfish/v1/AccountService/LDAP/Certificates
                    LDAPService:
                        SearchSettings:
                            BaseDistinguishedNames:
                            - ''
                            GroupsAttribute: ''
                            UsernameAttribute: ''
                    RemoteRoleMapping: []
                    ServiceAddresses:
                    - ''
                    ServiceEnabled: false
                MaxPasswordLength: 20
                MinPasswordLength: 8
                MultiFactorAuth:
                    ClientCertificate:
                        CertificateMappingAttribute: CommonName
                        Certificates:
                            '@odata.id': /redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates
                            '@odata.type': '#CertificateCollection.CertificateCollection'
                            Members: []
                            [email protected]: 0
                        Enabled: true
                        RespondToUnauthenticatedClients: true
                Name: Account Service
                Oem:
                    OpenBMC:
                        '@odata.id': /redfish/v1/AccountService#/Oem/OpenBMC
                        '@odata.type': '#OpenBMCAccountService.v1_0_0.AccountService'
                        AuthMethods:
                            BasicAuth: true
                            Cookie: true
                            SessionToken: true
                            TLS: true
                            XToken: true
                Roles:
                    '@odata.id': /redfish/v1/AccountService/Roles
                ServiceEnabled: true
            ret: true
```

Signed-off-by: Paul Fertser <[email protected]>
(cherry picked from commit e853bdf)

Co-authored-by: Paul Fertser <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-10 Automatically create a backport for the stable-10 branch feature This issue/PR relates to a feature request module_utils module_utils module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants