|
| 1 | +--- |
| 2 | +- name: Assert |
| 3 | + ansible.builtin.include_tasks: assert.yml |
| 4 | + tags: |
| 5 | + - assert |
| 6 | + - always |
| 7 | + |
| 8 | +- name: install_cluvfy | Install |
| 9 | + become: true |
| 10 | + become_user: "{{ oracle_user }}" |
| 11 | + vars: |
| 12 | + _creates: >- |
| 13 | + {{ oracluvfy_force_update | bool | ternary((oracluvfy_home + '/missing_file'), _oracluvfy_executable) }} |
| 14 | + block: |
| 15 | + - name: install_cluvfy | download cluvfy (copy) |
| 16 | + ansible.builtin.copy: |
| 17 | + src: "{{ oracle_sw_source_local }}/{{ oracluvfy_archive }}" |
| 18 | + dest: "{{ oracle_stage }}" |
| 19 | + mode: 0664 |
| 20 | + force: false |
| 21 | + remote_src: false |
| 22 | + when: |
| 23 | + - is_sw_source_local |
| 24 | + - oracle_sw_copy |
| 25 | + - not _oracluvfy_executable_stat.stat.exists | default(false) or oracluvfy_force_update |
| 26 | + |
| 27 | + - name: install_cluvfy | download cluvfy (www) |
| 28 | + ansible.builtin.get_url: |
| 29 | + url: "{{ oracle_sw_source_www }}/{{ oracluvfy_archive }}" |
| 30 | + dest: "{{ oracle_stage }}" |
| 31 | + mode: 0644 |
| 32 | + force: false |
| 33 | + when: |
| 34 | + - not is_sw_source_local |
| 35 | + - oracle_sw_copy |
| 36 | + - not _oracluvfy_executable_stat.stat.exists | default(false) or oracluvfy_force_update |
| 37 | + |
| 38 | + - name: install_cluvfy | Create target directory |
| 39 | + ansible.builtin.file: |
| 40 | + path: "{{ oracluvfy_home }}" |
| 41 | + mode: "0755" |
| 42 | + recurse: true |
| 43 | + state: directory |
| 44 | + |
| 45 | + - name: install_cluvfy | Unarchive cluvfy archive |
| 46 | + ansible.builtin.unarchive: |
| 47 | + src: "{{ _oracluvfy_stage }}/{{ oracluvfy_archive }}" |
| 48 | + dest: "{{ oracluvfy_home }}" |
| 49 | + copy: false |
| 50 | + args: |
| 51 | + creates: "{{ _creates }}" |
| 52 | + |
| 53 | + - name: install_cluvfy | Remove local copy of {{ oracluvfy_archive }} |
| 54 | + ansible.builtin.file: |
| 55 | + path: "{{ _oracluvfy_stage }}/{{ oracluvfy_archive }}" |
| 56 | + state: absent |
| 57 | + when: |
| 58 | + - oracle_sw_copy |
| 59 | + |
| 60 | + - name: install_cluvfy | Show installed version |
| 61 | + ansible.builtin.command: >- |
| 62 | + {{ _oracluvfy_executable }} -version |
| 63 | + args: |
| 64 | + chdir: "{{ oracluvfy_home }}" |
| 65 | + register: cluvfy_version_res |
| 66 | + changed_when: cluvfy_version_res.rc == 0 |
| 67 | + |
| 68 | + - name: install_cluvfy | Show version |
| 69 | + ansible.builtin.debug: |
| 70 | + var: cluvfy_version_res.stdout_lines |
0 commit comments