From 482e56ac7aa9567961440df5f57f77a3dcefcaa2 Mon Sep 17 00:00:00 2001 From: lastnitescurry Date: Sat, 22 Sep 2018 00:02:53 +0100 Subject: [PATCH] Documentum Server Patch install --- .gitignore | 115 ++++++++++--------- README.md | 2 + hosts.yaml | 5 +- playbook.retry | 2 +- roles/README.md | 2 + roles/documentum_server/files/serverPatch.sh | 10 ++ roles/documentum_server/tasks/main.yml | 29 ++++- roles/oracle_server/files/runInstaller.sh | 13 +++ roles/oracle_server/tasks/main.yml | 31 +++-- 9 files changed, 142 insertions(+), 67 deletions(-) create mode 100644 roles/documentum_server/files/serverPatch.sh create mode 100644 roles/oracle_server/files/runInstaller.sh diff --git a/.gitignore b/.gitignore index 94c74ad..51fbe98 100644 --- a/.gitignore +++ b/.gitignore @@ -1,57 +1,58 @@ -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -# Used by dotenv library to load environment variables. -# .env - -## Specific to RubyMotion: -.dat* -.repl_history -build/ -*.bridgesupport -build-iPhoneOS/ -build-iPhoneSimulator/ - -## Specific to RubyMotion (use of CocoaPods): -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# vendor/Pods/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc - -# Vagrant -.vagrant - -# Backups -*- Copy* -*.bak* \ No newline at end of file +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +# .env + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# vendor/Pods/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# Vagrant +.vagrant + +# Backups +*- Copy* +*.bak* +/credentials/ diff --git a/README.md b/README.md index c21890e..e17cf03 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ Documentum 16.4 on Centos #### WORKAROUND Vagrant problem. Prevent hostname from binding to the loopback address - https://github.com/hashicorp/vagrant/issues/7263 + sudo -i + sed -i '1d' /etc/hosts and setup SSH diff --git a/hosts.yaml b/hosts.yaml index bd86ef0..a17bae1 100644 --- a/hosts.yaml +++ b/hosts.yaml @@ -32,9 +32,12 @@ all: group: dmadmin gid: 5000 media: - tmp: /tmp installer: /tmp/documentum_server zip: /media/software/Documentum/D164/content_server_16.4_linux64_oracle.tar + patch: + installer: /tmp/documentum_server_patch + zip: /media/software/Documentum/D164/CS_16.4.0040.0057_linux_ora_P04.tar.gz + zip_file: CS_16.4.0040.0057_linux_ora.tar.gz jms: port: 9090 dir: /opt/documentum/wildfly9.0.1/server/DctmServer_MethodServer diff --git a/playbook.retry b/playbook.retry index e204b10..aa0d57e 100644 --- a/playbook.retry +++ b/playbook.retry @@ -1 +1 @@ -documentum +database diff --git a/roles/README.md b/roles/README.md index f728709..34f345c 100644 --- a/roles/README.md +++ b/roles/README.md @@ -8,6 +8,8 @@ To get started following: Ansible - A Beginner's Tutorial - https://www.youtube.com/watch?v=aeGDc7rCK_0 ### SSH +- https://stackoverflow.com/questions/39275038/auto-answer-ssh-copy-id-in-shell-script + #### Generate ssh-keygen -q -t ecdsa -b 521 -f ~/.ssh/id_ecdsa -N "" diff --git a/roles/documentum_server/files/serverPatch.sh b/roles/documentum_server/files/serverPatch.sh new file mode 100644 index 0000000..0730478 --- /dev/null +++ b/roles/documentum_server/files/serverPatch.sh @@ -0,0 +1,10 @@ +export LC_ALL=C +export HOME=/home/dmadmin +export DOCUMENTUM={{ documentum_server.documentum }} +export DOCUMENTUM_SHARED={{ documentum_server.dctm_shared }} +export DM_HOME={{ documentum_server.dm_home }} +export KEEP_TEMP_FILE=true + +cd {{ documentum_server.patch.installer }} +chmod u+x {{ documentum_server.patch.installer }}/patch.bin +{{ documentum_server.patch.installer }}/patch.bin LAX_VM {{ documentum_server.dctm_shared }}/java64/JAVA_LINK/bin/java -r response.properties -i Silent -DUSER_SELECTED_PATCH_ZIP_FILE={{ documentum_server.patch.zip_file }} diff --git a/roles/documentum_server/tasks/main.yml b/roles/documentum_server/tasks/main.yml index 7a29906..5841b8e 100644 --- a/roles/documentum_server/tasks/main.yml +++ b/roles/documentum_server/tasks/main.yml @@ -36,6 +36,7 @@ - "{{ documentum_server.dctm_shared }}" - "{{ documentum_server.dm_home }}" - "{{ documentum_server.media.installer }}" + - "{{ documentum_server.patch.installer }}" - name: Documentum Server pre-installation tasks for Red Hat Enterprise Linux file: @@ -59,7 +60,7 @@ group: root mode: u=rw,g=r,o=r -- name: Unpack Documentum media +- name: Unpack Documentum Server media unarchive: src: "{{ documentum_server.media.zip }}" dest: "{{ documentum_server.media.installer }}" @@ -84,3 +85,29 @@ executable: /bin/bash chdir: "{{ documentum_server.media.installer }}" creates: "{{ documentum_server.dm_home }}/version.txt" + +- name: Unpack Documentum Server Patch media + unarchive: + src: "{{ documentum_server.patch.zip }}" + dest: "{{ documentum_server.patch.installer }}" + creates: "{{ documentum_server.patch.installer }}/patch.bin" + remote_src: yes + owner: "{{ documentum_server.user }}" + group: "{{ documentum_server.group }}" + +- name: Setup script to install Documentum Server Patch + template: + dest: "{{ documentum_server.patch.installer }}/patch.sh" + src: ../files/serverPatch.sh + owner: "{{ documentum_server.user }}" + group: "{{ documentum_server.group }}" + mode: u=rwx,g=r,o=r + +- name: Install Documentum Server Patch + shell: "{{ documentum_server.patch.installer }}/patch.sh" + become: true + become_user: dmadmin + args: + executable: /bin/bash + chdir: "{{ documentum_server.patch.installer }}" + creates: "{{ documentum_server.dm_home }}/version.txt" diff --git a/roles/oracle_server/files/runInstaller.sh b/roles/oracle_server/files/runInstaller.sh new file mode 100644 index 0000000..191a4ca --- /dev/null +++ b/roles/oracle_server/files/runInstaller.sh @@ -0,0 +1,13 @@ +export ORACLE_HOSTNAME={{ ansible_hostname }} +export ORACLE_UNQNAME={{ oracle.unqname }} +export ORACLE_BASE={{ oracle.base }} +export ORACLE_HOME={{ oracle.home }} +export ORACLE_SID={{ oracle.sid }} +export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib +export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib + +cd {{ oracle.media.installer }} +chmod u+x {{ oracle.media.installer }}/runInstaller +{{ oracle.media.installer }}/runInstaller -silent -responseFile {{ oracle.media.installer }}/db_install.rsp -waitforcompletion > {{ oracle.media.installer }}/runInstaller.log + + \ No newline at end of file diff --git a/roles/oracle_server/tasks/main.yml b/roles/oracle_server/tasks/main.yml index 03e64d7..59a3b35 100644 --- a/roles/oracle_server/tasks/main.yml +++ b/roles/oracle_server/tasks/main.yml @@ -51,13 +51,30 @@ group: "{{ oracle.groups.inventory }}" mode: u=rw,g=r,o=r -- name: Run the Oracle 12c installer - shell: "{{ oracle.media.installer }}/runInstaller -silent -responseFile {{ oracle.media.installer }}/db_install.rsp -waitforcompletion" - args: - chdir: "{{ oracle.media.installer }}" - creates: "{{ oracle.home }}/root.sh" - become: true - become_user: oracle +#- name: Run the Oracle 12c installer +# shell: "{{ oracle.media.installer }}/runInstaller -silent -responseFile {{ oracle.media.installer }}/db_install.rsp -waitforcompletion" +# args: +# chdir: "{{ oracle.media.installer }}" +# creates: "{{ oracle.home }}/root.sh" +# become: true +# become_user: oracle + +- name: Setup script to install Oracle 12c Server software + template: + dest: "{{ oracle.media.installer }}/runInstaller.sh" + src: ../files/runInstaller.sh + owner: "{{ oracle.user }}" + group: "{{ oracle.groups.inventory }}" + mode: u=rwx,g=r,o=r + +# FIXME handle none zero exit code due to failed requirements. Install is good +#- name: Run the Oracle 12c installer +# shell: "{{ oracle.media.installer }}/runInstaller.sh" +# args: +# chdir: "{{ oracle.media.installer }}" +# creates: "{{ oracle.home }}/root.sh" +# become: true +# become_user: oracle - name: Run the Oracle 12c post install root task shell: "{{ oracle.home }}/root.sh"