Closed pcfe closed 5 years ago
@pcfe can you try out the dev branch? I made a minor change that may correct this issue, but need to validate for me. Let me know, thanks!
@pcfe I think I know why it tried deletion of 10.0. Previously I was sorting the list of versions on the name field, and switched to the id field now. The id's should theoretically always be incrementing higher. I'm thinking because the rest of the version names were single digit and the v10.0 was double-digit and starting with '1' it most likely sorted it weird. I think the change on the dev branch will take care of the issue.
Also, I didn't hit this in my test lab because all my CVs are now up to double-digits in the version names. Thanks for submitting the issue!
LGTM
@pcfe can you try out the dev branch? sure.
$ cd .ansible/roles/ahuffman.satellite6_manage_content_views
$ git remote -v
origin git@github.com:ahuffman/ansible-satellite6_manage_content_views.git (fetch)
origin git@github.com:ahuffman/ansible-satellite6_manage_content_views.git (push)
$ git checkout dev
$ git pull
commit a2d6fa465993406e72fd5ec89e72b9ff7651db6b (HEAD -> dev, origin/dev)
I made a minor change that may correct this issue, but need to validate for me. Let me know, thanks!
Which commit (range), alternatively just leave a comment which released version fixes this.
[root@satellite ~]# date ; hammer content-view version list --content-view cv-foobarbaz --organization-id 1
Sa 1. Jun 13:21:28 CEST 2019
---|-------------------|---------|------------------------------------------------------
ID | NAME | VERSION | LIFECYCLE ENVIRONMENTS
---|-------------------|---------|------------------------------------------------------
53 | cv-foobarbaz 12.0 | 12.0 | Library
37 | cv-foobarbaz 11.0 | 11.0 | Engineering, Development, Quality Assurance, SOE Test
33 | cv-foobarbaz 10.0 | 10.0 |
30 | cv-foobarbaz 9.0 | 9.0 |
28 | cv-foobarbaz 8.0 | 8.0 |
17 | cv-foobarbaz 7.0 | 7.0 |
---|-------------------|---------|------------------------------------------------------
- name: "cv-foobarbaz"
publish_new_version: True
publish_description: "Published by Ansible"
promote_description: "Promoted by Ansible"
keep_content_view_versions_count: 3
promote_to:
- "SOE Test"
- "Engineering"
- "Development"
- "Quality Assurance"
playbook run reports
pcfe@karhu pcfe.net (master) $ date ; ansible-playbook satellite-CV-maintenance.yml
Sa 1. Jun 13:22:12 CEST 2019
[...]
TASK [ahuffman.satellite6_manage_content_views : Report content view changes] *****************************************************************************************************************************************
ok: [localhost] => {
"msg": [
"Total content views published: 1",
"Content views published:",
[
"cv-foobarbaz"
],
"Total composite content views published: 0",
"Composite content views published:",
[],
"Total content view promotions: 4",
"Content views promoted:",
[
"cv-foobarbaz was promoted to Quality Assurance, Development, Engineering, SOE Test"
],
"Total composite content view component updates: 0",
"Composite content view components updated:",
[],
"Total content view versions removed: 4",
"Content view versions removed:",
[
"cv-foobarbaz - id: 33",
"cv-foobarbaz - id: 30",
"cv-foobarbaz - id: 28",
"cv-foobarbaz - id: 17"
]
]
}
PLAY RECAP ************************************************************************************************************************************************************************************************************
localhost : ok=70 changed=6 unreachable=0 failed=0 skipped=43 rescued=0 ignored=0
[root@satellite ~]# date ; hammer content-view version list --content-view cv-foobarbaz --organization-id 1
Sa 1. Jun 13:30:06 CEST 2019
---|-------------------|---------|---------------------------------------------------------------
ID | NAME | VERSION | LIFECYCLE ENVIRONMENTS
---|-------------------|---------|---------------------------------------------------------------
54 | cv-foobarbaz 13.0 | 13.0 | Library, Engineering, Development, Quality Assurance, SOE Test
53 | cv-foobarbaz 12.0 | 12.0 |
37 | cv-foobarbaz 11.0 | 11.0 |
---|-------------------|---------|---------------------------------------------------------------
@pcfe I think I know why it tried deletion of 10.0. Previously I was sorting the list of versions on the name field, and switched to the id field now. The id's should theoretically always be incrementing higher.
I'm unsure if this is guaranteed, asked for clarification
Please hold off merging to master until it's certain the ID is always increasing. I have this nagging doubts that it just might not be the case sometimes.
Please hold off merging to master until it's certain the ID is always increasing. I have this nagging doubts that it just might not be the case sometimes.
Goodie, I remembered wrong. It was confirmed these always increase.
I have this in my playbook
and my versions are:
So I was expecting to keep 10.0, 9.0 and 8.0 and to delete 7.0
Yet it seems it tried to delete 10.0