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

Module oci_object_storage_object does not support check mode #276

Open
jeliker opened this issue Apr 4, 2024 · 0 comments
Open

Module oci_object_storage_object does not support check mode #276

jeliker opened this issue Apr 4, 2024 · 0 comments

Comments

@jeliker
Copy link

jeliker commented Apr 4, 2024

Issue Report

When executing playbook with --check flag, oci_object_storage_object is throwing error because destination folder does not exist. This is true because --check is preventing the destination folder from being created (i.e. module ansible.builtin.file is properly respecting check-mode so not creating the folder).

Expected behavior
When --check flag is set I expect oci_object_storage_object module to not actually download the object being referenced.

Environment

  • OS version:
    macOS 14.3.1
  • Ansible version:
ansible [core 2.15.0]
  config file = /Users/JEliker/work/hbs/git.hbs/ansible/ansible.cfg
  configured module search path = ['/Users/JEliker/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/8.0.0/libexec/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/JEliker/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.4 (main, Jun 15 2023, 07:29:58) [Clang 14.0.3 (clang-1403.0.22.14.1)] (/usr/local/Cellar/ansible/8.0.0/libexec/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True
  • OCI Python SDK version:
    2.125.0

  • OCI Ansible Modules version:
    oracle.oci 4.43.0

Ansible playbook to reproduce the issue

---
- name: Download
  hosts: all

  tasks:
    - name: Create download folder
      file:
        path: "{{ download_folder }}"
        state: directory
      delegate_to: localhost

    - name: Download installer
      oracle.oci.oci_object_storage_object:
        bucket_name: server-build
        object_name: "{{ item.object_name }}"
        dest: "{{ download_folder }}/{{ item.local_name }}"
        auth_type: api_key
        namespace_name: "{{ os_namespace.namespace }}"
      delegate_to: localhost
      with_items: "{{ installers }}"
$ ansible-playbook -i inventories/remote --diff --check books/download.yml

. . . 

TASK [Create download folder] ********************************************************************************************************
--- before
+++ after
@@ -1,4 +1,4 @@
 {
     "path": "installers",
-    "state": "absent"
+    "state": "directory"
 }

changed: [app1.sub1.vcn1.oraclevcn.com -> localhost]

TASK [Download installers] ***********************************************************************************************************
failed: [app1.sub1.vcn1.oraclevcn.com -> localhost] (item={'key': 'app1', 'local_name': 'app1-linux.rpm', 'object_name': 'app1-9.1.1.x86_64.rpm', 'sha1sum': 'e7df4c5fe051d0589b62b309dd206908bc02bf4d'}) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "splunk", "local_name": "app1-linux.rpm", "object_name": "app1-9.1.1.x86_64.rpm", "sha1sum": "e7df4c5fe051d0589b62b309dd206908bc02bf4d"}, "msg": "Error opening/creating the dest file: [Errno 2] No such file or directory: 'installers/app1-linux.rpm'", "troubleshooting_tips": "Refer to troubleshooting guide https://docs.oracle.com/en-us/iaas/tools/oci-ansible-collection/latest/guides/troubleshooting-guide.html"}

PLAY RECAP ************************************************************************************************************************************
app1.sub1.vcn1.oraclevcn.com : ok=0    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
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

No branches or pull requests

1 participant