diff --git a/group_vars/qs.yml b/group_vars/qs.yml new file mode 100644 index 0000000..2d67e82 --- /dev/null +++ b/group_vars/qs.yml @@ -0,0 +1,20 @@ +--- +#aus /templates/pwd_Appserver.xml.j2 + /templates/pwd_ServiceIMP.xml.j2 + +## hier ist noch die DB der AMSE eingetragen, da die DBAler noch +## keine DB zum Zeitpunkt deeer Installation hatten 20200507 GI. + ams_DatabaseIPAdress: vip-amsqs.tpolizei-bw.de + ams_DatabasePort: 1532 + ams_DatabaseServiceName: AMSQS + ams_DatabaseName: AMS QS + ams_LogLevel: DEBUG + + sso_host: "Host *.TPOLIZEI-BW.DE" + sso_domain_upper: "TPOLIZEI-BW.DE" + sso_domain_lower: "tpolizei-bw.de" + + + + + + diff --git a/qs/hosts b/qs/hosts new file mode 100644 index 0000000..e3ba2a9 --- /dev/null +++ b/qs/hosts @@ -0,0 +1,17 @@ +# This is the default ansible 'hosts' file. +# +# It should live in /etc/ansible/hosts +# +# - Comments begin with the '#' character +# - Blank lines are ignored +# - Groups of hosts are delimited by [header] elements +# - You can enter hostnames or ip addresses +# - A hostname/ip can be a member of multiple groups + +# Ex 1: Ungrouped hosts, specify before any group headers. + +[qs] +80.155.206.80 + + + diff --git a/roles/base_installation/tasks/main.yml b/roles/base_installation/tasks/main.yml index 7a62141..9997b9c 100644 --- a/roles/base_installation/tasks/main.yml +++ b/roles/base_installation/tasks/main.yml @@ -6,6 +6,15 @@ owner: jetty group: dba mode: '0644' + - name: Create a directory /opt/rola if it does not exist + become: yes + become_user: root + file: + path: /opt/rola + state: directory + mode: '0755' + owner: jetty + group: dba - name: Create a directory /opt/tmp if it does not exist become: yes become_user: root diff --git a/roles/git/README.md b/roles/git/README.md index efebd1c..8a33243 100644 --- a/roles/git/README.md +++ b/roles/git/README.md @@ -2,10 +2,12 @@ Role Name ========= 1. Installiert git auf dem System. -2. Kopiert .gitignore nach /opt/rola +2. Kopiert .gitignore nach {{ path_init }} 3. Initiiert ein Git-Repository -Aber: git add . + git commit fehlt noch!!!!!!!!!!!!!!!!!!!!!!!! +Aktuell wird beim prüfen, ob schon ein .git-Ordner vorhanden ist noch ein Fehler geworfen wenn der Ordner NICHT da ist, aber +der Fehler wird dann übersprungen. +Vielleicht gibt es noch eine bessere Lösung? Requirements @@ -16,7 +18,12 @@ RHEL 7, x86-64 Role Variables -------------- -Keine. +Folgende Variablen sind im Default-Ordner vorhanden: + + +path_init="/opt/rola" +user_name="jetty" +user_group="dba" Dependencies @@ -33,6 +40,9 @@ Including an example of how to use your role (for instance, with variables passe - hosts: all roles: - git + path_init: "/opt/oracle" + user_name: "wls2" + user_group: "dba" License ------- @@ -42,4 +52,4 @@ BSD Author Information ------------------ -Marcus Gillitzer Version 0.1 +Marcus Gillitzer Version 0.2 diff --git a/roles/git/defaults/main.yml b/roles/git/defaults/main.yml index 4db8f11..ef32bc1 100644 --- a/roles/git/defaults/main.yml +++ b/roles/git/defaults/main.yml @@ -1,2 +1,5 @@ --- -# defaults file for default_role \ No newline at end of file +# defaults file for default_role +path_init: "/opt/rola" +user_name: "jetty" +user_group: "dba" diff --git a/roles/git/files/.gitignore b/roles/git/files/gitignore similarity index 100% rename from roles/git/files/.gitignore rename to roles/git/files/gitignore diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index b61b476..1ae4fc8 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -9,20 +9,31 @@ - name: Copy file .gitignore with owner and permissions copy: - src: ./files/.gitignore - dest: /opt/rola/.gitignore - owner: jetty - group: dba + src: ./files/gitignore + dest: "{{ path_init }}/.gitignore" + owner: "{{ user_name }}" + group: "{{ user_group }}" mode: '0644' + + - name: check if {{ path_init }}/.git exists + shell: ls -ld {{ path_init }}/.git + register: result + ignore_errors: true + + - debug: + msg: "{{ result }}" - - name: Initialisiere leeres Repo innerhalb von /opt/rola - command: git init /opt/rola/ - -# Mehr habe ich nicht gemacht, -# git add . -# git commit -# habe ich händisch ausgeführt - + - name: Initialisiere leeres Repo innerhalb von {{ path_init }} + command: git init {{ path_init }}/ + when: result.stdout == '' + + - name: commit changes to git + shell: | + git add . + git -c user.name='{{ user_name }} Playbook' -c user.email='{{ user_name }}@playbook' commit -m "Initialisiere GIT" + exit 0 + args: + chdir: "{{ path_init }}" diff --git a/site.retry b/site.retry index 777c1c1..3fd0fc0 100644 --- a/site.retry +++ b/site.retry @@ -1 +1 @@ -80.155.206.72 +80.155.206.80 diff --git a/site.yml b/site.yml index 591c294..7b8ed44 100644 --- a/site.yml +++ b/site.yml @@ -11,12 +11,29 @@ become: yes roles: - #- base_installation + #- base_installation + #- git #- ams_0008_8.0.8.0 #- ams_sso #- ams_0008_8.0.8.0_AdminServer - ams_0013_8.0.9.0 + +########################################################## +######### QS ############## +########################################################## +- name: Installation für QS-Umgebung + hosts: qs + become_user: jetty + become: yes + + roles: + #- base_installation + #- git + #- ams_0008_8.0.8.0 + #- ams_sso + #- ams_0008_8.0.8.0_AdminServer + - ams_0013_8.0.9.0