Skip to content

Instantly share code, notes, and snippets.

@baberlevi
Created September 10, 2018 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baberlevi/995ce3b934b707fa776273049b77429c to your computer and use it in GitHub Desktop.
Save baberlevi/995ce3b934b707fa776273049b77429c to your computer and use it in GitHub Desktop.
smrt-analysis setup playbook
- name: Configure smrt-analysis.las.iastate.edu
hosts: smrt-analysis.las.iastate.edu
user: root
connection: smart
vars_files:
- ../vars/ISU/globals.yml
- ../vars/directories.yml
environment:
SMRT_ROOT: "{{smrt_root}}"
SMRT_USER: "{{smrt_user}}"
SMRT_GROUP: "{{smrt_group}}"
pre_tasks:
- name: Create group of user to run smrt process
group:
name: "{{smrt_group}}"
state: present
- name: Create user to run smrt process
user:
name: "{{smrt_user}}"
comment: "SMRT Analysis"
group: "{{smrt_group}}"
createhome: yes
roles:
- firewall
- epel
tasks:
- name: Ensure environmet set for smrt
lineinfile:
dest: "/home/{{smrt_user}}/.bashrc"
state: present
line: "export SMRT_ROOT=\"{{smrt_root}}\""
- name: Ensure environmet set for smrt
lineinfile:
dest: "/home/{{smrt_user}}/.bashrc"
state: present
line: "export SMRT_USER=\"{{smrt_user}}\""
- name: Ensure environmet set for smrt
lineinfile:
line: "export SMRT_GROUP=\"{{smrt_group}}\""
state: present
dest: "/home/{{smrt_user}}/.bashrc"
- name: Install redhat-lsb
yum: name=redhat-lsb state=present
- name: Install pip
yum: name=python2-pip state=present
- name: Installing pexpect from pip since titan version is less than what is required
command: pip install pexpect
- name: Create application directory
file:
path: "{{smrt_root}}"
mode: u=rwx,g=rwx,o=r
state: directory
recurse: yes
group: "{{smrt_group}}"
owner: "{{smrt_user}}"
- name: Download SMRT
get_url:
url: "{{ item.url }}"
dest: "{{ item.dest }}"
mode: 0755
owner: "{{smrt_user}}"
group: "{{smrt_group}}"
with_items:
- { url: 'https://s3.amazonaws.com/files.pacb.com/software/smrtanalysis/2.3.0/smrtanalysis_2.3.0.140936.run' , dest: '/tmp/smrtanalysis_2.3.0.140936.run' }
- { url: 'https://s3.amazonaws.com/files.pacb.com/software/smrtanalysis/2.3.0/smrtanalysis-patch_2.3.0.140936.p5.run' , dest: '/tmp/smrtanalysispatch_2.3.0.140936.p5.run' }
# Message incase application gets stuck in loop because of unanswered question caught by another regular expression.
- name: Message
vars:
msg: |
Warning: This installation is not smart enough to realize there is a infinite look with the answers since questions are looked for in regex expressions:
Please run the following command as user: {{smrt_user}} should installation fail
command: /tmp/smrtanalysis_2.3.0.140936.run -p /tmp/smrtanalysispatch_2.3.0.140936.p5.run --rootdir $SMRT_ROOT
debug:
msg: "{{ msg.split('\n') }}"
- name: Installing smrtanalysis
expect:
command: /tmp/smrtanalysis_2.3.0.140936.run -p /tmp/smrtanalysispatch_2.3.0.140936.p5.run --rootdir {{smrt_root}}
responses:
# Asks for smrt_user since we are switchings to smrt_user using that variable . try .+
(?i)Use the \'.+\' as the SMRT Analysis user\? \[Y/n\]\:: "Y"
# Warning will appear no matter if min requirement is matched since rhel 7 is not supported yet
(?i)Continue the installation\? \[Y/n\]\:: "Y"
# Asking for DNS names
(?i)Choice \[1\]\::
- "1"
- "4"
# Additional DNS names
(?i)Specify the DNS name\:: "{{smrt_host}}"
# SMRT Analysis TomCat port and shutdownport
(?i)Enter the \'main\' port for the SMRT Analysis Tomcat Webserver \[8080\]\:: {{smrt_port}}
(?i)Enter the \'shutdown\' port for the SMRT Analysis Tomcat Webserver \[8005\]\:: "8005"
# TMP dir
# Enter the symlink destination for the TMP directory [/tmp/smrtanalysis]
(?i)Enter the symlink destination for the TMP directory .+$: "/tmp/smrtanalysis"
# UAERDATA Directory Setup Messages askes for storage to be above 500 GB
(?i)Create this directory and continue with installation\? \[Y/n\]\:: "Y"
# If older data directory present keep
(?i)Keep this directory and continue with installation\? \[Y\/n\]\:: "Y"
# Self contained mysql port then create mysql db
(?i)Enter the mysql port \[53306\]\:: "53306"
(?i)Ready to create internal database\. Continue\? \[Y/n\]\:: "Y"
# (?i)4\) NONE\\nChoice \[1\]\:: "4"
(?i)Specify number of processors to use for parallel operations \(max.+$: {{smrt_procs}}
timeout: 300
become: yes
become_user: "{{smrt_user}}"
- name: Run SMRT
command: $SMRT_ROOT/admin/bin/smrtportald-initd start
become: yes
become_user: "{{smrt_user}}"
- name: Run SMRT
command: $SMRT_ROOT/admin/bin/kodosd start
become: yes
become_user: "{{smrt_user}}"
# Message incase application gets stuck in loop because of unanswered question caught by another regular expression.
- name: Message
vars:
msg: |
Installation complete application is running on port {{smrt_port}}
debug:
msg: "{{ msg.split('\n') }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment