DB Serverinitialisierung

This commit is contained in:
aschwarz
2022-11-18 14:38:03 +01:00
parent 4fc5120f41
commit 929fb55cc8
447 changed files with 772 additions and 31178 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

44
roles/filesystem/files/psc.sh Executable file
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-14.1.4.0/service/rsAmsBvService.status ]
then
BVS="DOWN"
else
BVS=$(cat $AMSHOME/linux/webclient-services/rsAmsBvService-14.1.4.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

25
roles/filesystem/files/startALL Executable file
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-14.1.4.0/service/rsAmsBvService.status ]
then
echo "BV-Service is already running!"
else
/opt/rola/ams/linux/webclient-services/rsAmsBvService-14.1.4.0/service/rsAmsBvService.sh start;
fi
./psc.sh

25
roles/filesystem/files/stopALL Executable file
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-14.1.4.0/service/rsAmsBvService.status ]
then
echo "BV-Service not running!"
else
$AMSHOME/linux/webclient-services/rsAmsBvService-14.1.4.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,60 @@
---
- name: Copy file bash_profile
copy:
src: /home/aschwarz/.bash_profile
dest: /home/aschwarz/.bash_profile_orig
owner: aschwarz
group: aschwarz
mode: '0644'
- name: Extents the profile aschwarz
blockinfile:
path: /home/aschwarz/.bash_profile
block: |
echo $DISPLAY > ~/display
sudo chmod 777 ~/display
sudo chown oracle:dba display
sudo cp ~/.Xauthority /home/oracle/
sudo cp ~/display /home/oracle
clear
echo
echo "Verfuegbare Umgebungen"
echo
echo 1 - ORACLE
echo 2 - ROOT
echo 3 - USER
echo
read -p "Bitte Eingabe machen: " option
case "$option" in
1) clear
sudo -u oracle -i
exit;;
2) sudo -i
exit;;
3) ;;
esac
# - name: Chanddge passwd for oracle
# user:
# state: "present"
# user: "oracle"
# password:
- name: Creates directory /opt/oracle
file:
path: /opt/oracle
state: directory
recurse: yes
owner: oracle
group: dba
- name: Creates directory /oradata
file:
path: /oradata
state: directory
recurse: yes
owner: oracle
group: dba
- name: Creates directory /oraarch
file:
path: /oraarch
state: directory
recurse: yes
owner: oracle
group: dba

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