Compare commits
5 Commits
master
...
libertacas
Author | SHA1 | Date | |
---|---|---|---|
b38ad00f9f | |||
945f2958e3 | |||
b4804e40fe | |||
78d4f26c8f | |||
23df36ded9 |
@ -72,7 +72,8 @@
|
|||||||
'server_use_symlink': False,
|
'server_use_symlink': False,
|
||||||
'pid_file': '/run/nginx.pid',
|
'pid_file': '/run/nginx.pid',
|
||||||
'gpg_check': True,
|
'gpg_check': True,
|
||||||
'gpg_key': 'http://download.opensuse.org/repositories/server:/http/openSUSE_{{ grains.osrelease }}/repodata/repomd.xml.key',
|
'gpg_key': 'http://download.opensuse.org/repositories/server:/http/{{ grains.osrelease }}/repodata/repomd.xml.key',
|
||||||
|
'gpg_autoimport': True,
|
||||||
'openssl_package': 'openssl',
|
'openssl_package': 'openssl',
|
||||||
},
|
},
|
||||||
'Arch': {
|
'Arch': {
|
||||||
@ -115,6 +116,7 @@
|
|||||||
'install_from_ppa': False,
|
'install_from_ppa': False,
|
||||||
'install_from_repo': False,
|
'install_from_repo': False,
|
||||||
'install_from_phusionpassenger': False,
|
'install_from_phusionpassenger': False,
|
||||||
|
'install_from_opensuse_devel': False,
|
||||||
'check_config_before_apply': False,
|
'check_config_before_apply': False,
|
||||||
'ppa_version': 'stable',
|
'ppa_version': 'stable',
|
||||||
'source_version': '1.10.0',
|
'source_version': '1.10.0',
|
||||||
@ -152,7 +154,7 @@
|
|||||||
'include': [
|
'include': [
|
||||||
'mime.types',
|
'mime.types',
|
||||||
'conf.d/*.conf',
|
'conf.d/*.conf',
|
||||||
'sites-enabled/*',
|
'vhosts.d/*.conf',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -11,18 +11,27 @@
|
|||||||
{% set from_official = true %}
|
{% set from_official = true %}
|
||||||
{% set from_ppa = false %}
|
{% set from_ppa = false %}
|
||||||
{% set from_phusionpassenger = false %}
|
{% set from_phusionpassenger = false %}
|
||||||
|
{% set from_opensuse_devel = false %}
|
||||||
{% elif nginx.install_from_ppa %}
|
{% elif nginx.install_from_ppa %}
|
||||||
{% set from_official = false %}
|
{% set from_official = false %}
|
||||||
{% set from_ppa = true %}
|
{% set from_ppa = true %}
|
||||||
{% set from_phusionpassenger = false %}
|
{% set from_phusionpassenger = false %}
|
||||||
|
{% set from_opensuse_devel = false %}
|
||||||
{% elif nginx.install_from_phusionpassenger %}
|
{% elif nginx.install_from_phusionpassenger %}
|
||||||
{% set from_official = false %}
|
{% set from_official = false %}
|
||||||
{% set from_ppa = false %}
|
{% set from_ppa = false %}
|
||||||
{% set from_phusionpassenger = true %}
|
{% set from_phusionpassenger = true %}
|
||||||
|
{% set from_opensuse_devel = false %}
|
||||||
|
{% elif nginx.install_from_opensuse_devel %}
|
||||||
|
{% set from_official = false %}
|
||||||
|
{% set from_ppa = false %}
|
||||||
|
{% set from_phusionpassenger = false %}
|
||||||
|
{% set from_opensuse_devel = true %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set from_official = false %}
|
{% set from_official = false %}
|
||||||
{% set from_ppa = false %}
|
{% set from_ppa = false %}
|
||||||
{% set from_phusionpassenger = false %}
|
{% set from_phusionpassenger = false %}
|
||||||
|
{% set from_opensuse_devel = false %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- set resource_repo_managed = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %}
|
{%- set resource_repo_managed = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %}
|
||||||
@ -136,18 +145,19 @@ nginx_phusionpassenger_repo:
|
|||||||
{% if grains.os_family == 'Suse' or grains.os == 'SUSE' %}
|
{% if grains.os_family == 'Suse' or grains.os == 'SUSE' %}
|
||||||
nginx_zypp_repo:
|
nginx_zypp_repo:
|
||||||
pkgrepo:
|
pkgrepo:
|
||||||
{%- if from_official %}
|
|
||||||
- managed
|
|
||||||
{%- else %}
|
|
||||||
- absent
|
|
||||||
{%- endif %}
|
|
||||||
- name: server_http
|
- name: server_http
|
||||||
|
{%- if from_opensuse_devel %}
|
||||||
|
- managed
|
||||||
- humanname: server_http
|
- humanname: server_http
|
||||||
- baseurl: 'http://download.opensuse.org/repositories/server:/http/openSUSE_13.2/'
|
- baseurl: 'http://download.opensuse.org/repositories/server:/http/{{ grains.osrelease }}/'
|
||||||
- enabled: True
|
- enabled: True
|
||||||
- autorefresh: True
|
- autorefresh: True
|
||||||
- gpgcheck: {{ nginx.lookup.gpg_check }}
|
- gpgcheck: {{ nginx.lookup.gpg_check }}
|
||||||
- gpgkey: {{ nginx.lookup.gpg_key }}
|
- gpgkey: {{ nginx.lookup.gpg_key }}
|
||||||
|
- gpgautoimport: {{ nginx.lookup.gpg_autoimport }}
|
||||||
|
{%- else %}
|
||||||
|
- absent
|
||||||
|
{%- endif %}
|
||||||
- require_in:
|
- require_in:
|
||||||
- pkg: nginx_install
|
- pkg: nginx_install
|
||||||
- watch_in:
|
- watch_in:
|
||||||
|
@ -101,6 +101,7 @@ nginx_server_available_dir:
|
|||||||
|
|
||||||
# Managed enabled/disabled state for servers
|
# Managed enabled/disabled state for servers
|
||||||
{% for server, settings in nginx.servers.managed.items() %}
|
{% for server, settings in nginx.servers.managed.items() %}
|
||||||
|
{% set server_enabled = settings.enabled | default(True) %}
|
||||||
{% set conf_state_id = 'server_conf_' ~ loop.index0 %}
|
{% set conf_state_id = 'server_conf_' ~ loop.index0 %}
|
||||||
{% if 'deleted' in settings and settings.deleted %}
|
{% if 'deleted' in settings and settings.deleted %}
|
||||||
{{ conf_state_id }}:
|
{{ conf_state_id }}:
|
||||||
@ -108,7 +109,7 @@ nginx_server_available_dir:
|
|||||||
- name: {{ server_curpath(server) }}
|
- name: {{ server_curpath(server) }}
|
||||||
{% do server_states.append(conf_state_id) %}
|
{% do server_states.append(conf_state_id) %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if settings.enabled == True %}
|
{% if server_enabled == True %}
|
||||||
{{ conf_state_id }}:
|
{{ conf_state_id }}:
|
||||||
file.managed:
|
file.managed:
|
||||||
{{ sls_block(nginx.servers.managed_opts) }}
|
{{ sls_block(nginx.servers.managed_opts) }}
|
||||||
@ -142,7 +143,7 @@ nginx_server_available_dir:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if settings.enabled != None %}
|
{% if settings.enabled is defined and server_enabled != None %}
|
||||||
{% set status_state_id = 'server_state_' ~ loop.index0 %}
|
{% set status_state_id = 'server_state_' ~ loop.index0 %}
|
||||||
{%- set enabled_dir = path_join(server, nginx.servers.managed.get(server).get('enabled_dir', nginx.lookup.server_enabled)) -%}
|
{%- set enabled_dir = path_join(server, nginx.servers.managed.get(server).get('enabled_dir', nginx.lookup.server_enabled)) -%}
|
||||||
{%- set available_dir = path_join(server, nginx.servers.managed.get(server).get('available_dir', nginx.lookup.server_available)) -%}
|
{%- set available_dir = path_join(server, nginx.servers.managed.get(server).get('available_dir', nginx.lookup.server_available)) -%}
|
||||||
@ -151,9 +152,9 @@ nginx_server_available_dir:
|
|||||||
{% if 'deleted' in settings and settings.deleted %}
|
{% if 'deleted' in settings and settings.deleted %}
|
||||||
{{ manage_status(server, False, True) }}
|
{{ manage_status(server, False, True) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ manage_status(server, settings.enabled, False) }}
|
{{ manage_status(server, server_enabled, False) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if settings.enabled == True %}
|
{% if server_enabled == True %}
|
||||||
- require:
|
- require:
|
||||||
- file: {{ conf_state_id }}
|
- file: {{ conf_state_id }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -24,6 +24,10 @@ nginx:
|
|||||||
# each build accordingly ( https://launchpad.net/~nginx )
|
# each build accordingly ( https://launchpad.net/~nginx )
|
||||||
ppa_version: 'stable'
|
ppa_version: 'stable'
|
||||||
|
|
||||||
|
# Use openSUSE devel (server:http) repository to install nginx.
|
||||||
|
# If not set, the server_http repository will be removed if it exists.
|
||||||
|
install_from_opensuse_devel: false
|
||||||
|
|
||||||
# Source install
|
# Source install
|
||||||
source_version: '1.10.0'
|
source_version: '1.10.0'
|
||||||
source_hash: ''
|
source_hash: ''
|
||||||
@ -198,8 +202,9 @@ nginx:
|
|||||||
# relative filename of server file
|
# relative filename of server file
|
||||||
# (defaults to '/etc/nginx/sites-available/mysite')
|
# (defaults to '/etc/nginx/sites-available/mysite')
|
||||||
mysite:
|
mysite:
|
||||||
# may be true, false, or None where true is enabled, false, disabled,
|
# may be true, false, or None where true is enabled, false is disabled,
|
||||||
# and None indicates no action
|
# and None indicates no action
|
||||||
|
# true without ".disabled" management if not specified
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
# This let's you add dependencies on other resources being applied for a
|
# This let's you add dependencies on other resources being applied for a
|
||||||
|
Loading…
Reference in New Issue
Block a user