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

Account for file copy scenario where installation zip is already staged on remote host.

Open enlightenalpha opened this issue 6 years ago • 5 comments

To significantly decrease deployment times, we imbed the Oracle installation zip in our Azure image and version the image based on the DB version. It would be helpful to account for this scenario in the oraswdb-install role. The task snippet below works for our purposes. Obviously the when condition would need to be adjusted avoid overlapping logic with existing file copy scenarios. We simply commented out task "install-home-db | Transfer oracle installfiles to server (local)" as a workaround for now.

  • name: Copy files already staged on remote hosts command: sudo -u {{ oracle_user }} cp {{oracle_sw_source_remote}}/{{ item[0].filename }} . args: chdir: "{{ oracle_sw_source_remote }}" with_nested: - "{{oracle_sw_image_db}}" - "{{db_homes_installed}}" become: yes become_user: "{{ oracle_user }}" run_once: "{{ configure_cluster}}" when: item[0].version == db_homes_config[item[1].home]['version'] and item[1].state|lower == 'present' and is_sw_source_local and oracle_sw_copy tags: - oradbsw

enlightenalpha avatar Aug 16 '18 17:08 enlightenalpha

Hi,

  1. Thanks for using the project!
  2. Just so I understand this correctly - you have the zip-files staged on the host already, and you just want to unzip them?

oravirt avatar Aug 16 '18 17:08 oravirt

Thanks for the response!

Yes - however, I suppose I could use the existing curl task to copy the file like so: curl -o /path/to/destination file:///path/to/source/file

This could allow me to accomplish my goal with existing functionality. What do you think?

enlightenalpha avatar Aug 16 '18 17:08 enlightenalpha

ok - You can already do this:

oracle_sw_copy: False
oracle_sw_unpack: True
oracle_stage_remote: /path/to/staged-zipfiles

Try that and let me know how it works out.

(I'm working on trying to make this a bit easier, with less variables to juggle, or maybe more descriptive names)

oravirt avatar Aug 16 '18 18:08 oravirt

Thank you for the suggestion. I will give it a try and let you know.

enlightenalpha avatar Aug 16 '18 22:08 enlightenalpha

Confirmed that this works. Thank you.

enlightenalpha avatar Aug 22 '18 23:08 enlightenalpha