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

ios_users - Replace old module ios_user #909

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

earendilfr
Copy link
Contributor

@earendilfr earendilfr commented Aug 14, 2023

SUMMARY

Replace the module ios_user with a more standard file coverage. And also take correctly some parts of the commands (by example, the current module doesn't take correctly the privilegepart of the username command

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

ios_users

ADDITIONAL INFORMATION

Module to manage the users and enable on IOS with the following parts:

  • allow to create one enable per level
  • manage user with :
    • the secret (or password)
    • the privilege of the user
    • the description of the user

Here an example of the configuration

- name: Example config
  cisco.ios.ios_users:
    config:
      enable:
        - password:
            type: secret
            hash: 9
            value: "$9$q3zuC3f3vjWnWk$4BwPgPt25AUkm8Gts6aqW.NLK/90zBDnmWtOeMQqoDo"
      users:
        - name: "johndoe"
          command: "old"
          parameters:
            privilege: 15
            password:
              type: secret
              hash: 9
              value: "$9$q3zuC3f3vjWnWk$4BwPgPt25AUkm8Gts6aqW.NLK/90zBDnmWtOeMQqoDo"
        - name: "msmith"
          command: "new"
          parameters:
            password:
              type: secret
              hash: 9
              value: "$9$q3zuC3f3vjWnWk$4BwPgPt25AUkm8Gts6aqW.NLK/89zBDnmWtOeMQqoDo"

And the command generated:

enable secret 9 $9$q3zuC3f3vjWnWk$4BwPgPt25AUkm8Gts6aqW.NLK/90zBDnmWtOeMQqoDo
username johndoe privilege 15 secret 9 $9$q3zuC3f3vjWnWk$4BwPgPt25AUkm8Gts6aqW.NLK/90zBDnmWtOeMQqoDo
user-name msmith
 secret 9 $9$q3zuC3f3vjWnWk$4BwPgPt25AUkm8Gts6aqW.NLK/89zBDnmWtOeMQqoDo

@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.00%. Comparing base (839d3d7) to head (8b3767e).
Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #909      +/-   ##
==========================================
+ Coverage   86.79%   87.00%   +0.20%     
==========================================
  Files         196      204       +8     
  Lines       12253    12373     +120     
==========================================
+ Hits        10635    10765     +130     
+ Misses       1618     1608      -10     

see 30 files with indirect coverage changes

@earendilfr earendilfr force-pushed the update_ios_user_global branch 2 times, most recently from d473625 to 86f5f9b Compare August 14, 2023 12:39
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/ccf76b45e378458ab21b6f6d967be472

✔️ ansible-galaxy-importer SUCCESS in 3m 53s
✔️ build-ansible-collection SUCCESS in 8m 57s
ansible-ee-integration-ios-latest FAILURE in 15m 37s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 16m 23s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 15m 33s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 14m 22s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 13m 46s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 14m 48s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 12m 30s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 12m 23s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 17s

@earendilfr earendilfr force-pushed the update_ios_user_global branch 4 times, most recently from fed452a to baa3daf Compare August 14, 2023 14:07
Replace the module ios_user with a more standard file coverage.
And also take correctly some parts of the commands (by example, the
current module doesn't take correctly the `privilege`part of the
username command
@earendilfr earendilfr marked this pull request as ready for review August 14, 2023 14:30
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/341fe4558cc54adeab318501ae6c61e9

✔️ ansible-galaxy-importer SUCCESS in 4m 40s
✔️ build-ansible-collection SUCCESS in 9m 10s
ansible-ee-integration-ios-latest FAILURE in 15m 21s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 14m 07s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 13m 10s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 15m 00s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 13m 13s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 14m 23s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 13m 44s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 13m 46s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 42s

@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/bdb27f2b374b458286b061505483224d

✔️ ansible-galaxy-importer SUCCESS in 4m 46s
✔️ build-ansible-collection SUCCESS in 8m 40s
ansible-ee-integration-ios-latest FAILURE in 11m 58s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 12m 38s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 12m 51s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 13m 27s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 12m 23s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 14m 06s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 13m 00s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 13m 14s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 13s

@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/b6e1b3161a9044bab4e046b07b549ea6

✔️ ansible-galaxy-importer SUCCESS in 4m 46s
✔️ build-ansible-collection SUCCESS in 9m 07s
ansible-ee-integration-ios-latest FAILURE in 13m 11s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 13m 49s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 13m 36s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 12m 18s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 14m 15s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 13m 07s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 26m 58s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 26m 57s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 24s

@earendilfr

This comment was marked as resolved.

@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/564d6b32413e4f82a26a50d5d2b0b8e6

✔️ ansible-galaxy-importer SUCCESS in 4m 45s
✔️ build-ansible-collection SUCCESS in 8m 45s
ansible-ee-integration-ios-latest FAILURE in 15m 46s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 16m 20s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 15m 41s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 13m 21s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 15m 37s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 16m 41s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 16m 46s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 16m 56s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 24s

@earendilfr earendilfr force-pushed the update_ios_user_global branch 7 times, most recently from 9c5fb26 to dcc8862 Compare August 18, 2023 02:23
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/31da8bee5fad4f34bc055c1e310d1736

✔️ ansible-galaxy-importer SUCCESS in 3m 42s
✔️ build-ansible-collection SUCCESS in 9m 33s
ansible-ee-integration-ios-latest FAILURE in 11m 42s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 12m 36s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 11m 55s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 15m 37s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 16m 02s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 13m 45s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 13m 04s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 15m 53s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 11s

@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/9f1687cab3d443358adbcc76d2a163b8

✔️ ansible-galaxy-importer SUCCESS in 3m 59s
✔️ build-ansible-collection SUCCESS in 8m 37s
ansible-ee-integration-ios-latest FAILURE in 14m 02s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 14m 51s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 11m 48s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 12m 32s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 12m 32s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 13m 51s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 13m 50s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 13m 51s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 12s

@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/0c9750e1f92a4c308c1965e5aa77c754

✔️ ansible-galaxy-importer SUCCESS in 4m 49s
✔️ build-ansible-collection SUCCESS in 8m 51s
ansible-ee-integration-ios-latest FAILURE in 16m 10s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 16m 08s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 16m 17s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 16m 33s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 16m 35s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 16m 36s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 16m 25s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 12m 11s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 25s

@earendilfr
Copy link
Contributor Author

Hey @earendilfr this module is to be named ios_users keeping the older ios_user module ( note: with a deprecation notice ) Regards

@KB-perByte : Ok: I have updated the PR as requested.

So, now, I have some questions:

  • I have choose to indicate an deprecated date for the old module ios_user to the 2024-10-01 (in one year). Did you prefer to choose another target date ?
  • I have some issue in the sanity check with the deprecated info and I don't understand why (only present with python 3.8 or less)...

And I have also a last question regarding the test task ack / ack / ack (pull_request_target):
I think this test is in error because my PR doesn't have a tagadded automatically but how can I force the system to add the right tag to the PR ? Did I need to add a magic word to my PR to allow the tagging system to work?

Thanks a lot.

@earendilfr earendilfr changed the title ios_user_global - Replace old module ios_user ios_users - Replace old module ios_user Sep 1, 2023
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/41264a983e3b4db49fe0432beae74698

✔️ ansible-galaxy-importer SUCCESS in 4m 41s
✔️ build-ansible-collection SUCCESS in 9m 05s
ansible-ee-integration-ios-latest FAILURE in 11m 50s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 21m 01s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 13m 37s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 14m 08s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 19m 39s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 24m 15s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 24m 02s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 18m 26s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 32s

@earendilfr earendilfr temporarily deployed to ack September 19, 2023 07:13 — with GitHub Actions Inactive
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/343c16329de7462bbb4ad489956ee4fa

✔️ ansible-galaxy-importer SUCCESS in 3m 37s
✔️ build-ansible-collection SUCCESS in 8m 52s
ansible-ee-integration-ios-latest FAILURE in 14m 58s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 21m 20s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 20m 46s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 20m 50s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 14m 48s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 17m 20s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 16m 28s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 16m 35s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 13s

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/4838eb4c7e8c4646ac0c5bd91a160a2e

✔️ ansible-galaxy-importer SUCCESS in 4m 54s
✔️ build-ansible-collection SUCCESS in 9m 37s
ansible-ee-integration-ios-latest RETRY_LIMIT in 4m 07s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 20m 05s (non-voting)
ansible-ee-integration-ios-stable-2.11 RETRY_LIMIT in 3m 10s (non-voting)
ansible-ee-integration-ios-stable-2.12 RETRY_LIMIT in 3m 45s (non-voting)
ansible-ee-integration-ios-libssh-latest RETRY_LIMIT in 4m 21s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 20m 04s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 RETRY_LIMIT in 3m 46s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 3m 54s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 27s

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/8ab6f90c76054adbb0d21a0393266ed7

✔️ ansible-galaxy-importer SUCCESS in 4m 54s
✔️ build-ansible-collection SUCCESS in 10m 00s
ansible-ee-integration-ios-latest RETRY_LIMIT in 3m 29s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 15m 34s (non-voting)
ansible-ee-integration-ios-stable-2.11 RETRY_LIMIT in 3m 43s (non-voting)
ansible-ee-integration-ios-stable-2.12 RETRY_LIMIT in 3m 51s (non-voting)
ansible-ee-integration-ios-libssh-latest RETRY_LIMIT in 3m 21s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 23m 43s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 RETRY_LIMIT in 3m 12s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 3m 28s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 32s

@KB-perByte KB-perByte requested review from roverflow and removed request for KB-perByte December 7, 2023 12:45
Copy link

Label error. Requires exactly 1 of: bug, enhancement, major, minor, patch, skip-changelog. Found:

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/1bc9024f2aa040508e72706fd3ff5b3b

✔️ ansible-galaxy-importer SUCCESS in 3m 29s
✔️ build-ansible-collection SUCCESS in 9m 36s
ansible-ee-integration-ios-latest RETRY_LIMIT in 3m 27s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 12m 48s (non-voting)
ansible-ee-integration-ios-stable-2.11 RETRY_LIMIT in 3m 33s (non-voting)
ansible-ee-integration-ios-stable-2.12 RETRY_LIMIT in 2m 55s (non-voting)
ansible-ee-integration-ios-libssh-latest RETRY_LIMIT in 3m 40s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 15m 31s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 RETRY_LIMIT in 3m 10s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 3m 38s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 33s

earendilfr and others added 6 commits March 20, 2024 23:11
Replace the module ios_user with a more standard file coverage.
And also take correctly some parts of the commands (by example, the
current module doesn't take correctly the `privilege`part of the
username command
Currently, on IOS devices, when you enter a `no username` command, the
system request you a question to confirm the suppression.

To handle this part, I have done some change:
- I have "created" the module IosNetworkTemplate, a override class of
  NetworkTemplate that take care the case of commands with a specific
  prompt
- The ios_user_global module use this class for the User_globalTemplate

Second point, this module allow you to create the username by using the
old command line (C(username)) or the new one (C(user-name)).

I have done this part in a super class to allow other template module to
use this possibility.

I don't have done a super class for the assert function in tests module.
If you want, I can try to do it also.
As requested.
I have also added the deprecation notice for ios_user module
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/5d1ffdf3192647b38580d90d4ea95d00

✔️ ansible-galaxy-importer SUCCESS in 4m 29s
✔️ build-ansible-collection SUCCESS in 9m 58s
ansible-ee-integration-ios-latest RETRY_LIMIT in 3m 11s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 12m 19s (non-voting)
ansible-ee-integration-ios-stable-2.11 RETRY_LIMIT in 3m 14s (non-voting)
ansible-ee-integration-ios-stable-2.12 RETRY_LIMIT in 3m 13s (non-voting)
ansible-ee-integration-ios-libssh-latest RETRY_LIMIT in 3m 03s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 12m 13s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 RETRY_LIMIT in 3m 29s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 3m 30s (non-voting)
✔️ ansible-tox-linters SUCCESS in 12m 17s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants