Default-Variablen für git eingebaut für modulare Benutztung
This commit is contained in:
parent
af45db42dd
commit
861fc283ef
@ -2,10 +2,12 @@ Role Name
|
|||||||
=========
|
=========
|
||||||
|
|
||||||
1. Installiert git auf dem System.
|
1. Installiert git auf dem System.
|
||||||
2. Kopiert .gitignore nach /opt/rola
|
2. Kopiert .gitignore nach {{ path_init }}
|
||||||
3. Initiiert ein Git-Repository
|
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
|
Requirements
|
||||||
@ -16,7 +18,12 @@ RHEL 7, x86-64
|
|||||||
Role Variables
|
Role Variables
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Keine.
|
Folgende Variablen sind im Default-Ordner vorhanden:
|
||||||
|
|
||||||
|
|
||||||
|
path_init="/opt/rola"
|
||||||
|
user_name="jetty"
|
||||||
|
user_group="dba"
|
||||||
|
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
@ -33,6 +40,9 @@ Including an example of how to use your role (for instance, with variables passe
|
|||||||
- hosts: all
|
- hosts: all
|
||||||
roles:
|
roles:
|
||||||
- git
|
- git
|
||||||
|
path_init: "/opt/oracle"
|
||||||
|
user_name: "wls2"
|
||||||
|
user_group: "dba"
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
@ -42,4 +52,4 @@ BSD
|
|||||||
Author Information
|
Author Information
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
Marcus Gillitzer Version 0.1
|
Marcus Gillitzer Version 0.2
|
||||||
|
@ -1,2 +1,5 @@
|
|||||||
---
|
---
|
||||||
# defaults file for default_role
|
# defaults file for default_role
|
||||||
|
path_init="/opt/rola"
|
||||||
|
user_name="jetty"
|
||||||
|
user_group="dba"
|
||||||
|
@ -10,30 +10,30 @@
|
|||||||
- name: Copy file .gitignore with owner and permissions
|
- name: Copy file .gitignore with owner and permissions
|
||||||
copy:
|
copy:
|
||||||
src: ./files/.gitignore
|
src: ./files/.gitignore
|
||||||
dest: /opt/rola/.gitignore
|
dest: {{ path_init }}/.gitignore
|
||||||
owner: jetty
|
owner: {{ user_name }}
|
||||||
group: dba
|
group: {{ user_group }}
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
|
|
||||||
- name: check if /opt/rola/.git exists
|
- name: check if {{ path_init }}/.git exists
|
||||||
shell: ls -ld /opt/rola/.git
|
shell: ls -ld {{ path_init }}/.git
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: "{{ result }}"
|
msg: "{{ result }}"
|
||||||
|
|
||||||
- name: Initialisiere leeres Repo innerhalb von /opt/rola
|
- name: Initialisiere leeres Repo innerhalb von {{ path_init }}
|
||||||
command: git init /opt/rola/
|
command: git init {{ path_init }}/
|
||||||
when: result.stdout == ''
|
when: result.stdout == ''
|
||||||
|
|
||||||
- name: commit changes to git
|
- name: commit changes to git
|
||||||
shell: |
|
shell: |
|
||||||
git add .
|
git add .
|
||||||
git -c user.name='Ansible Playbook' -c user.email='ansible@playbook' commit -m "Initialisiere_Basis_AMS"
|
git -c user.name='{{ user_name }} Playbook' -c user.email='{{ user_name }}@playbook' commit -m "Initialisiere GIT"
|
||||||
exit 0
|
exit 0
|
||||||
args:
|
args:
|
||||||
chdir: "/opt/rola"
|
chdir: "{{ path_init }}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user