Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/csh
### Include SMF Library
. /lib/svc/share/smf_include.sh
switch ($argv[1])
case 'start':
### Check exit status of FSC STATUS command
@Sicnus
Sicnus / gist:8afcb4e2134c06073dbe963fc44f9848
Created June 19, 2019 12:38
[Broken] SMF service for starting / stopping jboss.
#!/usr/bin/bash
set -xv
. /lib/svc/share/smf_include.sh
case "$1" in
'start')
# rotate jboss logs
mv /export/home/jboss/standalone/log/server.log /export/home/jboss/standalone/log/server.log_$(date +%Y%m%d-%H%M)
# start jboss
/export/home/jboss/bin/standalone.sh &
@Sicnus
Sicnus / gist:6dab954fba39211d3e37f4f8903552d4
Created June 6, 2019 12:46
success output is bland... (no indication really if successful)
- name: cat fsc log and grep for 'successful' // register result
become: true
become_user: root
shell: |-
ps -ef | grep FSC | grep -v grep
register: did_fsc_start
tags: status
- name: fsc running?
fail:
- name: Start Script
become: true
become_user: scriptuser
shell: |-
somescript.sh &
args:
executable: /usr/bin/csh
chdir: /export/home/scriptuser/bin
register: foo
until: foo.stdout is search ('started in')
@Sicnus
Sicnus / gist:45945fc474a01504b2678c373f151205
Created June 3, 2019 18:21
Copy file from remote host to localhost and back to a different server (Broken)
---
- name: Run the foo report
hosts: 10.1.1.20
gather_facts: true
tasks:
- name: Register files in a folder
become: true
become_user: foo
find:
@Sicnus
Sicnus / gist:0c723ccab208c406276ea122252f55bb
Created May 30, 2019 18:27
playbook to get env variables of csh
---
- name: Get CSH ENV
hosts: 10.1.1.20
gather_facts: true
tasks:
- name: gather env
become: true
become_user: mycshuser
shell: |-
env
@Sicnus
Sicnus / gist:7850c157a9c8444996278e84441561ba
Last active May 30, 2019 13:46
broken latest report fetch playbook
---
- name: Grab the latest report
hosts: 10.1.1.20
gather_facts: true
tasks:
- name: Get files in a folder
become: true
become_user: report_user
find:
paths: "/export/home/report_user/jobs/app/reports/"
@Sicnus
Sicnus / gist:735ef37b5fb43ecb72036c6d9b47ea7e
Created May 21, 2019 13:25
Start Teamcenter (FSC & Pool Manager) w/ JBoss
---
- name: Start testdev Teamcenter
hosts: 10.1.1.50
tasks:
# Ensure all procs have been killed if they were running previously...
- name: kill all testdev and jboss procs
shell: |-
pkill -9 -u testdev && pkill -9 -u jboss
ignore_errors: True
# Commands I use to add to git...
1992 git add .
1993 git commit -m "adding toarchdev-tc playbook"
1994 gupd
1995 gpush
# Aliases used...
zeedo@uzbook:~$ alias gupd
alias gupd='git_update'
zeedo@uzbook:~$ alias gpush
@Sicnus
Sicnus / gist:3618d7e76b1f31e3752af4f45c5e88f8
Created May 20, 2019 13:03
error running playbook...
---
- name: Start Teamcenter
hosts: 192.168.131.65
become: true
become_user: testdev
shell: | -
./tcdata/tc_cshvars
./ccbin/fsc.sh
args:
chdir: /export/home/testdev/