Problem statement:
Install Infoscale on fifty (50) nodes without copying chunky tar.gz to all of them.
I had an issue some time ago. I needed to install the Infoscale on a large number of nodes and I did not want to do it manually. I like my coffee.
How to approach that problem – create a repository and install required packages using Ansible playbook.
So let’s get to it.
1. I will skip how to install and configure apache server but for your knowledge – once you install httpd on the server, the default path apache is checking is /var/www/html
2. Get the Infoscale package and untar it
3. Copy the directory (or directories if you are planning to install Infoscale on RHEL 6.x) to /var/www/html
4. Ensure that the apache has privileges to read the files
5. Create a small Ansible Playbook to create the repo on the host where the Infoscale supposed to be installed. For example:
—
– name: Add /etc/hosts entry
lineinfile:
path: /etc/hosts
line: “172.16.36.102 centos”
owner: root
group: root
mode: 0644
seuser: system_u
setype: net_conf_t
– name: Deploy the VRTS repo for Red Hat 7
yum_repository:
name: veritas
description: Veritas YUM repo
baseurl: http://centos/rh7-rpms/
file: veritas_repo
gpgcheck: yes
enabled: yes
gpgkey: http://centos/rh7-rpms/RPM-GPG-KEY-veritas-infoscale7
enablegroups: yes
when: ansible_distribution_major_version|int == 7
– name: Deploy the VRTS repo for Red Hat 6
yum_repository:
name: veritas
description: Veritas YUM repo
baseurl: http://centos/rh6-rpms/
file: veritas_repo
gpgcheck: yes
enabled: yes
gpgkey: http://centos/rh6-rpms/RPM-GPG-KEY-veritas-infoscale7
enablegroups: yes
when: ansible_distribution_major_version|int == 6
6. Create another playbook which the only goal is to install the packages. For example:
—
– name: Verify if the repo and group exist
shell: $( which yum ) grouplist ENTERPRISE73
register: repocheck
– name: Install Veritas Packages
yum:
name: ‘@ENTERPRISE73’
state: latest
when: repocheck.rc == 0
7. Create another playbook which the only goal is to install the packages. For example:
– name: Verify if the add_install_scripts exists
stat:
path: /opt/VRTS/install/bin/UXRT73/add_install_scripts
register: scriptstate
– name: Run the script to deploy the installer script
shell: /opt/VRTS/install/bin/UXRT73/add_install_scripts
register: status
when: scriptstate.stat.exists
– name: Verify if the installer script exists
stat:
path: /opt/VRTS/install/installer
register: installerstate
8. Make sure the product is properly licensed. Nowadays most of the installation are KEYLESS installation:
—-
– name: License the Enterprise Version using Keyless method
shell: /opt/VRTS/bin/vxkeyless set ENTERPRISE -q
register: licstate
– name: Verify the state of the license
debug:
msg: “License has been successfully set on {{ inventory_hostname }}”
when: licstate.rc == 0
– name: Verify the state of the license
debug:
msg: “License has not been successfully set on {{ inventory_hostname }}”
when: licstate.rc == 1
failed_when: licstate.rc == 1
9. Reference all the playbooks in one playbook or if you want to elaborate, convert them into a role and use tags for your convenience. This is a quick and dirty way of speeding up the work:
—
– name: Install Infoscale 7.3
hosts: all
tasks:
– name: Include vrts_repo.yml
include: vrts_repo.yml
– name: Include vrts_install.yml
include: vrts_install.yml
– name: Include vrts_license.yml
include: vrts_license.yml
– name: Include vrts_config.yml
include: vrts_config.yml
10. Configure the inventory and run the playbook. Sit back and relax.