From f0e691fa132e0c2ce998e8665c93809783f49836 Mon Sep 17 00:00:00 2001 From: Shane Poage Date: Tue, 1 Sep 2015 16:28:27 -0500 Subject: [PATCH] Fixed conflict with git-formula by allowing either inclusion of formula to install git dependency or specify a package name to install with a custom state ID. --- salt/defaults.yaml | 4 ++++ salt/gitfs/pygit2.sls | 10 ++++++++-- salt/map.jinja | 10 +++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/salt/defaults.yaml b/salt/defaults.yaml index 1e345ca..1a7fa7a 100644 --- a/salt/defaults.yaml +++ b/salt/defaults.yaml @@ -29,6 +29,10 @@ salt: pygit2: install_from_source: True version: 0.23.0 + git: + # if not false, should be state name + require_state: False + install_from_package: git libgit2: version: 0.23.0 install_from_source: True diff --git a/salt/gitfs/pygit2.sls b/salt/gitfs/pygit2.sls index 1a8341a..9fce72b 100644 --- a/salt/gitfs/pygit2.sls +++ b/salt/gitfs/pygit2.sls @@ -1,8 +1,14 @@ {% from "salt/map.jinja" import salt_settings with context %} {% set pygit2_settings = salt_settings.gitfs.pygit2 %} -git: - pkg.installed +{% if pygit2_settings.git.get('require_state', False) %} +include: + - {{ pygit2_settings.git.require_state }} +{% elif pygit2_settings.git.get('install_from_package', 'git') %} +pygit2-git: + pkg.installed: + - name: {{ pygit2_settings.git.install_from_package }} +{% endif %} {% if pygit2_settings.install_from_source %} {% set libgit2_settings = pygit2_settings.libgit2 %} diff --git a/salt/map.jinja b/salt/map.jinja index 027e9ee..3ee36c1 100644 --- a/salt/map.jinja +++ b/salt/map.jinja @@ -15,6 +15,10 @@ that differ from whats in defaults.yaml 'pygit2': { 'install_from_source': True, 'version': '0.22.1', + 'git': { + 'require_state': False, + 'install_from_package': 'git', + }, 'libgit2': { 'install_from_source': False, }, @@ -25,7 +29,11 @@ that differ from whats in defaults.yaml 'pygit2': 'python-pygit2', 'gitfs': { 'pygit2': { - 'install_from_source': False, + 'install_from_source': False, + 'git': { + 'require_state': False, + 'install_from_package': 'git', + }, }, }, 'master': {