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 SetSessionService to redfish_config #5009

Merged
merged 8 commits into from
Sep 25, 2022

Conversation

tejabailey
Copy link
Contributor

adding SetSessionService command to redfish_config
to set BMC default session timeout policy.

Fixes #5008

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

redfish_config

adding SetSessionService command to redfish_config
to set BMC default session timeout policy.

Fixes ansible-collections#5008
@tejabailey
Copy link
Contributor Author

(venv) tj@C02GF4NZMD6R Tests % ANSIBLE_COLLECTIONS_PATH=/Users/tj/ansible ansible-playbook -i s2r8node65.s2r8, SetSessionServiceTests.yml
[WARNING]: Collection community.general does not support Ansible version 2.10.7

PLAY [all] **********************************************************************************************************************************************************************************************************************

TASK [Gather initial BMC lan information] ***************************************************************************************************************************************************************************************
ok: [s2r8node65.s2r8]

TASK [Set BMC IP address as fact] ***********************************************************************************************************************************************************************************************
ok: [s2r8node65.s2r8]

TASK [Set something for SessionService] *****************************************************************************************************************************************************************************************
changed: [s2r8node65.s2r8]

TASK [debug] ********************************************************************************************************************************************************************************************************************
ok: [s2r8node65.s2r8] => {
    "redfish_set_sessionservice": {
        "changed": true,
        "failed": false,
        "msg": "Modified SessionService"
    }
}

PLAY RECAP **********************************************************************************************************************************************************************************************************************
s2r8node65.s2r8            : ok=4    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

(venv) tj@C02GF4NZMD6R Tests % cat SetSessionServiceTests.yml 
---
- hosts: all
  gather_facts: false
  vars:
    bmc_username: root
    bmc_password: hunter2
    default_uri_timeout: 50
    default_uri_retries: 5
  tasks:
  - name: Gather initial BMC lan information
    command: ipmitool lan print
    register: ipmitool_output
    changed_when: ipmitool_output.rc != 0
    become: true

  - name: Set BMC IP address as fact
    set_fact:
      bmc_address: "{{ ipmitool_output.stdout | regex_search('IP Address\\s+:\\s+(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})', '\\1')
                                              | first }}"

  - name: Set something for SessionService
    community.general.redfish_config:
      category: SessionService
      command: SetSessionService
      sessionservice_config:
        SessionTimeout: 800
      baseuri: "{{ bmc_address }}"
      username: "{{ bmc_username }}"
      password: "{{ bmc_password }}"
      timeout: "{{ default_uri_timeout }}"
    retries: "{{ default_uri_retries }}"
    register: redfish_set_sessionservice

  - debug:
      var: redfish_set_sessionservice

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module module_utils module_utils new_contributor Help guide this first time contributor plugins plugin (any type) remote_management labels Jul 26, 2022
@ansibullbot ansibullbot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jul 26, 2022
@github-actions

This comment was marked as outdated.

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 labels Jul 26, 2022
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! Can you take a look at @mraineri's suggestion as well (https://github.com/ansible-collections/community.general/pull/5009/files#r930114637)? Thanks.

@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Aug 7, 2022
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.

Hi @tejabailey thanks for your contribution!

I left a couple of comments.

plugins/module_utils/redfish_utils.py Outdated Show resolved Hide resolved
plugins/module_utils/redfish_utils.py Outdated Show resolved Hide resolved
plugins/module_utils/redfish_utils.py Outdated Show resolved Hide resolved
plugins/module_utils/redfish_utils.py Outdated Show resolved Hide resolved
plugins/module_utils/redfish_utils.py Outdated Show resolved Hide resolved
@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Aug 7, 2022
 - changed category from SessionService to Sessions
 - changed set_sessionservice() to set_session_service()
 - other misc. changes for cleanup
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI and removed stale_ci CI is older than 7 days, rerun before merging labels Aug 23, 2022
@russoz
Copy link
Collaborator

russoz commented Aug 25, 2022

@felixfontein I missed the discussion about this Docs Build feature in the PRs. Why do they get so long? It is quite annoying to work in the PR having to scroll multiple pages in the browser up and down.

@tejabailey
Copy link
Contributor Author

@felixfontein working on it, thank you.

@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI stale_ci CI is older than 7 days, rerun before merging labels Sep 20, 2022
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Sep 20, 2022
@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label Sep 21, 2022
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Sep 21, 2022
@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 Sep 21, 2022
@tejabailey
Copy link
Contributor Author

Hi! I The last pylint error has been corrected. Is this PR ok to merge now?

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.

One last change request, then we can merge (assuming that @mraineri does not have further comments).

@mraineri
Copy link
Contributor

One last change request, then we can merge (assuming that @mraineri does not have further comments).

I do not have anything else; everything looks good to me so far.

@felixfontein
Copy link
Collaborator

(The REUSE fail is because the test was changed to not rebase. That way I don't have to manually approve every run :) At least for this PR it can be safely ignored.)

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Sep 25, 2022
@felixfontein felixfontein merged commit d9d830a into ansible-collections:main Sep 25, 2022
@patchback
Copy link

patchback bot commented Sep 25, 2022

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/d9d830a1680f7dec4601b41200323a9e1534a4bb/pr-5009

Backported as #5311

🤖 @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 Sep 25, 2022
* Add SetSessionService to redfish_config
adding SetSessionService command to redfish_config
to set BMC default session timeout policy.

Fixes #5008

* fix white space issues

* Making Requested changes:
 - changed category from SessionService to Sessions
 - changed set_sessionservice() to set_session_service()
 - other misc. changes for cleanup

* Apply suggestions from code review

Co-authored-by: Alexei Znamensky <[email protected]>

* Fix issues with checks

* Fix issues with checks part 2

* Fix issues with checks part 3

* Update plugins/modules/remote_management/redfish/redfish_config.py

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Alexei Znamensky <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit d9d830a)
@felixfontein
Copy link
Collaborator

@tejabailey thanks for this contribution!
@mraineri @russoz thanks for reviewing!

felixfontein pushed a commit that referenced this pull request Sep 25, 2022
* Add SetSessionService to redfish_config
adding SetSessionService command to redfish_config
to set BMC default session timeout policy.

Fixes #5008

* fix white space issues

* Making Requested changes:
 - changed category from SessionService to Sessions
 - changed set_sessionservice() to set_session_service()
 - other misc. changes for cleanup

* Apply suggestions from code review

Co-authored-by: Alexei Znamensky <[email protected]>

* Fix issues with checks

* Fix issues with checks part 2

* Fix issues with checks part 3

* Update plugins/modules/remote_management/redfish/redfish_config.py

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Alexei Znamensky <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit d9d830a)

Co-authored-by: tejabailey <[email protected]>
@tejabailey tejabailey deleted the SessionTimeout branch September 28, 2022 21:14
v1v added a commit to v1v/community.general that referenced this pull request Oct 7, 2022
* upstream/main: (203 commits)
  Make pfexec become usable for illumos (ansible-collections#3889)
  znode: add options for authentication (ansible-collections#5306)
  keycloak_user_federation: add explanation and example to vendor option (ansible-collections#4893)
  Next expected release is 5.8.0.
  Allow terraform module to specify complex variable structures (ansible-collections#4797)
  Fix ansible-collections#5313: redhat_subscription module is not idempotent when pool_ids (ansible-collections#5319)
  bitwarden: Add field to search for all item attributes, instead of on… (ansible-collections#5297)
  New Module: Keycloak User Rolemapping (ansible-collections#4898)
  chore: Update lxc_container to support py3 (ansible-collections#5304)
  terraform: run `init` with no-color, too (ansible-collections#5147)
  nmcli: fix error when setting previously unset mac address (ansible-collections#5291)
  [feat] proxmox_snap: snapshot containers with configured mountpoints (ansible-collections#5274)
  machinectl: include the success command (ansible-collections#5287)
  Add SetSessionService to redfish_config (ansible-collections#5009)
  locale_gen: fix UbuntuMode (ansible-collections#5282)
  ini_file: fix lint error (ansible-collections#5307)
  netcup_dnsapi: Add timeout paramter (ansible-collections#5301)
  stable-2.14 is now default.
  Add stable-2.14 to CI, adjust to devel version bump (ansible-collections#5298)
  Try to run reuse workflow without explicitly allowing it for new contributors. (ansible-collections#5296)
  ...
bratwurzt pushed a commit to bratwurzt/community.general that referenced this pull request Nov 7, 2022
* Add SetSessionService to redfish_config
adding SetSessionService command to redfish_config
to set BMC default session timeout policy.

Fixes ansible-collections#5008

* fix white space issues

* Making Requested changes:
 - changed category from SessionService to Sessions
 - changed set_sessionservice() to set_session_service()
 - other misc. changes for cleanup

* Apply suggestions from code review

Co-authored-by: Alexei Znamensky <[email protected]>

* Fix issues with checks

* Fix issues with checks part 2

* Fix issues with checks part 3

* Update plugins/modules/remote_management/redfish/redfish_config.py

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Alexei Znamensky <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
bratwurzt pushed a commit to bratwurzt/community.general that referenced this pull request Nov 7, 2022
* Add SetSessionService to redfish_config
adding SetSessionService command to redfish_config
to set BMC default session timeout policy.

Fixes ansible-collections#5008

* fix white space issues

* Making Requested changes:
 - changed category from SessionService to Sessions
 - changed set_sessionservice() to set_session_service()
 - other misc. changes for cleanup

* Apply suggestions from code review

Co-authored-by: Alexei Znamensky <[email protected]>

* Fix issues with checks

* Fix issues with checks part 2

* Fix issues with checks part 3

* Update plugins/modules/remote_management/redfish/redfish_config.py

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Alexei Znamensky <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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) remote_management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add SetSessionService to redfish_config
6 participants