Bug 1880862
| Summary: | [ansible-freeipa] Not able to replace public-key-file to the public-key in asymmetric vault type. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Varun Mylaraiah <mvarun> |
| Component: | ansible-freeipa | Assignee: | Rafael Jeffman <rjeffman> |
| Status: | CLOSED ERRATA | QA Contact: | ipa-qe <ipa-qe> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | high | ||
| Version: | 8.3 | CC: | pcech, rjeffman, twoerner |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-05-18 15:51:18 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
There is an upstream PR for this issue: https://github.com/freeipa/ansible-freeipa/pull/468 There is an upstream PR for this issue: https://github.com/freeipa/ansible-freeipa/pull/468 Upstream PR was merged. Verified
Version:
ansible-freeipa-0.3.2-1.el8.noarch
ipa-server-4.9.0-1.module+el8.4.0+9274+259c83ee.x86_64
Passed ansible_freeipa_tests/vault_module.py::TestAsymmetricVault::()::test_asymmetric_vault_update_publickey_file_to_publickey_and_retrieve_data
------------------------------ Captured log call -------------------------------
transport.py 293 INFO WRITE inventory/vault.hosts
sftp.py 158 DEBUG [chan 0] open(b'inventory/vault.hosts', 'wb')
sftp.py 158 DEBUG [chan 0] open(b'inventory/vault.hosts', 'wb') -> 00000000
sftp.py 158 DEBUG [chan 0] close(00000000)
transport.py 329 INFO PUT vault_module.yml
sftp.py 158 DEBUG [chan 0] open(b'vault_module.yml', 'wb')
sftp.py 158 DEBUG [chan 0] open(b'vault_module.yml', 'wb') -> 00000000
sftp.py 158 DEBUG [chan 0] close(00000000)
sftp.py 158 DEBUG [chan 0] stat(b'vault_module.yml')
channel.py 1212 DEBUG [chan 82] Max packet in: 32768 bytes
channel.py 1212 DEBUG [chan 82] Max packet out: 32768 bytes
transport.py 1819 DEBUG Secsh channel 82 opened.
transport.py 318 INFO RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/vault.hosts', 'vault_module.yml']
transport.py 519 DEBUG RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/vault.hosts', 'vault_module.yml']
channel.py 1212 DEBUG [chan 82] Sesch channel 82 request ok
transport.py 563 DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py 563 DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
transport.py 563 DEBUG ansible-playbook 2.9.17
transport.py 563 DEBUG config file = /root/ansible.cfg
transport.py 563 DEBUG configured module search path = ['/root/ansible-freeipa/plugins/modules', '/usr/share/ansible/plugins/modules']
transport.py 563 DEBUG ansible python module location = /usr/lib/python3.6/site-packages/ansible
transport.py 563 DEBUG executable location = /usr/bin/ansible-playbook
transport.py 563 DEBUG python version = 3.6.8 (default, Dec 7 2020, 09:56:35) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
transport.py 563 DEBUG Using /root/ansible.cfg as config file
transport.py 563 DEBUG Skipping callback 'actionable', as we already have a stdout callback.
transport.py 563 DEBUG Skipping callback 'counter_enabled', as we already have a stdout callback.
transport.py 563 DEBUG Skipping callback 'debug', as we already have a stdout callback.
transport.py
transport.py 563 DEBUG PLAYBOOK: vault_module.yml *****************************************************
transport.py 563 DEBUG 1 plays in vault_module.yml
transport.py 563 DEBUG
transport.py 563 DEBUG PLAY [Playbook to ensure the asymmetric vault is updated from public-key-file to public-key.] ***
transport.py 563 DEBUG
transport.py 563 DEBUG TASK [Gathering Facts] *********************************************************
transport.py 563 DEBUG task path: /root/vault_module.yml:2
transport.py 563 DEBUG ok: [master.ipadomain.test]
transport.py 563 DEBUG META: ran handlers
transport.py 563 DEBUG
transport.py 563 DEBUG TASK [ipavault] ****************************************************************
transport.py 563 DEBUG task path: /root/vault_module.yml:6
transport.py 563 DEBUG changed: [master.ipadomain.test] => {"changed": true}
transport.py 563 DEBUG
transport.py 563 DEBUG TASK [ipavault] ****************************************************************
transport.py 563 DEBUG task path: /root/vault_module.yml:12
transport.py 563 DEBUG changed: [master.ipadomain.test] => {"changed": true}
transport.py 563 DEBUG META: ran handlers
transport.py 563 DEBUG META: ran handlers
transport.py 563 DEBUG
transport.py 563 DEBUG PLAY RECAP *********************************************************************
transport.py 563 DEBUG master.ipadomain.test : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
transport.py 563 DEBUG
channel.py 1212 DEBUG [chan 82] EOF received (82)
channel.py 1212 DEBUG [chan 82] EOF sent (82)
transport.py 217 DEBUG Exit code: 0
channel.py 1212 DEBUG [chan 313] Max packet in: 32768 bytes
channel.py 1212 DEBUG [chan 313] Max packet out: 32768 bytes
transport.py 1819 DEBUG Secsh channel 313 opened.
transport.py 318 INFO RUN ['kinit', 'admin']
transport.py 519 DEBUG RUN ['kinit', 'admin']
channel.py 1212 DEBUG [chan 313] Sesch channel 313 request ok
transport.py 563 DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py 563 DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
transport.py 563 DEBUG Password for admin:
channel.py 1212 DEBUG [chan 313] EOF received (313)
channel.py 1212 DEBUG [chan 313] EOF sent (313)
transport.py 217 DEBUG Exit code: 0
channel.py 1212 DEBUG [chan 314] Max packet in: 32768 bytes
channel.py 1212 DEBUG [chan 314] Max packet out: 32768 bytes
transport.py 1819 DEBUG Secsh channel 314 opened.
transport.py 318 INFO RUN ['ipa', 'vault-show', '76asyvault']
transport.py 519 DEBUG RUN ['ipa', 'vault-show', '76asyvault']
channel.py 1212 DEBUG [chan 314] Sesch channel 314 request ok
transport.py 563 DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py 563 DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
transport.py 563 DEBUG Vault name: 76asyvault
transport.py 563 DEBUG Type: asymmetric
transport.py 563 DEBUG Public key: LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFsdDNDWk5CNzhNNmZmNXdOYm80OAp3ellWU1cxKzBOVFpXcUxtWUNiYk1mNmtmVHozazJvNEpnS0owUXY4VTZQK3c0SzkzVW5HUVN3WC9qRFh1TXNCCmxpN2JPSmh6MGQ5SlNwZGo1NmJVNFNmQ0pQRmJlbUFiRGRtVkYzS1VtYUxOKzhBTEgzRy8vMk9KQlp0dzVndFkKbnN1bVIvck1XRmg0eWZBSWhpemNKdlhLMlR5Qmxxc3R1N2VaZ2ErQ20wMDRIazhNNWdvbHBMQjE4aW1acW1QYwovQ2d2b2dGajI5UHR5K3RISEtzK3J4Z2JpK2VwTWY2Z2xpV1JmbVdZc0JlSHJJaE41dHQ3d2Y2U0F2eHI5L2RkCi94cG9PcnNNUkhyRFd6bXJsSEN6cEJGbk82ajFuRWNvSk1mNFdBekxDSjVDOWIydWpzR0JiTXZlYW1Oc2pMRjkKY1FJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==
transport.py 563 DEBUG Owner users: admin
transport.py 563 DEBUG Vault user: admin
channel.py 1212 DEBUG [chan 314] EOF received (314)
channel.py 1212 DEBUG [chan 314] EOF sent (314)
transport.py 217 DEBUG Exit code: 0
channel.py 1212 DEBUG [chan 315] Max packet in: 32768 bytes
channel.py 1212 DEBUG [chan 315] Max packet out: 32768 bytes
transport.py 1819 DEBUG Secsh channel 315 opened.
transport.py 318 INFO RUN ['kdestroy', '-A']
transport.py 519 DEBUG RUN ['kdestroy', '-A']
channel.py 1212 DEBUG [chan 315] Sesch channel 315 request ok
transport.py 563 DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py 563 DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
channel.py 1212 DEBUG [chan 315] EOF received (315)
channel.py 1212 DEBUG [chan 315] EOF sent (315)
transport.py 217 DEBUG Exit code: 0
transport.py 293 INFO WRITE inventory/vault.hosts
sftp.py 158 DEBUG [chan 0] open(b'inventory/vault.hosts', 'wb')
sftp.py 158 DEBUG [chan 0] open(b'inventory/vault.hosts', 'wb') -> 00000000
sftp.py 158 DEBUG [chan 0] close(00000000)
transport.py 329 INFO PUT vault_module.yml
sftp.py 158 DEBUG [chan 0] open(b'vault_module.yml', 'wb')
sftp.py 158 DEBUG [chan 0] open(b'vault_module.yml', 'wb') -> 00000000
sftp.py 158 DEBUG [chan 0] close(00000000)
sftp.py 158 DEBUG [chan 0] stat(b'vault_module.yml')
channel.py 1212 DEBUG [chan 83] Max packet in: 32768 bytes
channel.py 1212 DEBUG [chan 83] Max packet out: 32768 bytes
transport.py 1819 DEBUG Secsh channel 83 opened.
transport.py 318 INFO RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/vault.hosts', 'vault_module.yml']
transport.py 519 DEBUG RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/vault.hosts', 'vault_module.yml']
channel.py 1212 DEBUG [chan 83] Sesch channel 83 request ok
transport.py 563 DEBUG -bash: line 1: cd: /root/multihost_tests: No such file or directory
transport.py 563 DEBUG -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
transport.py 563 DEBUG ansible-playbook 2.9.17
transport.py 563 DEBUG config file = /root/ansible.cfg
transport.py 563 DEBUG configured module search path = ['/root/ansible-freeipa/plugins/modules', '/usr/share/ansible/plugins/modules']
transport.py 563 DEBUG ansible python module location = /usr/lib/python3.6/site-packages/ansible
transport.py 563 DEBUG executable location = /usr/bin/ansible-playbook
transport.py 563 DEBUG python version = 3.6.8 (default, Dec 7 2020, 09:56:35) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
transport.py 563 DEBUG Using /root/ansible.cfg as config file
transport.py 563 DEBUG
transport.py 563 DEBUG PLAYBOOK: vault_module.yml *****************************************************
transport.py 563 DEBUG 1 plays in vault_module.yml
transport.py 563 DEBUG
transport.py 563 DEBUG PLAY [Playbook to ensure the data is retrieved from asymmetric vault with new private key.] ***
transport.py 563 DEBUG
transport.py 563 DEBUG TASK [Gathering Facts] *********************************************************
transport.py 563 DEBUG task path: /root/vault_module.yml:2
transport.py 563 DEBUG ok: [master.ipadomain.test]
transport.py 563 DEBUG META: ran handlers
transport.py 563 DEBUG
transport.py 563 DEBUG TASK [ipavault] ****************************************************************
transport.py 563 DEBUG task path: /root/vault_module.yml:6
transport.py 563 DEBUG ok: [master.ipadomain.test] => {"changed": false, "vault": {"data": "Test_Vault_Data"}}
transport.py 563 DEBUG META: ran handlers
transport.py 563 DEBUG META: ran handlers
transport.py 563 DEBUG
transport.py 563 DEBUG PLAY RECAP *********************************************************************
transport.py 563 DEBUG master.ipadomain.test : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
transport.py 563 DEBUG
channel.py 1212 DEBUG [chan 83] EOF received (83)
channel.py 1212 DEBUG [chan 83] EOF sent (83)
transport.py 217 DEBUG Exit code: 0
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (ansible-freeipa bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2021:1860 |
Description of problem: In the vault module, Currently, not able to replace public-key-file to the public-key in asymmetric vault. Version-Release number of selected component (if applicable): ansible-freeipa-0.1.12-6.el8.noarch Steps to Reproduce: --- - name: Playbook to ensure the asymmetric vault is updated from public-key-file to public-key. hosts: ipaserver tasks: - ipavault: ipaadmin_password: <XXXXPASSWORDXXXX> name: 76asyvault vault_type: asymmetric public_key_file: "{{ ansible_env.HOME }}/public.pem" - ipavault: ipaadmin_password: <XXXXPASSWORDXXXX> name: 76asyvault private_key_file: "{{ ansible_env.HOME }}/private.pem" public_key: LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUE2aDBWZjVkZlljdzIxbHZ5SXRybwpQVGxja0xMSmRTVDltemgrTW9RNHl2KzFnR0UvQVdWZnppT3J0WjNnWTEyN1pxZ1JBNnJCMjJwU2N5ZGtmajY5CkxXZUwrUDdYNUUzN0JFRmJKRVZZSGRLSWZrT2p3NDhObEMwSlo0UW9oalpyVUQrSU1NS21lL0ZjZnZ6WDkwT3gKQ3RmQ0tSenY3MDlNYUlDaGhqZXhiOVdrM3dHcUdWYW1oa3hpNFA0eTBBWU5HQzRFbDZ6a3k5T2pndHYwR25FYQpTdVMxeE9jQTM0Nnd4RzIvN1ljTENhYVFQM0l2RTBZcStLV28yeUNxVldWOVpxWVR5SU9YSTNGRm5uSFJFWjBPCmVnNkhjK2Y3Y2pUNG4zWlhBc05TL291S241YVpoSSs1YkRyd0ZuaFQ1ODljN3N0Y1c3blpLWjEyMytBM2FnbXMKR3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg== [root@ansible ~]# ansible-playbook -vv -i inventory/vault.hosts vault_module.yml ansible-playbook 2.9.12 config file = /root/ansible.cfg configured module search path = ['/root/ansible-freeipa/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.6/site-packages/ansible executable location = /usr/bin/ansible-playbook python version = 3.6.8 (default, Aug 18 2020, 08:33:21) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] Using /root/ansible.cfg as config file PLAYBOOK: vault_module.yml ******************************************************************************************* 1 plays in vault_module.yml PLAY [Playbook to ensure the asymmetric vault is updated from public-key-file to public-key.] ************************ TASK [Gathering Facts] *********************************************************************************************** task path: /root/vault_module.yml:2 ok: [master.ipadomain.test] META: ran handlers TASK [ipavault] ****************************************************************************************************** task path: /root/vault_module.yml:6 ok: [master.ipadomain.test] => {"changed": false} TASK [ipavault] ****************************************************************************************************** task path: /root/vault_module.yml:11 fatal: [master.ipadomain.test]: FAILED! => {"changed": false, "msg": "Argument 'private_key_file' can not be used with state 'present', action 'vault'"} PLAY RECAP *********************************************************************************************************** master.ipadomain.test : ok=2 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 CLI console output ===================== [root@master ~]# ipa vault-add testasyvault02 --type=asymmetric --public-key-file=/root/controller_public.pem ---------------------------- Added vault "testasyvault02" ---------------------------- Vault name: testasyvault02 Type: asymmetric Public key: LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUE2ZXVnMTRLbXlIVFEwdm50VGFWKwpTSmMrTXppWmRXVS8xK2Fvb2dzZmxFdGh0YWxMNDMwU2Q4QlAzNi90dXJ0MXZkazdZMEs1eU1kYVZQMzg3NlNtCitVdEhlVWMwSENHUFlvTTh6MTNHZnlNU1ZXd3ltMEZYSUhaTkYydExRaGltRFZJSy83VzRwVk5HR040eG5jWHMKSWVGYWhVU3A4K2ltWGdRSW1VajViOWJyYmRhbThTYmNvcEtqc1pUS2FBNFdHeU1pRUQva2tZQTRpdThaWUl0OQpDYmMrRDFYSGJodVptVTJjb215Mk9nOTJPWTVjNDQxMzY1VFFDNWlsc01SMCtMNERGSEVmWVd4eS91eUtWZ05SCldBTmJjV3ZXQnpPTnIzem00UCtDUTYyT25neG4vbVV2Q05EZmpkU3psVFdXS25OMmpnUHpqMXZxR2lwQ2RYTkYKclFJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCgo= Owner users: admin Vault user: admin [root@master ~]# ipa vault-mod testasyvault02 --type=asymmetric --private-key-file=/root/controller_private.pem --public-key=LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUE2aDBWZjVkZlljdzIxbHZ5SXRybwpQVGxja0xMSmRTVDltemgrTW9RNHl2KzFnR0UvQVdWZnppT3J0WjNnWTEyN1pxZ1JBNnJCMjJwU2N5ZGtmajY5CkxXZUwrUDdYNUUzN0JFRmJKRVZZSGRLSWZrT2p3NDhObEMwSlo0UW9oalpyVUQrSU1NS21lL0ZjZnZ6WDkwT3gKQ3RmQ0tSenY3MDlNYUlDaGhqZXhiOVdrM3dHcUdWYW1oa3hpNFA0eTBBWU5HQzRFbDZ6a3k5T2pndHYwR25FYQpTdVMxeE9jQTM0Nnd4RzIvN1ljTENhYVFQM0l2RTBZcStLV28yeUNxVldWOVpxWVR5SU9YSTNGRm5uSFJFWjBPCmVnNkhjK2Y3Y2pUNG4zWlhBc05TL291S241YVpoSSs1YkRyd0ZuaFQ1ODljN3N0Y1c3blpLWjEyMytBM2FnbXMKR3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg== ------------------------------- Modified vault "testasyvault02" ------------------------------- Vault name: testasyvault02 Type: asymmetric Public key: LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUE2aDBWZjVkZlljdzIxbHZ5SXRybwpQVGxja0xMSmRTVDltemgrTW9RNHl2KzFnR0UvQVdWZnppT3J0WjNnWTEyN1pxZ1JBNnJCMjJwU2N5ZGtmajY5CkxXZUwrUDdYNUUzN0JFRmJKRVZZSGRLSWZrT2p3NDhObEMwSlo0UW9oalpyVUQrSU1NS21lL0ZjZnZ6WDkwT3gKQ3RmQ0tSenY3MDlNYUlDaGhqZXhiOVdrM3dHcUdWYW1oa3hpNFA0eTBBWU5HQzRFbDZ6a3k5T2pndHYwR25FYQpTdVMxeE9jQTM0Nnd4RzIvN1ljTENhYVFQM0l2RTBZcStLV28yeUNxVldWOVpxWVR5SU9YSTNGRm5uSFJFWjBPCmVnNkhjK2Y3Y2pUNG4zWlhBc05TL291S241YVpoSSs1YkRyd0ZuaFQ1ODljN3N0Y1c3blpLWjEyMytBM2FnbXMKR3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg== Owner users: admin Vault user: admin Actual results: Not able to change public-key-file to new public key