ansible-oracle icon indicating copy to clipboard operation
ansible-oracle copied to clipboard

Extract setup files when oracle_sw_copy and is_sw_source_local are set to True

Open talek opened this issue 2 years ago • 0 comments

Hello,

I guess I'm doing something wrong, but I can't figure it out. This is the playbook I use:

- hosts: oracle
  become: yes
  vars:
    ansible_user: cloud-user
    is_sw_source_local: True
    oracle_sw_copy: True
    db_homes_config:
      19c:
        home: 19c
        oracle_home: "{{ oracle_base }}/19c/dbh1"
        version: 19.3.0.0
        edition: EE
    db_homes_installed:
      - home: 19c
        apply_patches: False
        state: present
  roles:
    - common
    - orahost
    - cxoracle
    - oraswdb-install

The Oracle 19c setup zip is already available in '/tmp', on my ansible central host. When I run the playbook, I get:

...
TASK [oraswdb-install : install-home-db | Transfer oracle installfiles to server (local)] ******************
skipping: [oracle01] => (item=[{'filename': 'LINUX.X64_213000_db_home.zip', 'version': '21.3.0.0', 'creates': 'install/.img.bin'}, {'home': '19c', 'apply_patches': False, 'state': 'present'}])
changed: [oracle01] => (item=[{'filename': 'LINUX.X64_193000_db_home.zip', 'version': '19.3.0.0', 'creates': 'install/.img.bin'}, {'home': '19c', 'apply_patches': False, 'state': 'present'}])
...
TASK [oraswdb-install : install-home-db | Extract files] ***************************************************
skipping: [oracle01] => (item=[{'filename': 'LINUX.X64_213000_db_home.zip', 'version': '21.3.0.0', 'creates': 'install/.img.bin'}, ''])
failed: [oracle01] (item=[{'filename': 'LINUX.X64_193000_db_home.zip', 'version': '19.3.0.0', 'creates': 'install/.img.bin'}, '']) => {"ansible_loop_var": "item", "changed": false, "item": [{"creates": "install/.img.bin", "filename": "LINUX.X64_193000_db_home.zip", "version": "19.3.0.0"}, ""], "msg": "Source '/u01/stage//tmp/LINUX.X64_193000_db_home.zip' does not exist"}

Looking into the corresponding task I can see that the src argument of the unarchive module takes into account the oracle_sw_source_local so the final result seems odd. On the target host I can see that the zip file was successfully copied on /u01/stage.

Any pointers on how to fix this?

Thank you!

talek avatar May 23 '22 15:05 talek