Task:
Install or upgrade (Lotus) HCL Domino release via Ansible/AAP.
Notes:
- ansible.builtin is part of ansible-core
Steps:
a. Create a handler playbook that will restart Domino services assuming the install or upgrade succeeded:
$ cd role_domino
$ vi ./handler/main.yaml
---
- name: restart domino.service
service:
name: domino.service
state: restarted
<esc>:wq (to save and exit)
b. Create the tasks main playbook that calls the pre-requisite linux role in next folder over and then each task playbook
$ vi ./tasks/main.yml
---
- hosts: all
gather_facts: yes
ignore_unreachable: yes
become: yes
- name: include vars
include_vars: commonvars.yaml
- include role:
name: role_rockyos8
- name: Installation tasks
block:
- name: include RockyOS base tasks
include_tasks: "{{ item }}"
with_items:
- create_notesdata_lv.yaml
- download_domino.yaml
- domino_stop.yaml
- domino_install.yaml
- nashed_domino_service_download.yaml
- nashed_domino_service_install.yaml
- domino_start.yaml
handlers:
- import_tasks: handlers/main.yml
rescue:
- name: Domino installation failed
fail:
msg:
- "ERROR occurred in role_domino, playbook: tasks/main.yaml"
- "Failed task: {{ ansible_failed_task.name }}"
- "Failure error message: {{ ansible_failed_result.msg }}"
<esc>:wq (to save and exit)
c. Download playbook:
$ vi ./tasks/download_domino.yaml
---
- name: Download Domino tar to temp folder
get_url:
url: "{{ download_domino_latest }}
dest: "{{ download_path }}/domino.tar"
url_username: "{{ download_acctid }}
url_password: "{{ download_acctpwd }}"
validate_certs: false
force_basic_auth: true
timeout: 1500
- name: Download response silentInstall file
get_url:
url: "{{ download_domino_responsefile }}"
dest: "{{ download_path }}/response.properties"
url_username: "{{ download_acctid }}
url_password: "{{ download_acctpwd }}"
validate_certs: false
force_basic_auth: true
timeout: 500
rescue:
- name: Domino download failed
fail:
msg:
- "ERROR occurred in role_domino, playbook: tasks/download_domino.yaml"
- "Failed task: {{ ansible_failed_task.name }}"
- "Failure error message: {{ ansible_failed_result.msg }}"
<esc>:wq (to save and exit)
d. Stop Domino before install/upgrade:
$ vi ./tasks/domino_stop.yaml
---
- name: stop domino.service
service:
name: domino.service
state: stopped
<esc>:wq (to save and exit)
e. Extract playbook and install:
$ vi ./tasks/domino_install.yaml
---
- name: Extract Domino install
src: "{{ download_path }}/domino.tar"
dest: "{{ download_path }}"
remote_src: true
mode: 0755
- name: Remove tar file
file:
path: "{{ download_path }}/domino.tar"
state: absent
- name: Change directory to install and run install
command: "install -f {{ download_path }}/response.properties -i silent >> dominoinstall.log"
args:
chdir: "{{ download_path }}/linux64/"
rescue:
- name: Domino installation failed
fail:
msg:
- "ERROR occurred in role_domino, playbook: tasks/domino_install.yaml"
- "Failed task: {{ ansible_failed_task.name }}"
- "Failure error message: {{ ansible_failed_result.msg }}"
f. Start Domino after install/upgrade:
$ vi ./tasks/domino_start.yaml
---
- name: start domino.service
service:
name: domino.service
state: started
previous page
|