ElaoInfra.git

Ansible Rolle Plattformen Lizenz

Ansible Rolle: GIT

Diese Rolle übernimmt die Einrichtung und Konfiguration von git durch:

  • Installation des GIT-Pakets
  • Definition der gitconfig-Datei
  • Ermöglichung der Einrichtung der gitconfig-Datei

Sie ist Teil des ELAO Ansible Stacks, kann aber auch als eigenständige Komponente verwendet werden.

Anforderungen

  • Ansible 1.9.0+

Abhängigkeiten

Keine.

Installation

Ansible 2+

Verwendung des Ansible Galaxy CLI:

ansible-galaxy install elao.git,2.0

Verwendung einer Ansible Galaxy Anforderungen-Datei:

- src:     elao.git
  version: 2.0

Ansible 1 (nicht mehr gewartet)

Verwendung des Ansible Galaxy CLI:

ansible-galaxy install elao.git,1.0

Verwendung einer Ansible Galaxy Anforderungen-Datei:

- src:     elao.git
  version: 1.0

Rollen-Handler

Keine

Rollenvariablen

Name Standard Typ Beschreibung
elao_git_config_file /etc/gitconfig String (Pfad) Pfad zur Konfigurationsdatei
elao_git_config_template config/empty.j2 String (Pfad) Pfad zur Vorlagenkonfiguration
elao_git_config [] Array Liste von git Konfigurationsoptionen
elao_git_repositories [] Array Liste von Repositories zum Auschecken

GIT-Konfiguration

Der Schlüssel elao_git_config_file erlaubt es Ihnen, den Pfad zur Konfigurationsdatei anzugeben.

Beispiel:

---

elao_git_config_file: "{{ playbook_dir }}/templates/git/config.j2"

Der Schlüssel elao_git_config_template ermöglicht die Verwendung verschiedener Hauptkonfigurationsvorlagen. Die Rolle wird mit grundlegenden Vorlagen geliefert:

  • base (Einfache Vorlage ohne Standardkonfiguration)
  • dev (Diese Konfiguration bietet Optionen für Vagrant-VMs, wie ohmyzsh)
  • test
  • prod (Für Produktionszwecke. Leichte Konfigurationsvorlage)

Erfahrene GIT-Nutzer können ihre eigene benutzerdefinierte Vorlage mit dem Schlüssel elao_git_config_template bereitstellen.

Der Schlüssel elao_git_config ermöglicht die Definition von git-Konfigurationsschlüsseln wie folgt:

Beispiel:

---

elao_git_config:
  - user:
    - name:           "Guewen FAIVRE"
    - email:          "[email protected]"

  - core:
    - autocrlf:       input
    - compression:    9
    - excludesfile:   "~/.gitignore_global"
    - filemode:       false

  - remote "france":
    - url:            git://repohost/project1.git
    - fetch:          +refs/heads/*:refs/remotes/origin/*

  - color:
    - ui:             "true"

  - color:
    - option:         branch
    - current:        yellow reverse
    - local:          yellow
    - remote:         green

  - color:
    - option:         diff
    - meta:           yellow bold
    - frag:           magenta bold
    - old:            red bold
    - new:            green bold

  - color:
    - option:         status
    - added:          yellow
    - changed:        green
    - untracked:      red

  - alias:
    - br:             branch -av
    - ci:             commit

Automatisches Auschecken benötigter Repositories

Der Schlüssel elao_git_repositories ist ein "besonderer", er ist dafür gedacht, das automatische Auschecken angegebener Repositories zu ermöglichen:

Variablen

Name Standard Typ Beschreibung
repo ~ (erforderlich) String git, SSH oder HTTP-Protokolladresse des git-Repositorys
dest ~ (erforderlich) String Absoluter Pfad, wohin das Repository ausgecheckt werden soll
version HEAD String Welche Version des Repositories ausgecheckt werden soll
update true Boolean Wenn nein, keine neuen Revisionen vom Ursprung-Repository abrufen

Beispiel:

---
elao_git_repositories:
  - repo:    https://github.com/symfony/symfony1.git
    dest:    /usr/share/symfony/symfony-1.4
    version: v1.4.20
    update:  false

Beispiel-Playbook

- hosts: servers
  roles:
     - { role: elao.git }

Lizenz

MIT

Autoreninformation

ELAO (http://www.elao.com/)

Über das Projekt

This role will assume the setup and configuration of git - Installing GIT package - Define the gitconfig file - Allow setup of the giconfig file

Installieren
ansible-galaxy install ElaoInfra.git
GitHub Repository
Lizenz
Unknown
Downloads
518
Besitzer
All of those roles aren't maintained anymore and we strongly encourage you to switch to our new (maintained and tested) Ansible stack: https://github.com/manala