- unarchive module
- copy module
Unarchive module in Ansible
We can use the unarchive module for Zip files and also for tar.gz files. When we use this module need to provide the src, dest values that is source and destination. This module automatically copies the zip file and unzip it in the remote
The copy module in Ansible
The copy module is works similar to scp in Linux it will copy the specified files in the source to destination. We can copy multiple files to remote machine with_item option. You need to provide the list of filenames that need to copy in the list.
Working in preparation of WebLogic development environments, where we need to use the WebLogic quick installer is around 230 megabytes in size. We choose this installer because which is most preferable installer for docker clusters and virtualization implementation environments or cloud environments. After download from the Oracle site, First we need to unzip the installer.
The response file
Now lets create the silent response file for WebLogic.
The oraInst.loc file
Lets copy and enhancing the existing playbook file added WebLogic specific installer and silent response file, oraInv.loc files
Now run the playbook
Next we will be work with the above files to install the WebLogic in remote machines using Ansible.
Expecting your feedback in the comment section to improve ourself to give much better solutions.
References
We can use the unarchive module for Zip files and also for tar.gz files. When we use this module need to provide the src, dest values that is source and destination. This module automatically copies the zip file and unzip it in the remote
The copy module in Ansible
The copy module is works similar to scp in Linux it will copy the specified files in the source to destination. We can copy multiple files to remote machine with_item option. You need to provide the list of filenames that need to copy in the list.
WebLogic response file, OraInv.loc and zip file to remote boxes using ansible modules |
Working in preparation of WebLogic development environments, where we need to use the WebLogic quick installer is around 230 megabytes in size. We choose this installer because which is most preferable installer for docker clusters and virtualization implementation environments or cloud environments. After download from the Oracle site, First we need to unzip the installer.
The response file
Now lets create the silent response file for WebLogic.
[ENGINE] Response File Version=1.2.0.0.0 [GENERIC] ORACLE_HOME=/home/vagrant/fmw INSTALL_TYPE=WebLogic Server DECLINE_SECURITY_UPDATES=true SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
The oraInst.loc file
inst_group=vagrant inventory_loc=/home/vagrant/oraInventoy
Lets copy and enhancing the existing playbook file added WebLogic specific installer and silent response file, oraInv.loc files
vi wls_ins_fcp.yml --- - hosts: appservers remote_user: vagrant tasks: - name: Unpack archive unarchive: src: /u01/app/software/jdk/jdk-8u172-linux-x64.tar.gz dest: /home/vagrant remote_src: yes - name: WebLogic Software unzip unarchive: src: /u01/app/software/FMW_wls/fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip dest: /tmp - name: Copy install script and properties copy: src: ~/wls-auto/{{ item }} dest: /tmp mode: "a+r" with_items: [wls_install.rsp,oraInst.loc]
Now run the playbook
vagrant@docking ~/wls-auto $ ansible-playbook -i ~/hosts wls_ins_fcp.yml PLAY [appservers] ************************************************************** TASK [Gathering Facts] ********************************************************* ok: [192.168.33.102] ok: [192.168.33.100] TASK [Unpack archive] ********************************************************** ok: [192.168.33.102] ok: [192.168.33.100] TASK [WebLogic Software unzip] ************************************************* changed: [192.168.33.100] changed: [192.168.33.102] TASK [Copy install script and properties] ************************************** ok: [192.168.33.100] => (item=wls_install.rsp) ok: [192.168.33.102] => (item=wls_install.rsp) ok: [192.168.33.100] => (item=oraInst.loc) ok: [192.168.33.102] => (item=oraInst.loc) PLAY RECAP ********************************************************************* 192.168.33.100 : ok=4 changed=1 unreachable=0 failed=0 192.168.33.102 : ok=4 changed=1 unreachable=0 failed=0No two programs will be same each one can differently to achieve the same task. Lets confirm the execution of the above ansible playbook.
WebLogic installer, response file, oraInst.loc file into remote /tmp |
Next we will be work with the above files to install the WebLogic in remote machines using Ansible.
Expecting your feedback in the comment section to improve ourself to give much better solutions.
References
Thanks, it's good automation process.. Can possible to write ansible yml file just to run restart weblogic instances?
ReplyDeleteyes it is possible you just need to use command module.
ReplyDelete