Intitiales Befüllen

This commit is contained in:
Marcus Gillitzer
2020-01-24 11:43:21 +01:00
commit c859c3accb
83 changed files with 5601 additions and 0 deletions

View File

@ -0,0 +1,29 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@ -0,0 +1,39 @@
Role Name
=========
Hiermit werden bei AMS die Grundinstallation angestossen. Dh. dass zb. das bash_profile eingefügt wird, die Log-Ordner werden erstellt, die start/-stopALL-Skripte mit psc.sh werden erstellt etc.
Requirements
------------
Keine.
Role Variables
--------------
Keine.
Dependencies
------------
Keine.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- base_installation
License
-------
BSD
Author Information
------------------
M. Gillitzer, Version 0.1

View File

@ -0,0 +1,2 @@
---
# defaults file for default_role

View File

@ -0,0 +1,29 @@
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
set -u
trap "echo 'logout'" 0
stty erase ^?
# Set up the shell variables:
EDITOR=vi
export EDITOR
/home/jetty/psc.sh

View File

@ -0,0 +1,44 @@
#!/usr/bin/bash
AMSHOME="/opt/rola/ams"
if [ ! -f $AMSHOME/linux/Appserver/service/rsWebserviceAppserver.status ]
then
APPS="DOWN"
else
APPS=$(cat $AMSHOME/linux/Appserver/service/rsWebserviceAppserver.status)
fi
#Check for Webservice
if [ ! -f $AMSHOME/linux/Services/service/rsWebserviceImp20.status ]
then
WEBS="DOWN"
else
WEBS=$(cat $AMSHOME/linux/Services/service/rsWebserviceImp20.status)
fi
#Check for BV-Service
if [ ! -f $AMSHOME/linux/webclient-services/rsAmsBvService-8.0.8.0/service/rsAmsBvService.status ]
then
BVS="DOWN"
else
BVS=$(cat $AMSHOME/linux/webclient-services/rsAmsBvService-8.0.8.0/service/rsAmsBvService.status)
fi
#Anzeige
printf "\n \e[33m\t\t\tAppserver und Services\e[0m \n\n\n"
if [[ $APPS = "STARTED" ]]
then
printf "\t\tAppserver\t\e[32m%s\e[0m \n\n\n" "$APPS"
else
printf "\t\tAppserver\t\e[31m%s\e[0m \n\n\n" "$APPS"
fi
if [[ $WEBS = "STARTED" ]]
then
printf "\t\tWebservice\t\e[32m%s\e[0m \n\n\n" "$WEBS"
else
printf "\t\tWebservice\t\e[31m%s\e[0m \n\n\n" "$WEBS"
fi
if [[ $BVS = "STARTED" ]]
then
printf "\t\tBV-Service\t\e[32m%s\e[0m \n\n\n" "$BVS"
else
printf "\t\tBV-Service\t\e[31m%s\e[0m \n\n\n" "$BVS"
fi

View File

@ -0,0 +1,25 @@
#!/usr/bin/bash
AMSHOME="/opt/rola/ams"
if [ -f $AMSHOME/linux/Appserver/service/rsWebserviceAppserver.status ]
then
echo "Appserver is already running!"
else
/opt/rola/ams/linux/Appserver/service/rsWebserviceAppserver.sh start;
fi
#Check for Webservice
if [ -f $AMSHOME/linux/Services/service/rsWebserviceImp20.status ]
then
echo "Webservice is already running!"
else
/opt/rola/ams/linux/Services/service/rsWebserviceImp20.sh start;
fi
#Check for BV-Service
if [ -f $AMSHOME/linux/webclient-services/rsAmsBvService-8.0.8.0/service/rsAmsBvService.status ]
then
echo "BV-Service is already running!"
else
/opt/rola/ams/linux/webclient-services/rsAmsBvService-8.0.8.0/service/rsAmsBvService.sh start;
fi
./psc.sh

View File

@ -0,0 +1,25 @@
#!/usr/bin/bash
AMSHOME="/opt/rola/ams"
if [ ! -f $AMSHOME/linux/Appserver/service/rsWebserviceAppserver.status ]
then
echo "Appserver not running!"
else
$AMSHOME/linux/Appserver/service/rsWebserviceAppserver.sh stop;
fi
#Check for Webservice
if [ ! -f $AMSHOME/linux/Services/service/rsWebserviceImp20.status ]
then
echo "Webservice not running!"
else
$AMSHOME/linux/Services/service/rsWebserviceImp20.sh stop;
fi
#Check for BV-Service
if [ ! -f $AMSHOME/linux/webclient-services/rsAmsBvService-8.0.8.0/service/rsAmsBvService.status ]
then
echo "BV-Service not running!"
else
$AMSHOME/linux/webclient-services/rsAmsBvService-8.0.8.0/service/rsAmsBvService.sh stop;
fi
./psc.sh

View File

@ -0,0 +1,2 @@
---
# handlers file for default_role

View File

@ -0,0 +1,60 @@
galaxy_info:
author: your name
description: your description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 2.4
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View File

@ -0,0 +1,75 @@
---
- name: Copy file bash_profile with owner and permissions bash_profile
copy:
src: ./files/bash_profile
dest: /home/jetty/.bash_profile
owner: jetty
group: dba
mode: '0644'
- name: Create a directory /opt/tmp if it does not exist
become: yes
become_user: root
file:
path: /opt/tmp
state: directory
mode: '0755'
owner: jetty
group: dba
- name: Create a directory "{{ LOG_DIR }}/appserver" if it does not exist
become: yes
become_user: root
file:
path: "{{ LOG_DIR }}/appserver"
state: directory
mode: '0755'
owner: jetty
group: dba
- name: Create a directory "{{ LOG_DIR }}/bvservice" if it does not exist
become: yes
become_user: root
file:
path: "{{ LOG_DIR }}/bvservice"
state: directory
mode: '0755'
owner: jetty
group: dba
- name: Create a directory "{{ LOG_DIR }}/webservice" if it does not exist
become: yes
become_user: root
file:
path: "{{ LOG_DIR }}/webservice"
state: directory
mode: '0755'
owner: jetty
group: dba
- name: Create a directory "{{ ACCESS_LOG }}" if it does not exist
become: yes
become_user: root
file:
path: "{{ ACCESS_LOG }}"
state: directory
mode: '0755'
owner: jetty
group: dba
- name: Copy file psc.sh with owner and permissions
copy:
src: ./files/psc.sh
dest: /home/jetty/psc.sh
owner: jetty
group: dba
mode: '0755'
- name: Copy file startALL with owner and permissions
copy:
src: ./files/startALL
dest: /home/jetty/startALL
owner: jetty
group: dba
mode: '0755'
- name: Copy file stopALL with owner and permissions
copy:
src: ./files/stopALL
dest: /home/jetty/stopALL
owner: jetty
group: dba
mode: '0755'

View File

@ -0,0 +1,2 @@
localhost

View File

@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- default_role

View File

@ -0,0 +1,2 @@
---
# vars file for default_role