I am using the oneview_repositories plugin to create an external repository on OneView, however running the code a second time doesn't garantee idempotency.
Idempotency is respected when running the playbook a second time. I understand that only one external repository can be present on a given OneView but the second execution should not throw an error, only ignore the task as there was no changes.
Actual Result
Result of the first ansible-playbook command:
TASK [external_fw_repo : Create an external repository] *********************************************************************************************
changed: [localhost -> localhost] => [...]
"msg": "Repository created successfully.",
"param": {
"repository_name": "extRepo",
"repository_password": "Apassword",
"repository_type": "FirmwareExternalRepo",
"repository_uri": "<external_repo_uri>",
"repository_username": "user"
}
}
META: ran handlers
META: ran handlers
PLAY RECAP ******************************************************************************************************************************************
localhost : ok=5 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Result of the second ansible-playbook command:
raise HPEOneViewException(body)\nhpeOneView.exceptions.HPEOneViewException: ('Adding multiple external repository is currently not supported.', {'errorCode': 'MULTIPLE_REPOSITORY_NOT_SUPPORTED_ERROR', 'message': 'Adding multiple external repository is currently not supported.', 'details': '', 'messageParameters': [], 'recommendedActions': ['Remove the existing external repository and retry the operation.'], 'errorSource': None, 'nestedErrors': [], 'data': {}})\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"param": {
"repository_name": "extRepo",
"repository_password": "Apassword",
"repository_type": "FirmwareExternalRepo",
"repository_uri": "<external_repo_uri>",
"repository_username": "user"
},
"rc": 1
}
PLAY RECAP ******************************************************************************************************************************************
localhost : ok=3 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Scenario/Intent
Hello,
I am using the
oneview_repositories
plugin to create an external repository on OneView, however running the code a second time doesn't garantee idempotency.main.yml
Environment Details
Expected Result
Idempotency is respected when running the playbook a second time. I understand that only one external repository can be present on a given OneView but the second execution should not throw an error, only ignore the task as there was no changes.
Actual Result
Result of the first
ansible-playbook
command:Result of the second
ansible-playbook
command: