Default-Variablen für git eingebaut für modulare Benutztung

This commit is contained in:
Marcus Gillitzer
2020-05-13 16:13:25 +02:00
parent af45db42dd
commit 861fc283ef
3 changed files with 27 additions and 14 deletions

View File

@ -10,30 +10,30 @@
- name: Copy file .gitignore with owner and permissions
copy:
src: ./files/.gitignore
dest: /opt/rola/.gitignore
owner: jetty
group: dba
dest: {{ path_init }}/.gitignore
owner: {{ user_name }}
group: {{ user_group }}
mode: '0644'
- name: check if /opt/rola/.git exists
shell: ls -ld /opt/rola/.git
- 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/
- 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='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
args:
chdir: "/opt/rola"
chdir: "{{ path_init }}"