diff --git a/roles/oracle-db-install/tasks/install_database.yml b/roles/oracle-db-install/tasks/install_database.yml index 933008c..92b8485 100644 --- a/roles/oracle-db-install/tasks/install_database.yml +++ b/roles/oracle-db-install/tasks/install_database.yml @@ -47,6 +47,31 @@ become_user: oracle tags: extract + # téléchargeent de OPatch et Patch Release Update + - name: Téléchargement OPatch + shell: wget --no-check-certificate https://kutt.axiome.io/opatch -O /u01/sources/{{opatch_file}} + tags: download_opatch + + - name: Téléchargement du PSU + shell: wget --no-check-certificate https://kutt.axiome.io/db_ru -O /u01/sources/{{psu_file}} + tags: download_ru + + # decompression de OPatch dans $ORACLE_HOME + - name: Installation OPatch dns ORACLE_HOME + unarchive: src={{ patch_dir }}/{{ opatch_file }} dest={{ oracle_home }} + become: true + become_method: su + become_user: oracle + tags: patch_db + + # extract du patch dans /u01/sources + - name: unzip du patch + unarchive: src={{ patch_dir }}/{{ psu_file }} dest={{ patch_dir }} + become: true + become_method: su + become_user: oracle + tags: patch_db + - name: Copie du fichier de réponse pour installation silencieuse template: src=db_install_{{ oracle_version }}.j2 dest={{ oracle_sources }}/{{ db_response_file }} tags: responsefile @@ -105,3 +130,16 @@ - name: suppression du binaires file: path={{ oracle_sources }}/{{oracle_zip_filename}} state=absent + + # suppression des binaires, du fichier de réponse et du script d'install + - name: Nettoyage du répertoire du patch + file: path={{ oracle_sources }}/{{ patch_number }} state=absent + tags: patch_db + + - name: suppression du fichier OPatch + file: path={{ oracle_sources }}/{{ opatch_file }} state=absent + tags: patch_db + + - name: suppression du Patch RU + file: path={{ oracle_sources }}/{{ psu_file }} state=absent + tags: patch_db \ No newline at end of file diff --git a/roles/oracle-db-install/tasks/main.yml b/roles/oracle-db-install/tasks/main.yml index f00120e..6a49612 100644 --- a/roles/oracle-db-install/tasks/main.yml +++ b/roles/oracle-db-install/tasks/main.yml @@ -8,8 +8,8 @@ - include: install_database.yml # telechargement des fihiers : opatch + PSU-RU - - include: download_software.yml +# - include: download_software.yml # Application du patch - - include: opatch_apply.yml +# - include: opatch_apply.yml diff --git a/roles/oracle-db-install/templates/run_db_install.sh.j2 b/roles/oracle-db-install/templates/run_db_install.sh.j2 index f3bb62b..277d472 100644 --- a/roles/oracle-db-install/templates/run_db_install.sh.j2 +++ b/roles/oracle-db-install/templates/run_db_install.sh.j2 @@ -3,16 +3,17 @@ chkifinstalled=`grep "{{ oracle_home }}" "{{ oracle_inventory }}/ContentsXML/inventory.xml" |wc -l` if [[ $chkifinstalled == 1 ]]; then - echo "Error: ORACLE_HOME: {{ oracle_home }} already present. Exiting" - exit 0 + echo "Error: ORACLE_HOME: {{ oracle_home }} already present. Exiting" + exit 0 else -linux_version=$(cat /etc/os-release | egrep "^VERSION=" | cut -d= -f2 | sed 's/"//g' | cut -d. -f1) -if [ "${linux_verion}" -eq 9 ] -then - export CV_ASSUME_DISTID=OL8 -else - export CV_ASSUME_DISTID=OEL7.6 -fi -{{ oracle_home }}/runInstaller -responseFile {{ oracle_sources }}/{{ db_response_file }} -ignorePrereqFailure -silent -waitforcompletion + linux_version=$(cat /etc/os-release | egrep "^VERSION=" | cut -d= -f2 | sed 's/"//g' | cut -d. -f1) + if [ "${linux_verion}" -eq 9 ] + then + export CV_ASSUME_DISTID=OL8 + else + export CV_ASSUME_DISTID=OEL7.6 + fi + # Application du patch {{ patch_number }} et execution de runInstaller + {{ oracle_home }}/runInstaller -applyRU /u01/sources/{{ patch_number }} -responseFile {{ oracle_sources }}/{{ db_response_file }} -ignorePrereqFailure -silent -waitforcompletion fi