From 28b28ee65954770e0e192bec092c71b80651418a Mon Sep 17 00:00:00 2001 From: Thorsten Bruhns Date: Mon, 13 Sep 2021 08:06:58 +0000 Subject: [PATCH] oraswgi-install: ansible-lint --- .ansible-lint | 1 - .github/workflows/ansible-lint.yml | 1 + roles/oraswgi-install/defaults/main.yml | 296 ++++++++++----------- roles/oraswgi-install/tasks/11.2.0.3.yml | 90 ++++--- roles/oraswgi-install/tasks/11.2.0.4.yml | 90 ++++--- roles/oraswgi-install/tasks/12.1.0.1.yml | 74 ++++-- roles/oraswgi-install/tasks/12.1.0.2.yml | 86 ++++--- roles/oraswgi-install/tasks/12.2.0.1.yml | 312 ++++++++++++----------- roles/oraswgi-install/tasks/18.3.0.0.yml | 311 +++++++++++----------- roles/oraswgi-install/tasks/19.3.0.0.yml | 299 +++++++++++----------- roles/oraswgi-install/tasks/21.3.0.0.yml | 246 +++++++++--------- roles/oraswgi-install/tasks/curl.yml | 8 +- roles/oraswgi-install/tasks/get_url.yml | 13 +- roles/oraswgi-install/tasks/main.yml | 286 +++++++++++---------- 14 files changed, 1146 insertions(+), 967 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 5ab9deb82..aa4b80323 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -32,6 +32,5 @@ exclude_paths: - roles/oradb-delete # ansible-oracle roles wip - will be removed after refactoring - - roles/oraswgi-install - roles/oraswgi-manage-patches - roles/oraswgi-opatch diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 03a609066..b26d9474a 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -51,5 +51,6 @@ jobs: roles/oraswgi-golden-image roles/oraswdb-install roles/oraswdb-manage-patches + roles/oraswgi-install args: "" diff --git a/roles/oraswgi-install/defaults/main.yml b/roles/oraswgi-install/defaults/main.yml index 2ba04eb4c..6a37b7e83 100644 --- a/roles/oraswgi-install/defaults/main.yml +++ b/roles/oraswgi-install/defaults/main.yml @@ -1,144 +1,156 @@ --- - #master_node: true - cluster_master: "{{play_hosts[0]}}" - role_separation: false - hostgroup: "{{ group_names[0] }}" - hostgroup_hub: "{{ hostgroup }}-hub" - hostgroup_leaf: "{{ hostgroup }}-leaf" - - oracle_user: oracle # User that will own the Oracle Installations. - grid_user: grid - grid_install_user: "{% if role_separation %}{{ grid_user }}{% else %}{{ oracle_user }}{% endif %}" - oracle_user_home: "/home/{{ oracle_user }}" # Home directory for oracle_user. Needed for passing in ssh-keys, profiles etc - grid_user_home: "/home/{{ grid_install_user }}" # Home directory for oracle_user. Needed for passing in ssh-keys, profiles etc - oracle_group: oinstall # Primary group for oracle_user. - oper_group: oper - dba_group: dba # dba - asmoper_group: asmoper - asmdba_group: asmdba # osdba - asmadmin_group: asmadmin # osasm - - www_download_bin: curl # curl (shell module) or get_url module - oracle_sw_source_www: http://www/orasw # address to all software if using the get_url module when putting software on the host(s) - oracle_sw_source_local: /tmp # Path to all software if using the copy module when putting software on the host(s) - is_sw_source_local: true - oracle_sw_copy: "{% if install_from_nfs %}False{% else %}True{% endif %}" - oracle_sw_unpack: "{% if install_from_nfs %}False{% else %}True{% endif %}" - - install_from_nfs: false - nfs_server_sw: nfsserver - nfs_server_sw_path: /path/to/orasw - - oracle_stage: /u01/stage - oracle_stage_remote: "{{ oracle_stage }}" - oracle_stage_install: "{% if not oracle_sw_copy and not oracle_sw_unpack %}{{ oracle_stage_remote }}{% else %}{{ oracle_stage }}{% endif %}" - oracle_base: /u01/app/oracle - oracle_rsp_stage: "{{ oracle_stage }}/rsp" - oracle_inventory_loc: /u01/app/oraInventory - - oracle_directories: - - {name: "{{ oracle_stage }}", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775 } - - {name: "{{ oracle_rsp_stage }}", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775 } - - {name: "{{ oracle_base }}", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775 } - - {name: "{{ oracle_inventory_loc}}", owner: "{{ grid_install_user }}", group: "{{ oracle_group }}", mode: 775 } - - {name: "{{ oracle_base }}/cfgtoollogs", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775 } - - {name: "{{ oracle_base }}/admin", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775 } - - {name: "{{ oracle_base }}/audit", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775 } - - {name: "{{ oracle_base }}/cfgtoollogs/dbca", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775 } - - {name: "{{ oracle_base }}/cfgtoollogs/sqlpatch", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775 } - - {name: "{{ oracle_base }}/cfgtoollogs/netca", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775 } - - - oracle_home_gi: "{% if configure_cluster %}{{ oracle_home_gi_cl }}{% else %}{{ oracle_home_gi_so }}{% endif %}" - oracle_home_gi_cl: "/u01/app/{{ oracle_install_version_gi }}/grid" # ORACLE_HOME for Grid Infrastructure (Clustered) - oracle_home_gi_so: "{{ oracle_base }}/{{ oracle_install_version_gi }}/grid" # ORACLE_HOME for Grid Infrastructure (Stand Alone) - oracle_env: - ORACLE_HOME: "{{ oracle_home_gi }}" - - oracle_profile_name_gi: ".profile_grid" # .profile that sets up the environment for Grid Infrastructure (Cluster or Single node) - oracle_grid_responsefile: "grid-{{ oracle_cluster_name }}.rsp" # Name of responsefile-name used when installing Grid oInfrastructure - - # GI - default_gipass: "{% if oracle_password is defined %}{{ oracle_password }}{% else %}Oracle123{% endif%}" # The check for the old passwords are there for backwards compatibility and only temporary, will be removed - sysasmpassword: "{% if oracle_password is defined %}{{ oracle_password }}{% else %}Oracle123{% endif%}" # The check for the old passwords are there for backwards compatibility and only temporary, will be removed - asmmonitorpassword: "{% if oracle_password is defined %}{{ oracle_password }}{% else %}Oracle123{% endif%}" # The check for the old passwords are there for backwards compatibility and only temporary, will be removed - # DB - default_dbpass: "{% if item.0.oracle_db_passwd is defined %}{{ item.0.oracle_db_passwd}}{% else %}Oracle123{% endif%}" # The check for the old passwords are there for backwards compatibility and only temporary, will be removed - - #oracle_password: Oracle123 # Password used for all Grid Infrastructure related resources (e.g ASM) - oracle_scan: your.scan.address # Scan address for Clustered Grid Infrastructure - oracle_vip: -vip # Suffix for the host VIP-addresses (e.g orarac01-vip) - oracle_scan_port: 1521 # Listener port for scan-listener - oracle_ic_net: 3.3.3.{{ ansible_all_ipv4_addresses[0].split(".")[-1] }} # Picks the last octet from the public ip to use for cluster-interconnect ip (e.g 3.3.3.51) - oracle_asm_init_dg: crs - oracle_asm_disk_string: "{% if device_persistence == 'asmlib' %}{% elif device_persistence == 'udev' %}/dev/oracle/{% else %}{% endif %}" - device_persistence: asmlib - cvuqdisk_rpm: "{% if oracle_install_version_gi > '12.1.0.2' %}cvuqdisk-1.0.10-1.rpm{% else %}cvuqdisk-1.0.9-1.rpm{% endif %} " - - oracle_cluster_name: "{{ hostgroup }}" # Name of the cluster when setting up Clustered Grid Infrastructure - oracle_hostname: "{{ ansible_fqdn }}" # Full (FQDN) name of the host - oracle_gi_nic_pub: eth0 # Default interface for 'public' traffic. Only used in RAC - oracle_gi_nic_priv: eth1 # Default interface for interconnect traffic. Only used in RAC - - run_configtoolallcommand: true - oracle_cluster_mgmdb: true - oracle_gi_cluster_type: STANDARD # STANDARD | FLEX | STANDALONE (12.2 specific) - oracle_install_option_gi: "{% if configure_cluster %}CRS_CONFIG{% else %}HA_CONFIG{% endif %}" - oracle_install_version_gi: 12.2.0.1 - patch_before_rootsh: True - apply_patches_gi: False - - oracle_asm_storage_option: "{% if oracle_install_version_gi is version('12.2', '>=') %}FLEX_ASM_STORAGE{% else %}LOCAL_ASM_STORAGE{% endif %}" - - configure_cluster: false - oracle_gi_gns_subdomain: a.b.c - oracle_gi_gns_vip: gnsvip.a.b.c - - - opatcharchive: "{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/{% for opatchfile in oracle_opatch_patch if opatchfile['version']==oracle_install_version_gi %}{{ opatchfile['filename'] }}{% endfor %}" - - oracle_gi_image: "{%- if oracle_sw_copy %}{{ oracle_stage }} - {%- else %}{{ oracle_stage_remote }} - {%- endif %} - {%- if oracle_install_image_gi is defined %}/{{ oracle_install_image_gi }} - {%- else %}//{{ item.filename }} - {%- endif %}" - - oracle_sw_image_gi: # Files containing the installation media for Grid Infrastructure - - { filename: LINUX.X64_213000_grid_home.zip, version: 21.3.0.0, creates: 'install/.img.bin' } - - { filename: LINUX.X64_193000_grid_home.zip, version: 19.3.0.0, creates: 'install/.img.bin' } - - { filename: LINUX.X64_180000_grid_home.zip, version: 18.3.0.0, creates: 'install/.img.bin' } - - { filename: linuxx64_12201_grid_home.zip, version: 12.2.0.1, creates: 'xdk/mesg/lsxja.msb' } - - { filename: linuxamd64_12102_grid_1of2.zip, version: 12.1.0.2, creates: 'grid/stage/sizes/oracle.crs.12.1.0.2.0.sizes.properties' } - - { filename: linuxamd64_12102_grid_2of2.zip, version: 12.1.0.2, creates: 'grid/install/.oui' } - - { filename: linuxamd64_12c_grid_1of2.zip, version: 12.1.0.1 } - - { filename: linuxamd64_12c_grid_2of2.zip, version: 12.1.0.1 } - - { filename: p13390677_112040_Linux-x86-64_3of7.zip, version: 11.2.0.4, creates: 'grid/welcome.html' } - - { filename: p10404530_112030_Linux-x86-64_3of7.zip, version: 11.2.0.3, creates: 'grid/stage/properties/userPaths.properties' } - - # asm_diskgroups: - # - diskgroup: crs - # properties: - # - {redundancy: external, ausize: 4} - # attributes: - # - {name: 'compatible.rdbms', value: 11.2.0.4.0} - # - {name: compatible.asm, value: "{{ oracle_install_version_gi }}"} - # disk: - # - {device: /dev/sdd, asmlabel: crs01} - # - diskgroup: data - # properties: - # - {redundancy: external, ausize: 4} - # attributes: - # - {name: compatible.rdbms, value: 11.2.0.4.0} - # - {name: compatible.asm, value: "{{ oracle_install_version_gi }}"} - # disk: - # - {device: /dev/sde, asmlabel: data01} - # - diskgroup: fra - # properties: - # - {redundancy: external, ausize: 4} - # attributes: - # - {name: compatible.rdbms, value: 11.2.0.4.0} - # - {name: compatible.asm, value: "{{ oracle_install_version_gi }}"} - # disk: - # - {device: /dev/sdf, asmlabel: fra01} +# master_node: true +cluster_master: "{{play_hosts[0]}}" +role_separation: false +hostgroup: "{{ group_names[0] }}" +hostgroup_hub: "{{ hostgroup }}-hub" +hostgroup_leaf: "{{ hostgroup }}-leaf" + +oracle_user: oracle # User that will own the Oracle Installations. +grid_user: grid +grid_install_user: "{% if role_separation %}{{ grid_user }}{% else %}{{ oracle_user }}{% endif %}" +oracle_user_home: "/home/{{ oracle_user }}" # Home directory for oracle_user. Needed for passing in ssh-keys, profiles etc +grid_user_home: "/home/{{ grid_install_user }}" # Home directory for oracle_user. Needed for passing in ssh-keys, profiles etc +oracle_group: oinstall # Primary group for oracle_user. +oper_group: oper +dba_group: dba # dba +asmoper_group: asmoper +asmdba_group: asmdba # osdba +asmadmin_group: asmadmin # osasm + +www_download_bin: curl # curl (shell module) or get_url module +oracle_sw_source_www: http://www/orasw # address to all software if using the get_url module when putting software on the host(s) +oracle_sw_source_local: /tmp # Path to all software if using the copy module when putting software on the host(s) +is_sw_source_local: true +oracle_sw_copy: "{% if install_from_nfs %}False{% else %}True{% endif %}" +oracle_sw_unpack: "{% if install_from_nfs %}False{% else %}True{% endif %}" + +install_from_nfs: false +nfs_server_sw: nfsserver +nfs_server_sw_path: /path/to/orasw + +oracle_stage: /u01/stage +oracle_stage_remote: "{{ oracle_stage }}" +oracle_stage_install: "{% if not oracle_sw_copy and not oracle_sw_unpack %}{{ oracle_stage_remote }}{% else %}{{ oracle_stage }}{% endif %}" +oracle_base: /u01/app/oracle +oracle_rsp_stage: "{{ oracle_stage }}/rsp" +oracle_inventory_loc: /u01/app/oraInventory + +oracle_directories: + - {name: "{{ oracle_stage }}", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775} + - {name: "{{ oracle_rsp_stage }}", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775} + - {name: "{{ oracle_base }}", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775} + - {name: "{{ oracle_inventory_loc}}", owner: "{{ grid_install_user }}", group: "{{ oracle_group }}", mode: 775} + - {name: "{{ oracle_base }}/cfgtoollogs", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775} + - {name: "{{ oracle_base }}/admin", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775} + - {name: "{{ oracle_base }}/audit", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775} + - {name: "{{ oracle_base }}/cfgtoollogs/dbca", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775} + - {name: "{{ oracle_base }}/cfgtoollogs/sqlpatch", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775} + - {name: "{{ oracle_base }}/cfgtoollogs/netca", owner: "{{ oracle_user }}", group: "{{ oracle_group }}", mode: 775} + + +oracle_home_gi: "{% if configure_cluster %}{{ oracle_home_gi_cl }}{% else %}{{ oracle_home_gi_so }}{% endif %}" +oracle_home_gi_cl: "/u01/app/{{ oracle_install_version_gi }}/grid" # ORACLE_HOME for Grid Infrastructure (Clustered) +oracle_home_gi_so: "{{ oracle_base }}/{{ oracle_install_version_gi }}/grid" # ORACLE_HOME for Grid Infrastructure (Stand Alone) +oracle_env: + ORACLE_HOME: "{{ oracle_home_gi }}" + +oracle_profile_name_gi: ".profile_grid" # .profile that sets up the environment for Grid Infrastructure (Cluster or Single node) +oracle_grid_responsefile: "grid-{{ oracle_cluster_name }}.rsp" # Name of responsefile-name used when installing Grid oInfrastructure + +# GI + +# The check for the old passwords are there for backwards compatibility and only temporary, will be removed +default_gipass: "{% if oracle_password is defined %}{{ oracle_password }}{% else %}Oracle123{% endif %}" + +# The check for the old passwords are there for backwards compatibility and only temporary, will be removed +sysasmpassword: "{% if oracle_password is defined %}{{ oracle_password }}{% else %}Oracle123{% endif%}" + +# The check for the old passwords are there for backwards compatibility and only temporary, will be removed +asmmonitorpassword: "{% if oracle_password is defined %}{{ oracle_password }}{% else %}Oracle123{% endif %}" +# DB + +# The check for the old passwords are there for backwards compatibility and only temporary, will be removed +default_dbpass: "{% if item.0.oracle_db_passwd is defined %}{{ item.0.oracle_db_passwd}}{% else %}Oracle123{% endif %}" + +# oracle_password: Oracle123 # Password used for all Grid Infrastructure related resources (e.g ASM) +oracle_scan: your.scan.address # Scan address for Clustered Grid Infrastructure +oracle_vip: -vip # Suffix for the host VIP-addresses (e.g orarac01-vip) +oracle_scan_port: 1521 # Listener port for scan-listener + +# Picks the last octet from the public ip to use for cluster-interconnect ip (e.g 3.3.3.51) +oracle_ic_net: 3.3.3.{{ ansible_all_ipv4_addresses[0].split(".")[-1] }} + +oracle_asm_init_dg: crs +oracle_asm_disk_string: "{% if device_persistence == 'asmlib' %}{% elif device_persistence == 'udev' %}/dev/oracle/{% else %}{% endif %}" +device_persistence: asmlib +cvuqdisk_rpm: "{% if oracle_install_version_gi > '12.1.0.2' %}cvuqdisk-1.0.10-1.rpm{% else %}cvuqdisk-1.0.9-1.rpm{% endif %} " + +oracle_cluster_name: "{{ hostgroup }}" # Name of the cluster when setting up Clustered Grid Infrastructure +oracle_hostname: "{{ ansible_fqdn }}" # Full (FQDN) name of the host +oracle_gi_nic_pub: eth0 # Default interface for 'public' traffic. Only used in RAC +oracle_gi_nic_priv: eth1 # Default interface for interconnect traffic. Only used in RAC + +run_configtoolallcommand: true +oracle_cluster_mgmdb: true +oracle_gi_cluster_type: STANDARD # STANDARD | FLEX | STANDALONE (12.2 specific) +oracle_install_option_gi: "{% if configure_cluster %}CRS_CONFIG{% else %}HA_CONFIG{% endif %}" +oracle_install_version_gi: 12.2.0.1 +patch_before_rootsh: true +apply_patches_gi: false + +oracle_asm_storage_option: "{% if oracle_install_version_gi is version('12.2', '>=') %}FLEX_ASM_STORAGE{% else %}LOCAL_ASM_STORAGE{% endif %}" + +configure_cluster: false +oracle_gi_gns_subdomain: a.b.c +oracle_gi_gns_vip: gnsvip.a.b.c + + +opatcharchive: "{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/{% for opatchfile in oracle_opatch_patch if opatchfile['version']==oracle_install_version_gi %}{{ opatchfile['filename'] }}{% endfor %}" +# noqa yaml + +oracle_gi_image: "{%- if oracle_sw_copy %}{{ oracle_stage }} + {%- else %}{{ oracle_stage_remote }} + {%- endif %} + {%- if oracle_install_image_gi is defined %}/{{ oracle_install_image_gi }} + {%- else %}//{{ item.filename }} + {%- endif %}" + +oracle_sw_image_gi: # Files containing the installation media for Grid Infrastructure + - {filename: LINUX.X64_213000_grid_home.zip, version: 21.3.0.0, creates: 'install/.img.bin'} + - {filename: LINUX.X64_193000_grid_home.zip, version: 19.3.0.0, creates: 'install/.img.bin'} + - {filename: LINUX.X64_180000_grid_home.zip, version: 18.3.0.0, creates: 'install/.img.bin'} + - {filename: linuxx64_12201_grid_home.zip, version: 12.2.0.1, creates: 'xdk/mesg/lsxja.msb'} + - {filename: linuxamd64_12102_grid_1of2.zip, version: 12.1.0.2, creates: 'grid/stage/sizes/oracle.crs.12.1.0.2.0.sizes.properties'} + - {filename: linuxamd64_12102_grid_2of2.zip, version: 12.1.0.2, creates: 'grid/install/.oui'} + - {filename: linuxamd64_12c_grid_1of2.zip, version: 12.1.0.1} + - {filename: linuxamd64_12c_grid_2of2.zip, version: 12.1.0.1} + - {filename: p13390677_112040_Linux-x86-64_3of7.zip, version: 11.2.0.4, creates: 'grid/welcome.html'} + - {filename: p10404530_112030_Linux-x86-64_3of7.zip, version: 11.2.0.3, creates: 'grid/stage/properties/userPaths.properties'} + +# asm_diskgroups: +# - diskgroup: crs +# properties: +# - {redundancy: external, ausize: 4} +# attributes: +# - {name: 'compatible.rdbms', value: 11.2.0.4.0} +# - {name: compatible.asm, value: "{{ oracle_install_version_gi }}"} +# disk: +# - {device: /dev/sdd, asmlabel: crs01} +# - diskgroup: data +# properties: +# - {redundancy: external, ausize: 4} +# attributes: +# - {name: compatible.rdbms, value: 11.2.0.4.0} +# - {name: compatible.asm, value: "{{ oracle_install_version_gi }}"} +# disk: +# - {device: /dev/sde, asmlabel: data01} +# - diskgroup: fra +# properties: +# - {redundancy: external, ausize: 4} +# attributes: +# - {name: compatible.rdbms, value: 11.2.0.4.0} +# - {name: compatible.asm, value: "{{ oracle_install_version_gi }}"} +# disk: +# - {device: /dev/sdf, asmlabel: fra01} diff --git a/roles/oraswgi-install/tasks/11.2.0.3.yml b/roles/oraswgi-install/tasks/11.2.0.3.yml index dd9db7183..a56de02cb 100644 --- a/roles/oraswgi-install/tasks/11.2.0.3.yml +++ b/roles/oraswgi-install/tasks/11.2.0.3.yml @@ -2,12 +2,12 @@ - name: install-home-gi | Extract files to stage-area (GI) unarchive: - src={{ oracle_stage }}/{{ item.filename }} - dest={{ oracle_stage }}/{{ item.version }} - copy=no - creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}} - with_items: "{{oracle_sw_image_gi}}" - become: yes + src={{ oracle_stage }}/{{ item.filename }} + dest={{ oracle_stage }}/{{ item.version }} + copy=no + creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }} + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" tags: - oragridswunpack @@ -15,96 +15,118 @@ - name: install-home-gi | Extract files to stage-area (GI) (from remote location) unarchive: - src={{ oracle_stage_remote }}/{{ item.filename }} - dest={{ oracle_stage }}/{{ item.version }} - copy=no - creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}} - with_items: "{{oracle_sw_image_gi}}" - become: yes + src={{ oracle_stage_remote }}/{{ item.filename }} + dest={{ oracle_stage }}/{{ item.version }} + copy=no + creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }} + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" tags: - - oragridswunpack + - oragridswunpack when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy and oracle_sw_unpack - name: install-home-gi | Install cvuqdisk rpm yum: name="{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/rpm/{{ cvuqdisk_rpm }}" state=present + # noqa ignore-errors when: configure_cluster tags: cvuqdisk ignore_errors: true - name: install-home-gi | Setup response file for install (GI) - template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes - with_items: "{{asm_diskgroups}}" - run_once: "{{ configure_cluster}}" + template: + src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0600 + backup=yes + with_items: "{{ asm_diskgroups }}" + run_once: "{{ configure_cluster }}" tags: - responsefilegi when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg - name: install-home-gi | Install Grid Infrastructure shell: "{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -ignoreSysPrereqs -showProgress -silent" - become: yes + # noqa yaml command-instead-of-shell + become: true become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" + run_once: "{{ configure_cluster }}" tags: - oragridinstall - when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack + when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack register: giinstall - debug: var=giinstall.stdout_lines - run_once: "{{ configure_cluster}}" + # noqa unnamed-task + run_once: "{{ configure_cluster }}" when: oracle_home_gi not in checkgiinstall.stdout - include_role: - name: oraswgi-manage-patches + # noqa unnamed-task + name: oraswgi-manage-patches when: patch_before_rootsh and apply_patches_gi - name: install-home-gi | Run oraInstroot script after installation shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" - become: yes + # noqa command-instead-of-shell + become: true tags: - runroot when: oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run root script after installation (Master Node) shell: "{{ oracle_home_gi }}/root.sh" - become: yes - run_once: "{{ configure_cluster}}" + # noqa command-instead-of-shell + become: true + run_once: "{{ configure_cluster }}" tags: - runroot when: oracle_home_gi not in checkgiinstall.stdout register: rootmaster - debug: var=rootmaster.stdout_lines - run_once: "{{ configure_cluster}}" + # noqa unnamed-task + run_once: "{{ configure_cluster }}" when: oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run root script after installation (Other Nodes) shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" - become: yes - with_indexed_items: "{{groups[hostgroup]}}" + # noqa command-instead-of-shell + become: true + with_indexed_items: "{{ groups[hostgroup] }}" tags: - runroot - #when: oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 + # when: oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout register: rootother - debug: var=rootother.stdout_lines - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout + # noqa unnamed-task ignore-errors + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: True + ignore_errors: true - name: install-home-gi | Setup response file for configToolAllCommands - template: src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp owner="{{ grid_install_user }}" group={{ oracle_group }} mode=755 backup=yes - run_once: "{{ configure_cluster}}" + template: + src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0755 + backup=yes + run_once: "{{ configure_cluster }}" tags: - responsefileconfigtool when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run configToolAllCommands shell: "{{ oracle_home_gi }}/cfgtoollogs/configToolAllCommands RESPONSE_FILE={{ oracle_rsp_stage }}/configtoolallcommands.rsp" - become: yes + # noqa command-instead-of-shell + become: true become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" + run_once: "{{ configure_cluster }}" tags: - runconfigtool when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout diff --git a/roles/oraswgi-install/tasks/11.2.0.4.yml b/roles/oraswgi-install/tasks/11.2.0.4.yml index b49bc44af..244599a5a 100644 --- a/roles/oraswgi-install/tasks/11.2.0.4.yml +++ b/roles/oraswgi-install/tasks/11.2.0.4.yml @@ -2,12 +2,12 @@ - name: install-home-gi | Extract files to stage-area (GI) unarchive: - src={{ oracle_stage_remote }}/{{ item.filename }} - dest={{ oracle_stage }}/{{ item.version }} - copy=no - creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}} - with_items: "{{oracle_sw_image_gi}}" - become: yes + src={{ oracle_stage_remote }}/{{ item.filename }} + dest={{ oracle_stage }}/{{ item.version }} + copy=no + creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }} + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" tags: - oragridswunpack @@ -15,96 +15,118 @@ - name: install-home-gi | Extract files to stage-area (GI) (from remote location) unarchive: - src={{ oracle_stage_remote }}/{{ item.filename }} - dest={{ oracle_stage }}/{{ item.version }} - copy=no - creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}} - with_items: "{{oracle_sw_image_gi}}" - become: yes + src={{ oracle_stage_remote }}/{{ item.filename }} + dest={{ oracle_stage }}/{{ item.version }} + copy=no + creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }} + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" tags: - - oragridswunpack + - oragridswunpack when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy and oracle_sw_unpack - name: install-home-gi | Install cvuqdisk rpm + # noqa ignore-errors yum: name="{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/rpm/{{ cvuqdisk_rpm }}" state=present when: configure_cluster tags: cvuqdisk ignore_errors: true - name: install-home-gi | Setup response file for install (GI) - template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes - with_items: "{{asm_diskgroups}}" - run_once: "{{ configure_cluster}}" + template: + src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0600 + backup=yes + with_items: "{{ asm_diskgroups }}" + run_once: "{{ configure_cluster }}" tags: - responsefilegi when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg - name: install-home-gi | Install Grid Infrastructure shell: "{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -ignoreSysPrereqs -showProgress -silent" - become: yes + # noqa yaml command-instead-of-shell + become: true become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" + run_once: "{{ configure_cluster }}" tags: - oragridinstall - when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack + when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack register: giinstall - debug: var=giinstall.stdout_lines - run_once: "{{ configure_cluster}}" + # noqa unnamed-task + run_once: "{{ configure_cluster }}" when: oracle_home_gi not in checkgiinstall.stdout - include_role: - name: oraswgi-manage-patches + # noqa unnamed-task + name: oraswgi-manage-patches when: patch_before_rootsh and apply_patches_gi - name: install-home-gi | Run oraInstroot script after installation shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" - become: yes + # noqa command-instead-of-shell + become: true tags: - runroot when: oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run root script after installation (Master Node) shell: "{{ oracle_home_gi }}/root.sh" - become: yes - run_once: "{{ configure_cluster}}" + # noqa command-instead-of-shell + become: true + run_once: "{{ configure_cluster }}" tags: - runroot when: oracle_home_gi not in checkgiinstall.stdout register: rootmaster - debug: var=rootmaster.stdout_lines - run_once: "{{ configure_cluster}}" + # noqa unnamed-task + run_once: "{{ configure_cluster }}" when: oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run root script after installation (Other Nodes) shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" - become: yes - with_indexed_items: "{{groups[hostgroup]}}" + # noqa command-instead-of-shell + become: true + with_indexed_items: "{{ groups[hostgroup] }}" tags: - runroot - #when: oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 + # when: oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout register: rootother - debug: var=rootother.stdout_lines - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout + # noqa unnamed-task ignore-errors + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: True + ignore_errors: true - name: install-home-gi | Setup response file for configToolAllCommands - template: src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp owner="{{ grid_install_user }}" group={{ oracle_group }} mode=755 backup=yes - run_once: "{{ configure_cluster}}" + template: + src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0755 + backup=yes + run_once: "{{ configure_cluster }}" tags: - responsefileconfigtool when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run configToolAllCommands shell: "{{ oracle_home_gi }}/cfgtoollogs/configToolAllCommands RESPONSE_FILE={{ oracle_rsp_stage }}/configtoolallcommands.rsp" - become: yes + # noqa command-instead-of-shell + become: true become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" + run_once: "{{ configure_cluster }}" tags: - runconfigtool when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout diff --git a/roles/oraswgi-install/tasks/12.1.0.1.yml b/roles/oraswgi-install/tasks/12.1.0.1.yml index bca93a79c..679cd726e 100644 --- a/roles/oraswgi-install/tasks/12.1.0.1.yml +++ b/roles/oraswgi-install/tasks/12.1.0.1.yml @@ -2,8 +2,8 @@ - name: install-home-gi | Extract files to stage-area (GI) unarchive: src={{ oracle_stage }}/{{ item.filename }} dest={{ oracle_stage }}/{{ item.version }} copy=no - with_items: "{{oracle_sw_image_gi}}" - become: yes + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" tags: - oragridswunpack @@ -11,92 +11,114 @@ - name: install-home-gi | Extract files to stage-area (GI) (from remote location) unarchive: src={{ oracle_stage_remote }}/{{ item.filename }} dest={{ oracle_stage }}/{{ item.version }} copy=no - with_items: "{{oracle_sw_image_gi}}" - become: yes + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" tags: - - oragridswunpack + - oragridswunpack when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy and oracle_sw_unpack - name: install-home-gi | Install cvuqdisk rpm + # noqa ignore-errors yum: name="{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/rpm/{{ cvuqdisk_rpm }}" state=present when: configure_cluster tags: cvuqdisk ignore_errors: true - name: install-home-gi | Setup response file for install (GI) - template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes - with_items: "{{asm_diskgroups}}" - run_once: "{{ configure_cluster}}" + template: + src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0600 + backup=yes + with_items: "{{ asm_diskgroups }}" + run_once: "{{ configure_cluster }}" tags: - responsefilegi when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg - name: install-home-gi | Install Grid Infrastructure shell: "{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -ignoreSysPrereqs -showProgress -silent" - become: yes + # noqa yaml command-instead-of-shell + become: true become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" + run_once: "{{ configure_cluster }}" tags: - oragridinstall - when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack + when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack register: giinstall - debug: var=giinstall.stdout_lines - run_once: "{{ configure_cluster}}" + # noqa unnamed-task + run_once: "{{ configure_cluster }}" when: oracle_home_gi not in checkgiinstall.stdout - include_role: - name: oraswgi-manage-patches + # noqa unnamed-task + name: oraswgi-manage-patches when: patch_before_rootsh and apply_patches_gi - name: install-home-gi | Run oraInstroot script after installation shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" - become: yes + # noqa command-instead-of-shell + become: true tags: - runroot when: oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run root script after installation (Master Node) shell: "{{ oracle_home_gi }}/root.sh" - become: yes - run_once: "{{ configure_cluster}}" + # noqa command-instead-of-shell + become: true + run_once: "{{ configure_cluster }}" tags: - runroot when: oracle_home_gi not in checkgiinstall.stdout register: rootmaster - debug: var=rootmaster.stdout_lines - run_once: "{{ configure_cluster}}" + # noqa unnamed-task + run_once: "{{ configure_cluster }}" when: oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run root script after installation (Other Nodes) shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" - become: yes - with_indexed_items: "{{groups[hostgroup]}}" + # noqa command-instead-of-shell + become: true + with_indexed_items: "{{ groups[hostgroup] }}" tags: - runroot - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout register: rootother - debug: var=rootother.stdout_lines - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout + # noqa unnamed-task ignore-errors + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: True + ignore_errors: true - name: install-home-gi | Setup response file for configToolAllCommands - template: src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp owner="{{ grid_install_user }}" group={{ oracle_group }} mode=755 backup=yes + template: + src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0755 + backup=yes tags: - responsefileconfigtool - run_once: "{{ configure_cluster}}" + run_once: "{{ configure_cluster }}" when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run configToolAllCommands shell: "{{ oracle_home_gi }}/cfgtoollogs/configToolAllCommands RESPONSE_FILE={{ oracle_rsp_stage }}/configtoolallcommands.rsp" - become: yes + # noqa command-instead-of-shell + become: true become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" + run_once: "{{ configure_cluster }}" tags: - runconfigtool when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout diff --git a/roles/oraswgi-install/tasks/12.1.0.2.yml b/roles/oraswgi-install/tasks/12.1.0.2.yml index 30cf5a71a..ba8bb0626 100644 --- a/roles/oraswgi-install/tasks/12.1.0.2.yml +++ b/roles/oraswgi-install/tasks/12.1.0.2.yml @@ -2,12 +2,12 @@ - name: install-home-gi | Extract files to stage-area (GI) unarchive: - src={{ oracle_stage_remote }}/{{ item.filename }} - dest={{ oracle_stage }}/{{ item.version }} - copy=no - creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}} - with_items: "{{oracle_sw_image_gi}}" - become: yes + src={{ oracle_stage_remote }}/{{ item.filename }} + dest={{ oracle_stage }}/{{ item.version }} + copy=no + creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }} + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" tags: - oragridswunpack @@ -15,15 +15,15 @@ - name: install-home-gi | Extract files to stage-area (GI) (from remote location) unarchive: - src={{ oracle_stage_remote }}/{{ item.filename }} - dest={{ oracle_stage }}/{{ item.version }} - copy=no - creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}} - with_items: "{{oracle_sw_image_gi}}" - become: yes + src={{ oracle_stage_remote }}/{{ item.filename }} + dest={{ oracle_stage }}/{{ item.version }} + copy=no + creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }} + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" tags: - - oragridswunpack + - oragridswunpack when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy and oracle_sw_unpack - name: install-home-gi | Install cvuqdisk rpm @@ -33,79 +33,101 @@ ignore_errors: true - name: install-home-gi | Setup response file for install (GI) - template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes - with_items: "{{asm_diskgroups}}" - run_once: "{{ configure_cluster}}" + template: + src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0600 + backup=yes + with_items: "{{ asm_diskgroups }}" + run_once: "{{ configure_cluster }}" tags: - responsefilegi when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg - name: install-home-gi | Install Grid Infrastructure shell: "{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -ignoreSysPrereqs -showProgress -silent" - become: yes + # noqa command-instead-of-shell + become: true become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" + run_once: "{{ configure_cluster }}" tags: - oragridinstall - when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack + when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack register: giinstall - debug: var=giinstall.stdout_lines - run_once: "{{ configure_cluster}}" + # noqa unnamed-task + run_once: "{{ configure_cluster }}" when: oracle_home_gi not in checkgiinstall.stdout - include_role: - name: oraswgi-manage-patches + # noqa unnamed-task + name: oraswgi-manage-patches when: patch_before_rootsh and apply_patches_gi - stat: path="{{ oracle_inventory_loc }}/orainstRoot.sh" + # noqa unnamed-task register: orainstroot - name: install-home-gi | Run oraInstroot script after installation shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" - become: yes + # noqa command-instead-of-shell + become: true tags: - runroot when: oracle_home_gi not in checkgiinstall.stdout and orainstroot.stat.exists - name: install-home-gi | Run root script after installation (Master Node) shell: "{{ oracle_home_gi }}/root.sh" - become: yes - run_once: "{{ configure_cluster}}" + # noqa command-instead-of-shell + become: true + run_once: "{{ configure_cluster }}" tags: - runroot when: oracle_home_gi not in checkgiinstall.stdout register: rootmaster - debug: var=rootmaster.stdout_lines - run_once: "{{ configure_cluster}}" + # noqa unnamed-task + run_once: "{{ configure_cluster }}" when: oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run root script after installation (Other Nodes) shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" - become: yes - with_indexed_items: "{{groups[hostgroup]}}" + # noqa command-instead-of-shell + become: true + with_indexed_items: "{{ groups[hostgroup] }}" tags: - runroot when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout register: rootother - debug: var=rootother.stdout_lines + # noqa unnamed-task ignore-errors when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: True + ignore_errors: true - name: install-home-gi | Setup response file for configToolAllCommands - template: src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp owner="{{ grid_install_user }}" group={{ oracle_group }} mode=755 backup=yes - run_once: "{{ configure_cluster}}" + template: + src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0755 + backup=yes + run_once: "{{ configure_cluster }}" tags: - responsefileconfigtool when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout - name: install-home-gi | Run configToolAllCommands shell: "{{ oracle_home_gi }}/cfgtoollogs/configToolAllCommands RESPONSE_FILE={{ oracle_rsp_stage }}/configtoolallcommands.rsp" - become: yes + # noqa command-instead-of-shell + become: true become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" + run_once: "{{ configure_cluster }}" tags: - runconfigtool when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout diff --git a/roles/oraswgi-install/tasks/12.2.0.1.yml b/roles/oraswgi-install/tasks/12.2.0.1.yml index 51bbb283c..57d11bef2 100644 --- a/roles/oraswgi-install/tasks/12.2.0.1.yml +++ b/roles/oraswgi-install/tasks/12.2.0.1.yml @@ -1,150 +1,168 @@ --- - - name: install-home-gi | Extract files to ORACLE_HOME (gi) - unarchive: src={{ oracle_stage }}/{{ item.filename }} dest={{ oracle_home_gi }} copy=no - with_items: "{{oracle_sw_image_gi}}" - args: - creates: "{{ oracle_home_gi }}/root.sh" - become: yes - become_user: "{{ grid_install_user }}" - tags: - - oragridswunpack - when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and oracle_sw_copy and oracle_sw_unpack - - - name: install-home-gi | Extract files to ORACLE_HOME (gi) (from remote location) - unarchive: src={{ oracle_stage_remote }}/{{ item.filename }} dest={{ oracle_home_gi }} copy=no - with_items: "{{oracle_sw_image_gi}}" - args: - creates: "{{ oracle_home_gi }}/root.sh" - become: yes - become_user: "{{ grid_install_user }}" - tags: +- name: install-home-gi | Extract files to ORACLE_HOME (gi) + unarchive: + src={{ oracle_stage }}/{{ item.filename }} + dest={{ oracle_home_gi }} + copy=no + with_items: "{{ oracle_sw_image_gi }}" + args: + creates: "{{ oracle_home_gi }}/root.sh" + become: true + become_user: "{{ grid_install_user }}" + tags: - oragridswunpack - when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy - - # Check for an existing GRID_HOME before reinstallation of OPatch - - name: install-home-gi | Check for file GridSetup.sh - no_log: true - stat: path={{ oracle_home_gi }}/gridSetup.sh - register: stat_gridsetup_result - run_once: "{{ configure_cluster}}" - #when: master_node - - - name: install-home-gi | State of GridSetup.sh - assert: - that: "stat_gridsetup_result.stat.exists == True" - msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" - run_once: "{{ configure_cluster}}" - #when: master_node - # unarchive didn't worked in some environments. => using unzip directly - # Overwrite existing files from OPatch due to Note 2321749.1 - # - name: install-home-gi | Distribute latest opatch - # shell: unzip -o -d {{oracle_home_gi}} {{opatcharchive}} - # become: yes - # become_user: "{{ grid_install_user }}" - # when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Install cvuqdisk rpm - yum: name="{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" state=present - when: configure_cluster - tags: cvuqdisk - ignore_errors: true - - - name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes - file: name={{ oracle_home_gi }} state=absent - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes - file: name={{ oracle_home_gi }} mode=775 owner={{ oracle_user }} group={{ oracle_group }} state=directory - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Setup response file for install (GI) - template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes - with_items: "{{asm_diskgroups}}" - run_once: "{{ configure_cluster}}" - tags: - - responsefilegi - when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg - - # returncode of gridSetup.sh is always <> 0 => forced exit 0 - # - name: install-home-gi | Apply Release Update on ORACLE_HOME - # shell: "{{oracle_home_gi}}/gridSetup.sh -silent -applyPSU {{ oracle_stage_remote }}/{{ oracle_install_version_gi }}/{{item.patchid}} -waitforcompletion ; exit 0" - # become: yes - # become_user: "{{ grid_install_user }}" - # with_items: - # - "{{ oracle_sw_patches }}" - # register: command_result - # failed_when: "'Successfully applied the patch.' not in command_result.stdout_lines" - # when: oracle_sw_patches is defined and oracle_install_version_gi == item.version and oracle_home_gi not in checkgiinstall.stdout - # - # - debug: msg="Ignore the failure [FATAL] [INS-40426] in output from gridSetup.sh -applyPSU" - # when: command_result is defined and oracle_sw_patches is defined - # - # - debug: msg={{item.stdout_lines}} - # with_items: - # - "{{command_result.results}}" - # when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Install Grid Infrastructure - shell: "{{ oracle_home_gi }}/gridSetup.sh -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -silent" - become: yes - become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" - tags: - - oragridinstall - when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack - register: giinstall - - - debug: var=giinstall.stdout_lines - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout - - - include_role: - name: oraswgi-manage-patches - when: patch_before_rootsh and apply_patches_gi - - - name: install-home-gi | Run oraInstroot script after installation - shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" - become: yes - tags: - - runroot - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Run root script after installation (Master Node) - shell: "{{ oracle_home_gi }}/root.sh" - become: yes - run_once: "{{ configure_cluster}}" - tags: - - runroot - when: oracle_home_gi not in checkgiinstall.stdout - register: rootmaster - - - debug: var=rootmaster.stdout_lines - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Run root script after installation (Other Nodes) - shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" - become: yes - with_indexed_items: "{{groups[hostgroup]}}" - tags: - - runroot - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 - when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout - register: rootother - - - debug: var=rootother.stdout_lines - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: True - - - name: install-home-gi | Execute ConfigTools - shell: "{{ oracle_home_gi }}/gridSetup.sh -executeConfigTools -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -silent" - become: yes - become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" - tags: - - runconfigtool - when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: true - register: configtool + when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and oracle_sw_copy and oracle_sw_unpack + +- name: install-home-gi | Extract files to ORACLE_HOME (gi) (from remote location) + unarchive: src={{ oracle_stage_remote }}/{{ item.filename }} dest={{ oracle_home_gi }} copy=no + with_items: "{{ oracle_sw_image_gi }}" + args: + creates: "{{ oracle_home_gi }}/root.sh" + become: true + become_user: "{{ grid_install_user }}" + tags: + - oragridswunpack + when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy + +# Check for an existing GRID_HOME before reinstallation of OPatch +- name: install-home-gi | Check for file GridSetup.sh + no_log: true + stat: path={{ oracle_home_gi }}/gridSetup.sh + register: stat_gridsetup_result + run_once: "{{ configure_cluster }}" + # when: master_node + +- name: install-home-gi | State of GridSetup.sh + assert: + that: "stat_gridsetup_result.stat.exists == True" + msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" + run_once: "{{ configure_cluster }}" + # when: master_node +# unarchive didn't worked in some environments. => using unzip directly +# Overwrite existing files from OPatch due to Note 2321749.1 +# - name: install-home-gi | Distribute latest opatch +# shell: unzip -o -d {{oracle_home_gi}} {{opatcharchive}} +# become: true +# become_user: "{{ grid_install_user }}" +# when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Install cvuqdisk rpm + yum: name="{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" state=present + when: configure_cluster + tags: cvuqdisk + ignore_errors: true + +- name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes + file: name={{ oracle_home_gi }} state=absent + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes + file: name={{ oracle_home_gi }} mode=775 owner={{ oracle_user }} group={{ oracle_group }} state=directory + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Setup response file for install (GI) + template: + src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0600 + backup=yes + with_items: "{{ asm_diskgroups }}" + run_once: "{{ configure_cluster }}" + tags: + - responsefilegi + when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg + +# returncode of gridSetup.sh is always <> 0 => forced exit 0 +# - name: install-home-gi | Apply Release Update on ORACLE_HOME +# shell: "{{oracle_home_gi}}/gridSetup.sh -silent -applyPSU {{ oracle_stage_remote }}/{{ oracle_install_version_gi }}/{{item.patchid}} -waitforcompletion ; exit 0" +# become: true +# become_user: "{{ grid_install_user }}" +# with_items: +# - "{{ oracle_sw_patches }}" +# register: command_result +# failed_when: "'Successfully applied the patch.' not in command_result.stdout_lines" +# when: oracle_sw_patches is defined and oracle_install_version_gi == item.version and oracle_home_gi not in checkgiinstall.stdout +# +# - debug: msg="Ignore the failure [FATAL] [INS-40426] in output from gridSetup.sh -applyPSU" +# when: command_result is defined and oracle_sw_patches is defined +# +# - debug: msg={{item.stdout_lines}} +# with_items: +# - "{{command_result.results}}" +# when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Install Grid Infrastructure + shell: "{{ oracle_home_gi }}/gridSetup.sh -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -silent" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + run_once: "{{ configure_cluster }}" + tags: + - oragridinstall + when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack + register: giinstall + +- debug: var=giinstall.stdout_lines + # noqa unnamed-task + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout + +- include_role: + # noqa unnamed-task + name: oraswgi-manage-patches + when: patch_before_rootsh and apply_patches_gi + +- name: install-home-gi | Run oraInstroot script after installation + shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" + # noqa command-instead-of-shell + become: true + tags: + - runroot + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Run root script after installation (Master Node) + shell: "{{ oracle_home_gi }}/root.sh" + # noqa command-instead-of-shell + become: true + run_once: "{{ configure_cluster }}" + tags: + - runroot + when: oracle_home_gi not in checkgiinstall.stdout + register: rootmaster + +- debug: var=rootmaster.stdout_lines + # noqa unnamed-task + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Run root script after installation (Other Nodes) + shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" + # noqa command-instead-of-shell + become: true + with_indexed_items: "{{ groups[hostgroup] }}" + tags: + - runroot + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 + when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout + register: rootother + +- debug: var=rootother.stdout_lines + # noqa unnamed-task ignore-errors + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + ignore_errors: true + +- name: install-home-gi | Execute ConfigTools + shell: "{{ oracle_home_gi }}/gridSetup.sh -executeConfigTools -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -silent" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + run_once: "{{ configure_cluster }}" + tags: + - runconfigtool + when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout + ignore_errors: true + register: configtool diff --git a/roles/oraswgi-install/tasks/18.3.0.0.yml b/roles/oraswgi-install/tasks/18.3.0.0.yml index b73fc9fa7..fbb2c79fd 100644 --- a/roles/oraswgi-install/tasks/18.3.0.0.yml +++ b/roles/oraswgi-install/tasks/18.3.0.0.yml @@ -1,151 +1,166 @@ --- - - name: install-home-gi | Extract files to ORACLE_HOME (gi) - unarchive: src={{ oracle_stage }}/{{ item.filename }} dest={{ oracle_home_gi }} copy=no - with_items: "{{oracle_sw_image_gi}}" - args: - creates: "{{ oracle_home_gi }}/root.sh" - become: yes - become_user: "{{ grid_install_user }}" - tags: - - oragridswunpack - when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and oracle_sw_copy and oracle_sw_unpack - - - name: install-home-gi | Extract files to ORACLE_HOME (gi) (from remote location) - unarchive: src={{ oracle_stage_remote }}/{{ item.filename }} dest={{ oracle_home_gi }} copy=no - with_items: "{{oracle_sw_image_gi}}" - args: - creates: "{{ oracle_home_gi }}/root.sh" - become: yes - become_user: "{{ grid_install_user }}" - tags: +- name: install-home-gi | Extract files to ORACLE_HOME (gi) + unarchive: src={{ oracle_stage }}/{{ item.filename }} dest={{ oracle_home_gi }} copy=no + with_items: "{{ oracle_sw_image_gi }}" + args: + creates: "{{ oracle_home_gi }}/root.sh" + become: true + become_user: "{{ grid_install_user }}" + tags: - oragridswunpack - when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy - - # Check for an existing GRID_HOME before reinstallation of OPatch - - name: install-home-gi | Check for file GridSetup.sh - no_log: true - stat: path={{ oracle_home_gi }}/gridSetup.sh - register: stat_gridsetup_result - run_once: "{{ configure_cluster}}" - #when: master_node - - - name: install-home-gi | State of GridSetup.sh - assert: - that: "stat_gridsetup_result.stat.exists == True" - msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" - run_once: "{{ configure_cluster}}" - #when: master_node - # unarchive didn't worked in some environments. => using unzip directly - # Overwrite existing files from OPatch due to Note 2321749.1 - # - name: install-home-gi | Distribute latest opatch - # shell: unzip -o -d {{oracle_home_gi}} {{opatcharchive}} - # become: yes - # become_user: "{{ grid_install_user }}" - # when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Install cvuqdisk rpm - yum: name="{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" state=present - when: configure_cluster - tags: cvuqdisk - ignore_errors: true - - - name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes - file: name={{ oracle_home_gi }} state=absent - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes - file: name={{ oracle_home_gi }} mode=775 owner={{ oracle_user }} group={{ oracle_group }} state=directory - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Setup response file for install (GI) - template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes - with_items: "{{asm_diskgroups}}" - run_once: "{{ configure_cluster}}" - tags: - - responsefilegi - when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg - - # returncode of gridSetup.sh is always <> 0 => forced exit 0 - # - name: install-home-gi | Apply Release Update on ORACLE_HOME - # shell: "{{oracle_home_gi}}/gridSetup.sh -silent -applyPSU {{ oracle_stage_remote }}/{{ oracle_install_version_gi }}/{{item.patchid}} -waitforcompletion ; exit 0" - # become: yes - # become_user: "{{ grid_install_user }}" - # with_items: - # - "{{ oracle_sw_patches }}" - # register: command_result - # failed_when: "'Successfully applied the patch.' not in command_result.stdout_lines" - # when: oracle_sw_patches is defined and oracle_install_version_gi == item.version and oracle_home_gi not in checkgiinstall.stdout - # - # - debug: msg="Ignore the failure [FATAL] [INS-40426] in output from gridSetup.sh -applyPSU" - # when: command_result is defined and oracle_sw_patches is defined - # - # - debug: msg={{item.stdout_lines}} - # with_items: - # - "{{command_result.results}}" - # when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Install Grid Infrastructure - shell: "{{ oracle_home_gi }}/gridSetup.sh -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -silent" - become: yes - become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" - tags: - - oragridinstall - when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack - register: giinstall - failed_when: giinstall.rc not in [0,6] - - - debug: var=giinstall.stdout_lines - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout and giinstall.changed - - - include_role: - name: oraswgi-manage-patches - when: patch_before_rootsh and apply_patches_gi - - - name: install-home-gi | Run oraInstroot script after installation - shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" - become: yes - tags: - - runroot - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Run root script after installation (Master Node) - shell: "{{ oracle_home_gi }}/root.sh" - become: yes - run_once: "{{ configure_cluster}}" - tags: - - runroot - when: oracle_home_gi not in checkgiinstall.stdout - register: rootmaster - - - debug: var=rootmaster.stdout_lines - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Run root script after installation (Other Nodes) - shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" - become: yes - with_indexed_items: "{{groups[hostgroup]}}" - tags: - - runroot - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 - when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout - register: rootother - - - debug: var=rootother.stdout_lines - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: True - - - name: install-home-gi | Execute ConfigTools - shell: "{{ oracle_home_gi }}/gridSetup.sh -executeConfigTools -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -silent" - become: yes - become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" - tags: - - runconfigtool - when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: true - register: configtool + when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and oracle_sw_copy and oracle_sw_unpack + +- name: install-home-gi | Extract files to ORACLE_HOME (gi) (from remote location) + unarchive: src={{ oracle_stage_remote }}/{{ item.filename }} dest={{ oracle_home_gi }} copy=no + with_items: "{{ oracle_sw_image_gi }}" + args: + creates: "{{ oracle_home_gi }}/root.sh" + become: true + become_user: "{{ grid_install_user }}" + tags: + - oragridswunpack + when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy + +# Check for an existing GRID_HOME before reinstallation of OPatch +- name: install-home-gi | Check for file GridSetup.sh + no_log: true + stat: path={{ oracle_home_gi }}/gridSetup.sh + register: stat_gridsetup_result + run_once: "{{ configure_cluster }}" + # when: master_node + +- name: install-home-gi | State of GridSetup.sh + assert: + that: "stat_gridsetup_result.stat.exists == True" + msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" + run_once: "{{ configure_cluster }}" + # when: master_node +# unarchive didn't worked in some environments. => using unzip directly +# Overwrite existing files from OPatch due to Note 2321749.1 +# - name: install-home-gi | Distribute latest opatch +# shell: unzip -o -d {{oracle_home_gi}} {{opatcharchive}} +# become: true +# become_user: "{{ grid_install_user }}" +# when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Install cvuqdisk rpm + yum: name="{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" state=present + when: configure_cluster + tags: cvuqdisk + ignore_errors: true + +- name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes + file: name={{ oracle_home_gi }} state=absent + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes + file: name={{ oracle_home_gi }} mode=775 owner={{ oracle_user }} group={{ oracle_group }} state=directory + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Setup response file for install (GI) + template: + src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0600 + backup=yes + with_items: "{{ asm_diskgroups }}" + run_once: "{{ configure_cluster }}" + tags: + - responsefilegi + when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg + +# returncode of gridSetup.sh is always <> 0 => forced exit 0 +# - name: install-home-gi | Apply Release Update on ORACLE_HOME +# shell: "{{oracle_home_gi}}/gridSetup.sh -silent -applyPSU {{ oracle_stage_remote }}/{{ oracle_install_version_gi }}/{{item.patchid}} -waitforcompletion ; exit 0" +# become: true +# become_user: "{{ grid_install_user }}" +# with_items: +# - "{{ oracle_sw_patches }}" +# register: command_result +# failed_when: "'Successfully applied the patch.' not in command_result.stdout_lines" +# when: oracle_sw_patches is defined and oracle_install_version_gi == item.version and oracle_home_gi not in checkgiinstall.stdout +# +# - debug: msg="Ignore the failure [FATAL] [INS-40426] in output from gridSetup.sh -applyPSU" +# when: command_result is defined and oracle_sw_patches is defined +# +# - debug: msg={{item.stdout_lines}} +# with_items: +# - "{{command_result.results}}" +# when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Install Grid Infrastructure + shell: "{{ oracle_home_gi }}/gridSetup.sh -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -silent" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + run_once: "{{ configure_cluster }}" + tags: + - oragridinstall + when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack + register: giinstall + failed_when: giinstall.rc not in [0,6] + +- debug: var=giinstall.stdout_lines + # noqa unnamed-task + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout and giinstall.changed + +- include_role: + # noqa unnamed-task + name: oraswgi-manage-patches + when: patch_before_rootsh and apply_patches_gi + +- name: install-home-gi | Run oraInstroot script after installation + shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" + # noqa command-instead-of-shell + become: true + tags: + - runroot + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Run root script after installation (Master Node) + shell: "{{ oracle_home_gi }}/root.sh" + # noqa command-instead-of-shell + become: true + run_once: "{{ configure_cluster }}" + tags: + - runroot + when: oracle_home_gi not in checkgiinstall.stdout + register: rootmaster + +- debug: var=rootmaster.stdout_lines + # noqa unnamed-task + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Run root script after installation (Other Nodes) + shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" + # noqa command-instead-of-shell + become: true + with_indexed_items: "{{ groups[hostgroup] }}" + tags: + - runroot + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 + when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout + register: rootother + +- debug: var=rootother.stdout_lines + # noqa unnamed-task ignore-errors + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + ignore_errors: true + +- name: install-home-gi | Execute ConfigTools + shell: "{{ oracle_home_gi }}/gridSetup.sh -executeConfigTools -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -silent" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + run_once: "{{ configure_cluster }}" + tags: + - runconfigtool + when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout + ignore_errors: true + register: configtool diff --git a/roles/oraswgi-install/tasks/19.3.0.0.yml b/roles/oraswgi-install/tasks/19.3.0.0.yml index b2c041177..fb8c0b4c7 100644 --- a/roles/oraswgi-install/tasks/19.3.0.0.yml +++ b/roles/oraswgi-install/tasks/19.3.0.0.yml @@ -1,144 +1,159 @@ --- - - name: install-home-gi | Extract files to ORACLE_HOME (gi) - unarchive: src={{ oracle_gi_image }} dest={{ oracle_home_gi }} copy=no - with_items: "{{oracle_sw_image_gi}}" - loop_control: - label: "{{ oracle_gi_image | default ('') }}" - args: - creates: "{{ oracle_home_gi }}/root.sh" - become: yes - become_user: "{{ grid_install_user }}" - tags: - - oragridswunpack - when: - - oracle_home_gi not in checkgiinstall.stdout - - oracle_install_version_gi == item.version - - # Check for an existing GRID_HOME before reinstallation of OPatch - - name: install-home-gi | Check for file GridSetup.sh - no_log: true - stat: path={{ oracle_home_gi }}/gridSetup.sh - register: stat_gridsetup_result - run_once: "{{ configure_cluster}}" - #when: master_node - - - name: install-home-gi | State of GridSetup.sh - assert: - that: "stat_gridsetup_result.stat.exists == True" - msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" - run_once: "{{ configure_cluster}}" - #when: master_node - # unarchive didn't worked in some environments. => using unzip directly - # Overwrite existing files from OPatch due to Note 2321749.1 - # - name: install-home-gi | Distribute latest opatch - # shell: unzip -o -d {{oracle_home_gi}} {{opatcharchive}} - # become: yes - # become_user: "{{ grid_install_user }}" - # when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Install cvuqdisk rpm - yum: name="{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" state=present - when: configure_cluster - tags: cvuqdisk - ignore_errors: true - - - name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes - file: name={{ oracle_home_gi }} state=absent - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes - file: name={{ oracle_home_gi }} mode=775 owner={{ oracle_user }} group={{ oracle_group }} state=directory - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Setup response file for install (GI) - template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes - with_items: "{{asm_diskgroups}}" - run_once: "{{ configure_cluster}}" - tags: - - responsefilegi - when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg - - # returncode of gridSetup.sh is always <> 0 => forced exit 0 - # - name: install-home-gi | Apply Release Update on ORACLE_HOME - # shell: "{{oracle_home_gi}}/gridSetup.sh -silent -applyPSU {{ oracle_stage_remote }}/{{ oracle_install_version_gi }}/{{item.patchid}} -waitforcompletion ; exit 0" - # become: yes - # become_user: "{{ grid_install_user }}" - # with_items: - # - "{{ oracle_sw_patches }}" - # register: command_result - # failed_when: "'Successfully applied the patch.' not in command_result.stdout_lines" - # when: oracle_sw_patches is defined and oracle_install_version_gi == item.version and oracle_home_gi not in checkgiinstall.stdout - # - # - debug: msg="Ignore the failure [FATAL] [INS-40426] in output from gridSetup.sh -applyPSU" - # when: command_result is defined and oracle_sw_patches is defined - # - # - debug: msg={{item.stdout_lines}} - # with_items: - # - "{{command_result.results}}" - # when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Install Grid Infrastructure - shell: "{{ oracle_home_gi }}/gridSetup.sh -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -silent" - become: yes - become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" - tags: - - oragridinstall - when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack - register: giinstall - failed_when: giinstall.rc not in [0,6] - - - debug: var=giinstall.stdout_lines - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout and giinstall.changed - - - include_role: - name: oraswgi-manage-patches - when: patch_before_rootsh and apply_patches_gi - - - name: install-home-gi | Run oraInstroot script after installation - shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" - become: yes - tags: - - runroot - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Run root script after installation (Master Node) - shell: "{{ oracle_home_gi }}/root.sh" - become: yes - run_once: "{{ configure_cluster}}" - tags: - - runroot - when: oracle_home_gi not in checkgiinstall.stdout - register: rootmaster - - - debug: var=rootmaster.stdout_lines - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Run root script after installation (Other Nodes) - shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" - become: yes - with_indexed_items: "{{groups[hostgroup]}}" - tags: - - runroot - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 - when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout - register: rootother - - - debug: var=rootother.stdout_lines - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: True - - - name: install-home-gi | Execute ConfigTools - shell: "{{ oracle_home_gi }}/gridSetup.sh -executeConfigTools -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -silent" - become: yes - become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" - tags: - - runconfigtool - when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: true - register: configtool +- name: install-home-gi | Extract files to ORACLE_HOME (gi) + unarchive: src={{ oracle_gi_image }} dest={{ oracle_home_gi }} copy=no + with_items: "{{ oracle_sw_image_gi }}" + loop_control: + label: "{{ oracle_gi_image | default ('') }}" + args: + creates: "{{ oracle_home_gi }}/root.sh" + become: true + become_user: "{{ grid_install_user }}" + tags: + - oragridswunpack + when: + - oracle_home_gi not in checkgiinstall.stdout + - oracle_install_version_gi == item.version + +# Check for an existing GRID_HOME before reinstallation of OPatch +- name: install-home-gi | Check for file GridSetup.sh + no_log: true + stat: path={{ oracle_home_gi }}/gridSetup.sh + register: stat_gridsetup_result + run_once: "{{ configure_cluster }}" + # when: master_node + +- name: install-home-gi | State of GridSetup.sh + assert: + that: "stat_gridsetup_result.stat.exists == True" + msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" + run_once: "{{ configure_cluster }}" + # when: master_node +# unarchive didn't worked in some environments. => using unzip directly +# Overwrite existing files from OPatch due to Note 2321749.1 +# - name: install-home-gi | Distribute latest opatch +# shell: unzip -o -d {{oracle_home_gi}} {{opatcharchive}} +# become: true +# become_user: "{{ grid_install_user }}" +# when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Install cvuqdisk rpm + yum: name="{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" state=present + when: configure_cluster + tags: cvuqdisk + ignore_errors: true + +- name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes + file: name={{ oracle_home_gi }} state=absent + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes + file: name={{ oracle_home_gi }} mode=775 owner={{ oracle_user }} group={{ oracle_group }} state=directory + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Setup response file for install (GI) + template: + src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0600 + backup=yes + with_items: "{{ asm_diskgroups }}" + run_once: "{{ configure_cluster }}" + tags: + - responsefilegi + when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg + +# returncode of gridSetup.sh is always <> 0 => forced exit 0 +# - name: install-home-gi | Apply Release Update on ORACLE_HOME +# shell: "{{oracle_home_gi}}/gridSetup.sh -silent -applyPSU {{ oracle_stage_remote }}/{{ oracle_install_version_gi }}/{{item.patchid}} -waitforcompletion ; exit 0" +# become: true +# become_user: "{{ grid_install_user }}" +# with_items: +# - "{{ oracle_sw_patches }}" +# register: command_result +# failed_when: "'Successfully applied the patch.' not in command_result.stdout_lines" +# when: oracle_sw_patches is defined and oracle_install_version_gi == item.version and oracle_home_gi not in checkgiinstall.stdout +# +# - debug: msg="Ignore the failure [FATAL] [INS-40426] in output from gridSetup.sh -applyPSU" +# when: command_result is defined and oracle_sw_patches is defined +# +# - debug: msg={{item.stdout_lines}} +# with_items: +# - "{{command_result.results}}" +# when: oracle_sw_patches is defined and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Install Grid Infrastructure + shell: "{{ oracle_home_gi }}/gridSetup.sh -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -silent" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + run_once: "{{ configure_cluster }}" + tags: + - oragridinstall + when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack + register: giinstall + failed_when: giinstall.rc not in [0,6] + +- debug: var=giinstall.stdout_lines + # noqa unnamed-task + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout and giinstall.changed + +- include_role: + # noqa unnamed-task + name: oraswgi-manage-patches + when: patch_before_rootsh and apply_patches_gi + +- name: install-home-gi | Run oraInstroot script after installation + shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" + # noqa command-instead-of-shell + become: true + tags: + - runroot + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Run root script after installation (Master Node) + shell: "{{ oracle_home_gi }}/root.sh" + # noqa command-instead-of-shell + become: true + run_once: "{{ configure_cluster }}" + tags: + - runroot + when: oracle_home_gi not in checkgiinstall.stdout + register: rootmaster + +- debug: var=rootmaster.stdout_lines + # noqa unnamed-task + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Run root script after installation (Other Nodes) + shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" + # noqa command-instead-of-shell + become: true + with_indexed_items: "{{ groups[hostgroup] }}" + tags: + - runroot + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 + when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout + register: rootother + +- debug: var=rootother.stdout_lines + # noqa unnamed-task ignore-errors + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + ignore_errors: true + +- name: install-home-gi | Execute ConfigTools + shell: "{{ oracle_home_gi }}/gridSetup.sh -executeConfigTools -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -silent" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + run_once: "{{ configure_cluster }}" + tags: + - runconfigtool + when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout + ignore_errors: true + register: configtool diff --git a/roles/oraswgi-install/tasks/21.3.0.0.yml b/roles/oraswgi-install/tasks/21.3.0.0.yml index ecdf6ccbc..2e36f50b9 100644 --- a/roles/oraswgi-install/tasks/21.3.0.0.yml +++ b/roles/oraswgi-install/tasks/21.3.0.0.yml @@ -1,117 +1,133 @@ --- - - name: install-home-gi | Extract files to ORACLE_HOME (gi) - unarchive: src={{ oracle_gi_image }} dest={{ oracle_home_gi }} copy=no - with_items: "{{oracle_sw_image_gi}}" - loop_control: - label: "{{ oracle_gi_image | default ('') }}" - args: - creates: "{{ oracle_home_gi }}/root.sh" - become: yes - become_user: "{{ grid_install_user }}" - tags: - - oragridswunpack - when: - - oracle_home_gi not in checkgiinstall.stdout - - oracle_install_version_gi == item.version - - # Check for an existing GRID_HOME before reinstallation of OPatch - - name: install-home-gi | Check for file GridSetup.sh - no_log: true - stat: path={{ oracle_home_gi }}/gridSetup.sh - register: stat_gridsetup_result - run_once: "{{ configure_cluster}}" - #when: master_node - - - name: install-home-gi | State of GridSetup.sh - assert: - that: "stat_gridsetup_result.stat.exists == True" - msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" - run_once: "{{ configure_cluster}}" - #when: master_node - - - name: install-home-gi | Install cvuqdisk rpm - yum: name="{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" state=present - when: configure_cluster - tags: cvuqdisk - ignore_errors: true - - - name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes - file: name={{ oracle_home_gi }} state=absent - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes - file: name={{ oracle_home_gi }} mode=775 owner={{ oracle_user }} group={{ oracle_group }} state=directory - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Setup response file for install (GI) - template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes - with_items: "{{asm_diskgroups}}" - run_once: "{{ configure_cluster}}" - tags: - - responsefilegi - when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg - - - name: install-home-gi | Install Grid Infrastructure - shell: "{{ oracle_home_gi }}/gridSetup.sh -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -silent" - become: yes - become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" - tags: - - oragridinstall - when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack - register: giinstall - failed_when: giinstall.rc not in [0,6] - - - debug: var=giinstall.stdout_lines - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout and giinstall.changed - - - include_role: - name: oraswgi-manage-patches - when: patch_before_rootsh and apply_patches_gi - - - name: install-home-gi | Run oraInstroot script after installation - shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" - become: yes - tags: - - runroot - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Run root script after installation (Master Node) - shell: "{{ oracle_home_gi }}/root.sh" - become: yes - run_once: "{{ configure_cluster}}" - tags: - - runroot - when: oracle_home_gi not in checkgiinstall.stdout - register: rootmaster - - - debug: var=rootmaster.stdout_lines - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Run root script after installation (Other Nodes) - shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" - become: yes - with_indexed_items: "{{groups[hostgroup]}}" - tags: - - runroot - #when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 - when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout - register: rootother - - - debug: var=rootother.stdout_lines - when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: True - - - name: install-home-gi | Execute ConfigTools - shell: "{{ oracle_home_gi }}/gridSetup.sh -executeConfigTools -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -silent" - become: yes - become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" - tags: - - runconfigtool - when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout - ignore_errors: true - register: configtool +- name: install-home-gi | Extract files to ORACLE_HOME (gi) + unarchive: src={{ oracle_gi_image }} dest={{ oracle_home_gi }} copy=no + with_items: "{{ oracle_sw_image_gi }}" + loop_control: + label: "{{ oracle_gi_image | default ('') }}" + args: + creates: "{{ oracle_home_gi }}/root.sh" + become: true + become_user: "{{ grid_install_user }}" + tags: + - oragridswunpack + when: + - oracle_home_gi not in checkgiinstall.stdout + - oracle_install_version_gi == item.version + +# Check for an existing GRID_HOME before reinstallation of OPatch +- name: install-home-gi | Check for file GridSetup.sh + no_log: true + stat: path={{ oracle_home_gi }}/gridSetup.sh + register: stat_gridsetup_result + run_once: "{{ configure_cluster }}" + # when: master_node + +- name: install-home-gi | State of GridSetup.sh + assert: + that: "stat_gridsetup_result.stat.exists == True" + msg: "Cannot find {{ oracle_home_gi }}/gridSetup.sh }}" + run_once: "{{ configure_cluster }}" + # when: master_node + +- name: install-home-gi | Install cvuqdisk rpm + yum: name="{{ oracle_home_gi }}/cv/rpm/{{ cvuqdisk_rpm }}" state=present + # noqa ignore-errors + when: configure_cluster + tags: cvuqdisk + ignore_errors: true + +- name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes + file: name={{ oracle_home_gi }} state=absent + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Recreate ORACLE_HOME (gi) on other nodes + file: name={{ oracle_home_gi }} mode=775 owner={{ oracle_user }} group={{ oracle_group }} state=directory + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Setup response file for install (GI) + template: + src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 + dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} + owner="{{ grid_install_user }}" + group={{ oracle_group }} + mode=0600 + backup=yes + with_items: "{{ asm_diskgroups }}" + run_once: "{{ configure_cluster }}" + tags: + - responsefilegi + when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg + +- name: install-home-gi | Install Grid Infrastructure + shell: "{{ oracle_home_gi }}/gridSetup.sh -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -silent" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + run_once: "{{ configure_cluster }}" + tags: + - oragridinstall + when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack + register: giinstall + failed_when: giinstall.rc not in [0,6] + +- debug: var=giinstall.stdout_lines + # noqa unnamed-task + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout and giinstall.changed + +- include_role: + # noqa unnamed-task + name: oraswgi-manage-patches + when: patch_before_rootsh and apply_patches_gi + +- name: install-home-gi | Run oraInstroot script after installation + shell: "{{ oracle_inventory_loc }}/orainstRoot.sh" + # noqa command-instead-of-shell + become: true + tags: + - runroot + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Run root script after installation (Master Node) + shell: "{{ oracle_home_gi }}/root.sh" + # noqa command-instead-of-shell + become: true + run_once: "{{ configure_cluster }}" + tags: + - runroot + when: oracle_home_gi not in checkgiinstall.stdout + register: rootmaster + +- debug: var=rootmaster.stdout_lines + # noqa unnamed-task + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Run root script after installation (Other Nodes) + shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh" + # noqa command-instead-of-shell + become: true + with_indexed_items: "{{ groups[hostgroup] }}" + tags: + - runroot + # when: not master_node and oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1 + when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout + register: rootother + +- debug: var=rootother.stdout_lines + # noqa unnamed-task ignore-errors + when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout + ignore_errors: true + +- name: install-home-gi | Execute ConfigTools + shell: "{{ oracle_home_gi }}/gridSetup.sh -executeConfigTools -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -silent" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + run_once: "{{ configure_cluster }}" + tags: + - runconfigtool + when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout + ignore_errors: true + register: configtool diff --git a/roles/oraswgi-install/tasks/curl.yml b/roles/oraswgi-install/tasks/curl.yml index 549727f7f..39bd35804 100644 --- a/roles/oraswgi-install/tasks/curl.yml +++ b/roles/oraswgi-install/tasks/curl.yml @@ -1,10 +1,12 @@ +--- - name: install-home-gi | Copy oracle installfiles to server (GI) (web - curl) shell: "curl -o {{ oracle_stage }}/{{ item.filename }} {{ oracle_sw_source_www }}/{{ item.filename }}" - with_items: "{{oracle_sw_image_gi}}" - become: yes + # noqa command-instead-of-shell command-instead-of-module + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" args: - creates: "{{ oracle_stage }}/{{ item.filename }}" + creates: "{{ oracle_stage }}/{{ item.filename }}" tags: - oragridsw when: oracle_home_gi not in checkgiinstall.stdout and not is_sw_source_local and oracle_install_version_gi == item.version and oracle_sw_copy diff --git a/roles/oraswgi-install/tasks/get_url.yml b/roles/oraswgi-install/tasks/get_url.yml index 3e21cfc43..231b4fba7 100644 --- a/roles/oraswgi-install/tasks/get_url.yml +++ b/roles/oraswgi-install/tasks/get_url.yml @@ -1,11 +1,12 @@ +--- - name: install-home-gi | Copy oracle installfiles to server (GI) (web - get_url) get_url: - url={{ oracle_sw_source_www }}/{{ item.filename }} - dest={{ oracle_stage }} - mode=775 - force=no - with_items: "{{oracle_sw_image_gi}}" - become: yes + url={{ oracle_sw_source_www }}/{{ item.filename }} + dest={{ oracle_stage }} + mode=775 + force=no + with_items: "{{ oracle_sw_image_gi }}" + become: true become_user: "{{ grid_install_user }}" tags: - oragridsw diff --git a/roles/oraswgi-install/tasks/main.yml b/roles/oraswgi-install/tasks/main.yml index 4754ea551..a968bcb30 100644 --- a/roles/oraswgi-install/tasks/main.yml +++ b/roles/oraswgi-install/tasks/main.yml @@ -1,142 +1,154 @@ --- - - name: install-home-gi | Check if GI is already installed - #shell: grep "{{ oracle_home_gi }}" "{{ oracle_inventory_loc }}/ContentsXML/inventory.xml" |wc -l - shell: cat "{{ oracle_inventory_loc }}/ContentsXML/inventory.xml" |grep -w {{ oracle_home_gi }} |awk '{print $3}' | cut -f2 -d'"' - tags: +- name: install-home-gi | Check if GI is already installed + # shell: grep "{{ oracle_home_gi }}" "{{ oracle_inventory_loc }}/ContentsXML/inventory.xml" |wc -l + shell: cat "{{ oracle_inventory_loc }}/ContentsXML/inventory.xml" |grep -w {{ oracle_home_gi }} |awk '{print $3}' | cut -f2 -d'"' + # noqa command-instead-of-shell risky-shell-pipe + tags: - checkifgiinstall - changed_when: False - register: checkgiinstall - - - name: install-home-gi | check if GI has been configured - stat: path=/etc/oracle/olr.loc - register: olrloc - - - name: install-home-gi | set fact for patch_before_rootsh - set_fact: - patch_before_rootsh: False - when: olrloc.stat.exists and patch_before_rootsh - - - name: install-home-gi | Mount nfs share with installation media - mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=mounted - tags: - - nfsmountgi - when: install_from_nfs - - - name: install-home-gi | Add new dotprofile (GI) - template: src=dotprofile-gi.j2 dest={{ grid_user_home }}/{{ oracle_profile_name_gi }} owner={{ grid_install_user }} group={{ oracle_group }} mode=755 backup=yes - tags: + changed_when: false + register: checkgiinstall + +- name: install-home-gi | check if GI has been configured + stat: path=/etc/oracle/olr.loc + register: olrloc + +- name: install-home-gi | set fact for patch_before_rootsh + set_fact: + patch_before_rootsh: false + when: olrloc.stat.exists and patch_before_rootsh + +- name: install-home-gi | Mount nfs share with installation media + mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=mounted + tags: + - nfsmountgi + when: install_from_nfs + +- name: install-home-gi | Add new dotprofile (GI) + template: + src=dotprofile-gi.j2 + dest={{ grid_user_home }}/{{ oracle_profile_name_gi }} + owner={{ grid_install_user }} + group={{ oracle_group }} + mode=0755 + backup=yes + tags: - dotprofilegi - - name: install-home-gi | Create common directories - file: dest={{ item.name }} mode={{ item.mode}} owner={{ item.owner }} group={{ item.group }} state=directory - with_items: "{{oracle_directories}}" - tags: - - directories - - - name: install-home-gi | Create stage directory (version specific) - file: dest={{ oracle_stage }}/{{ item.version }} mode=775 owner="{{ oracle_user }}" group={{ oracle_group }} state=directory - become: yes - with_items: "{{oracle_sw_image_gi}}" - when: oracle_install_version_gi == item.version - tags: - - directories - - - name: install-home-gi | Create ORACLE_HOME directory (GI) - file: dest={{ oracle_home_gi }} owner="{{ grid_install_user }}" group={{ oracle_group }} state=directory mode=775 - become: yes - tags: - - directories - when: oracle_home_gi not in checkgiinstall.stdout - - - include_tasks: "{{ www_download_bin }}.yml" - when: not is_sw_source_local and oracle_sw_copy - - - name: install-home-gi | Copy oracle installfiles to server (GI) (local) - copy: src={{ oracle_sw_source_local }}/{{ item.filename }} dest={{ oracle_stage }} mode=775 force=no - with_items: "{{oracle_sw_image_gi}}" - become: yes - become_user: "{{ grid_install_user }}" - tags: - - oragridsw - when: oracle_home_gi not in checkgiinstall.stdout and is_sw_source_local and oracle_install_version_gi == item.version and oracle_sw_copy - - - name: include_tasks "{{ oracle_install_version_gi }}.yml" - include_tasks: "{{ oracle_install_version_gi }}.yml" - - - name: install-home-gi | Check if stuff is running - shell: "{{ oracle_home_gi }}/bin/crsctl stat res -t" - tags: - - crsctl - register: crsctl - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout - - - debug: var=crsctl.stdout_lines - tags: - - crsctl - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Update Nodelist, set CRS=TRUE - shell: "{{ oracle_home_gi }}/oui/bin/runInstaller -updateNodeList ORACLE_HOME={{ oracle_home_gi }} CRS=TRUE" - become: yes - become_user: "{{ grid_install_user }}" - run_once: "{{ configure_cluster}}" - when: oracle_home_gi not in checkgiinstall.stdout - ignore_errors: true - tags: - - updatenodelist - - - name: install-home-gi | Add additional info to glogin.sql (1) - lineinfile: dest="{{ oracle_home_gi }}/sqlplus/admin/glogin.sql" line='set sqlprompt "_user @ _connect_identifier:>"' backup=yes - tags: - - glogingi - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Add additional info to glogin.sql (2) - lineinfile: dest="{{ oracle_home_gi }}/sqlplus/admin/glogin.sql" line='set time on' backup=yes - tags: - - glogingi - when: oracle_home_gi not in checkgiinstall.stdout - - - name: include_role oraswgi-manage-patches - include_role: - name: oraswgi-manage-patches - when: not patch_before_rootsh and apply_patches_gi - - - name: install-home-gi | Check opatch lsinventory (GI) - shell: "{{ oracle_home_gi }}/OPatch/opatch lspatches" - become: yes - become_user: "{{ grid_install_user }}" - environment: "{{oracle_env}}" - register: opatchls - tags: - - opatchls - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Check opatch lsinventory (GI) - debug: var=opatchls.stdout_lines - tags: - - opatchls - when: oracle_home_gi not in checkgiinstall.stdout - - - name: install-home-gi | Check olsnodes (GI) - shell: "{{ oracle_home_gi }}/bin/olsnodes -a -n -s -t" - become: yes - become_user: "{{ grid_install_user }}" - when: oracle_gi_cluster_type |upper == 'FLEX' and '12' in oracle_install_version_gi - register: olsnodes - tags: - - olsnodes - - - name: install-home-gi | Check olsnodes (GI) - debug: var=olsnodes.stdout_lines - when: oracle_gi_cluster_type|upper == 'FLEX' and '12' in oracle_install_version_gi - tags: - - olsnodes - - - name: install-home-gi | Unmount nfs share with installation media - mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=absent - when: install_from_nfs - tags: nfsunmountgi +- name: install-home-gi | Create common directories + file: dest={{ item.name }} mode={{ item.mode }} owner={{ item.owner }} group={{ item.group }} state=directory + with_items: "{{ oracle_directories }}" + tags: + - directories + +- name: install-home-gi | Create stage directory (version specific) + file: dest={{ oracle_stage }}/{{ item.version }} mode=775 owner="{{ oracle_user }}" group={{ oracle_group }} state=directory + become: true + with_items: "{{ oracle_sw_image_gi }}" + when: oracle_install_version_gi == item.version + tags: + - directories + +- name: install-home-gi | Create ORACLE_HOME directory (GI) + file: dest={{ oracle_home_gi }} owner="{{ grid_install_user }}" group={{ oracle_group }} state=directory mode=775 + become: true + tags: + - directories + when: oracle_home_gi not in checkgiinstall.stdout + +- include_tasks: "{{ www_download_bin }}.yml" + when: not is_sw_source_local and oracle_sw_copy + +- name: install-home-gi | Copy oracle installfiles to server (GI) (local) + copy: src={{ oracle_sw_source_local }}/{{ item.filename }} dest={{ oracle_stage }} mode=775 force=no + with_items: "{{ oracle_sw_image_gi }}" + become: true + become_user: "{{ grid_install_user }}" + tags: + - oragridsw + when: oracle_home_gi not in checkgiinstall.stdout and is_sw_source_local and oracle_install_version_gi == item.version and oracle_sw_copy + +- name: include_tasks "{{ oracle_install_version_gi }}.yml" + include_tasks: "{{ oracle_install_version_gi }}.yml" + +- name: install-home-gi | Check if stuff is running + shell: "{{ oracle_home_gi }}/bin/crsctl stat res -t" + # noqa command-instead-of-shell + tags: + - crsctl + register: crsctl + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout + +- debug: var=crsctl.stdout_lines + # noqa unnamed-task + tags: + - crsctl + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Update Nodelist, set CRS=TRUE + shell: "{{ oracle_home_gi }}/oui/bin/runInstaller -updateNodeList ORACLE_HOME={{ oracle_home_gi }} CRS=TRUE" + # noqa command-instead-of-shell ignore-errors + become: true + become_user: "{{ grid_install_user }}" + run_once: "{{ configure_cluster }}" + when: oracle_home_gi not in checkgiinstall.stdout + ignore_errors: true + tags: + - updatenodelist + +- name: install-home-gi | Add additional info to glogin.sql (1) + lineinfile: dest="{{ oracle_home_gi }}/sqlplus/admin/glogin.sql" line='set sqlprompt "_user @ _connect_identifier:>"' backup=yes + tags: + - glogingi + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Add additional info to glogin.sql (2) + lineinfile: dest="{{ oracle_home_gi }}/sqlplus/admin/glogin.sql" line='set time on' backup=yes + tags: + - glogingi + when: oracle_home_gi not in checkgiinstall.stdout + +- name: include_role oraswgi-manage-patches + include_role: + name: oraswgi-manage-patches + when: not patch_before_rootsh and apply_patches_gi + +- name: install-home-gi | Check opatch lsinventory (GI) + shell: "{{ oracle_home_gi }}/OPatch/opatch lspatches" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + environment: "{{ oracle_env }}" + register: opatchls + tags: + - opatchls + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Check opatch lsinventory (GI) + debug: var=opatchls.stdout_lines + tags: + - opatchls + when: oracle_home_gi not in checkgiinstall.stdout + +- name: install-home-gi | Check olsnodes (GI) + shell: "{{ oracle_home_gi }}/bin/olsnodes -a -n -s -t" + # noqa command-instead-of-shell + become: true + become_user: "{{ grid_install_user }}" + when: oracle_gi_cluster_type |upper == 'FLEX' and '12' in oracle_install_version_gi + register: olsnodes + tags: + - olsnodes + +- name: install-home-gi | Check olsnodes (GI) + debug: var=olsnodes.stdout_lines + when: oracle_gi_cluster_type|upper == 'FLEX' and '12' in oracle_install_version_gi + tags: + - olsnodes + +- name: install-home-gi | Unmount nfs share with installation media + mount: src="{{ nfs_server_sw }}:{{ nfs_server_sw_path }}" name={{ oracle_stage_remote }} fstype=nfs state=absent + when: install_from_nfs + tags: nfsunmountgi