ElaoInfra.git

Ansible Role Platforms License

Ansible役割: GIT

この役割は、以下のことでGITのセットアップと構成を担当します。

  • GITパッケージのインストール
  • gitconfigファイルの設定
  • giconfigファイルの設定を許可

これはELAOのAnsibleスタックの一部ですが、単独のコンポーネントとしても使用できます。

要件

  • Ansible 1.9.0以上

依存関係

なし。

インストール

Ansible 2+

ansible galaxy CLIを使用する場合:

ansible-galaxy install elao.git,2.0

ansible galaxy要件ファイルを使用する場合:

- src:     elao.git
  version: 2.0

Ansible 1(もはや維持管理されていません)

ansible galaxy CLIを使用する場合:

ansible-galaxy install elao.git,1.0

ansible galaxy要件ファイルを使用する場合:

- src:     elao.git
  version: 1.0

役割ハンドラ

なし

役割変数

名称 デフォルト 種類 説明
elao_git_config_file /etc/gitconfig 文字列(パス) 設定ファイルのパス
elao_git_config_template config/empty.j2 文字列(パス) 設定テンプレートのパス
elao_git_config [] 配列 git設定オプションのリスト
elao_git_repositories [] 配列 チェックアウトするリポジトリのリスト

GIT設定

elao_git_config_fileキーを使用して、設定ファイルのパスを指定できます。

例:

---

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

elao_git_config_templateキーを使用すると、異なる主な設定テンプレートを使用できます。この役割には基本的なテンプレートが含まれています:

  • base(デフォルト設定のないシンプルなテンプレート)
  • dev(Vagrant VM用のオプションを提供する設定)
  • test
  • prod(本番用。軽量な設定テンプレート)

GITに詳しいユーザーは、elao_git_config_templateキーを使用して独自のカスタムテンプレートを提供できます。

elao_git_configキーは、次のようなgit設定キーを定義できます:

例:

---

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

必要なリポジトリの自動チェックアウト

elao_git_repositoriesキーは「特別なもの」で、指定されたリポジトリの自動チェックアウトを許可するために設計されています。

変数

名称 デフォルト 種類 説明
repo ~ (必須) 文字列 git、SSH、またはHTTPプロトコルのリポジトリのアドレス
dest ~ (必須) 文字列 リポジトリをチェックアウトする絶対パス
version HEAD 文字列 チェックアウトするリポジトリのバージョン
update true ブール値 いいえの場合、元のリポジトリから新しいリビジョンを取得しない

例:

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

例のプレイブック

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

ライセンス

MIT

著者情報

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

プロジェクトについて

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

インストール
ansible-galaxy install ElaoInfra.git
ライセンス
Unknown
ダウンロード
518
所有者
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