Merge pull request #44 from westurner/add_install_from_ppa
BUG: pkgrepo.absent, pkgrepo:watch_in(pkg), install_from_ppa
This commit is contained in:
commit
90c539de8c
@ -5,10 +5,30 @@
|
|||||||
{% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
|
{% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
|
||||||
|
|
||||||
nginx_install:
|
nginx_install:
|
||||||
{% if nginx.from_source %}
|
{% if nginx.install_from_source %}
|
||||||
## add source compilation here
|
## add source compilation here
|
||||||
{% else %}
|
{% else %}
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
{{ sls_block(nginx.package.opts) }}
|
{{ sls_block(nginx.package.opts) }}
|
||||||
- name: {{ nginx.lookup.package }}
|
- name: {{ nginx.lookup.package }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if salt['grains.get']('os_family') == 'Debian' %}
|
||||||
|
nginx_ppa_repo:
|
||||||
|
pkgrepo:
|
||||||
|
{%- if nginx.install_from_ppa %}
|
||||||
|
- managed
|
||||||
|
{%- else %}
|
||||||
|
- absent
|
||||||
|
{%- endif %}
|
||||||
|
- humanname: nginx-ppa-{{ grains['oscodename'] }}
|
||||||
|
- name: deb http://ppa.launchpad.net/nginx/stable/ubuntu {{ grains['oscodename'] }} main
|
||||||
|
- file: /etc/apt/sources.list.d/nginx-stable-{{ grains['oscodename'] }}.list
|
||||||
|
- dist: {{ grains['oscodename'] }}
|
||||||
|
- keyid: C300EE8C
|
||||||
|
- keyserver: keyserver.ubuntu.com
|
||||||
|
- require_in:
|
||||||
|
- pkg: nginx_install
|
||||||
|
- watch_in:
|
||||||
|
- pkg: nginx_install
|
||||||
|
{% endif %}
|
||||||
|
@ -25,7 +25,8 @@
|
|||||||
'vhost_use_symlink': False,
|
'vhost_use_symlink': False,
|
||||||
},
|
},
|
||||||
}, default='Debian' ),
|
}, default='Debian' ),
|
||||||
'from_source': False,
|
'install_from_source': False,
|
||||||
|
'install_from_ppa': False,
|
||||||
'package': {
|
'package': {
|
||||||
'opts': {},
|
'opts': {},
|
||||||
},
|
},
|
||||||
|
@ -16,6 +16,6 @@ nginx_service:
|
|||||||
- require:
|
- require:
|
||||||
- sls: nginx.ng.install
|
- sls: nginx.ng.install
|
||||||
- watch:
|
- watch:
|
||||||
{% if not nginx.from_source %}
|
{% if not nginx.install_from_source %}
|
||||||
- pkg: nginx_install
|
- pkg: nginx_install
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{% from "nginx/map.jinja" import nginx with context %}
|
||||||
{% set use_upstart = pillar.get('nginx', {}).get('use_upstart', true) %}
|
{% set use_upstart = pillar.get('nginx', {}).get('use_upstart', true) %}
|
||||||
{% if use_upstart %}
|
{% if use_upstart %}
|
||||||
nginx-old-init:
|
nginx-old-init:
|
||||||
@ -35,9 +36,29 @@ nginx-old-init-disable:
|
|||||||
- file: nginx-old-init
|
- file: nginx-old-init
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if salt['grains.get']('os_family') == 'Debian' %}
|
||||||
|
nginx-ppa-repo:
|
||||||
|
pkgrepo:
|
||||||
|
{%- if nginx.install_from_ppa %}
|
||||||
|
- managed
|
||||||
|
{%- else %}
|
||||||
|
- absent
|
||||||
|
{%- endif %}
|
||||||
|
- humanname: nginx-ppa-{{ grains['oscodename'] }}
|
||||||
|
- name: deb http://ppa.launchpad.net/nginx/stable/ubuntu {{ grains['oscodename'] }} main
|
||||||
|
- file: /etc/apt/sources.list.d/nginx-stable-{{ grains['oscodename'] }}.list
|
||||||
|
- dist: {{ grains['oscodename'] }}
|
||||||
|
- keyid: C300EE8C
|
||||||
|
- keyserver: keyserver.ubuntu.com
|
||||||
|
- require_in:
|
||||||
|
- pkg: nginx
|
||||||
|
- watch_in:
|
||||||
|
- pkg: nginx
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- name: nginx
|
- name: {{ nginx.package }}
|
||||||
{% if use_upstart %}
|
{% if use_upstart %}
|
||||||
file:
|
file:
|
||||||
- managed
|
- managed
|
||||||
|
Loading…
Reference in New Issue
Block a user