From 04e96a241f42af91cdfc10e9305556b66c0be4bf Mon Sep 17 00:00:00 2001 From: SleJP Date: Fri, 19 Apr 2019 11:11:05 +0200 Subject: [PATCH 1/7] Add option to skip verifying the archive hash --- cerebro/binaries.sls | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cerebro/binaries.sls b/cerebro/binaries.sls index 246f0e0..f047b80 100644 --- a/cerebro/binaries.sls +++ b/cerebro/binaries.sls @@ -5,7 +5,11 @@ cerebro_binaries: - name: {{ cerebro.home }} - if_missing: {{ cerebro.home }} - source: https://github.com/lmenezes/cerebro/releases/download/v{{ cerebro.version }}/cerebro-{{ cerebro.version }}.tgz +{% if pillar['cerebro']['skip_verify'] == 'true' %} + - skip_verify: True +{% else %} - source_hash: {{ cerebro.hash }} +{% endif %} - archive_format: tar - options: '--strip=1' - enforce_toplevel: False From 89cc8c954f5e864accf39fbc50bc281544389ebb Mon Sep 17 00:00:00 2001 From: SleJP Date: Thu, 2 May 2019 10:17:59 +0200 Subject: [PATCH 2/7] skip_verify check for boolean instead of string --- cerebro/binaries.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cerebro/binaries.sls b/cerebro/binaries.sls index f047b80..723a7d8 100644 --- a/cerebro/binaries.sls +++ b/cerebro/binaries.sls @@ -5,7 +5,7 @@ cerebro_binaries: - name: {{ cerebro.home }} - if_missing: {{ cerebro.home }} - source: https://github.com/lmenezes/cerebro/releases/download/v{{ cerebro.version }}/cerebro-{{ cerebro.version }}.tgz -{% if pillar['cerebro']['skip_verify'] == 'true' %} +{% if pillar['cerebro']['skip_verify'] == True %} - skip_verify: True {% else %} - source_hash: {{ cerebro.hash }} From 2f05bccca58a3710832d13eef90c195257f6f853 Mon Sep 17 00:00:00 2001 From: SleJP Date: Thu, 2 May 2019 10:29:13 +0200 Subject: [PATCH 3/7] New config options for ldap auth --- cerebro/templates/application.conf.jinja | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cerebro/templates/application.conf.jinja b/cerebro/templates/application.conf.jinja index f978344..d570430 100644 --- a/cerebro/templates/application.conf.jinja +++ b/cerebro/templates/application.conf.jinja @@ -26,9 +26,13 @@ auth = { type: ldap settings: { url = "{{ cerebro.auth_ldap.url }}" - base-dn = "{{ cerebro.auth_ldap.base-dn }}" + base-dn = "{{ cerebro.auth_ldap.base_dn }}" method = "{{ cerebro.auth_ldap.method }}" - user-doman = "{{ cerebro.auth_ldap.user-domain }}" + user-template = "{{ cerebro.auth_ldap.user_template }}" + bind-dn = "{{ cerebro.auth_ldap.bind_dn }}" + bind-pw = "{{ cerebro.auth_ldap.bind_pw }}" + group-search { + } } {%- endif %} {%- endif %} From c9d06396265dfabe6979c0e78bdc2f4d8219f8b2 Mon Sep 17 00:00:00 2001 From: SleJP Date: Thu, 2 May 2019 10:35:10 +0200 Subject: [PATCH 4/7] dependencies for cerebro --- cerebro/binaries.sls | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cerebro/binaries.sls b/cerebro/binaries.sls index 723a7d8..a206c1f 100644 --- a/cerebro/binaries.sls +++ b/cerebro/binaries.sls @@ -1,5 +1,10 @@ {% from 'cerebro/map.jinja' import cerebro with context %} +cerebro_dependencies: + pkg.installed: + - pkgs: + - default-jre-headless + cerebro_binaries: archive.extracted: - name: {{ cerebro.home }} @@ -15,3 +20,5 @@ cerebro_binaries: - enforce_toplevel: False - user: {{ cerebro.user }} - group: {{ cerebro.group }} + - require: + - pkg: cerebro_dependencies From b1964902bede0420d48ac83fb6104f613a1256ad Mon Sep 17 00:00:00 2001 From: Erik Anders Date: Wed, 12 Jun 2019 15:34:38 +0200 Subject: [PATCH 5/7] prevent error if pillar data is not set --- cerebro/binaries.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cerebro/binaries.sls b/cerebro/binaries.sls index a206c1f..11dd8b3 100644 --- a/cerebro/binaries.sls +++ b/cerebro/binaries.sls @@ -10,7 +10,7 @@ cerebro_binaries: - name: {{ cerebro.home }} - if_missing: {{ cerebro.home }} - source: https://github.com/lmenezes/cerebro/releases/download/v{{ cerebro.version }}/cerebro-{{ cerebro.version }}.tgz -{% if pillar['cerebro']['skip_verify'] == True %} +{% if salt['pillar.get']("cerebro:skip_verify", False) == True %} - skip_verify: True {% else %} - source_hash: {{ cerebro.hash }} From 79a5436cc37b4e9713c71553af6e26ac6c2e1985 Mon Sep 17 00:00:00 2001 From: Erik Anders Date: Wed, 12 Jun 2019 15:34:58 +0200 Subject: [PATCH 6/7] prevent wrong encoding of dictionary --- cerebro/config.sls | 2 +- cerebro/service.sls | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cerebro/config.sls b/cerebro/config.sls index 0dd80ce..0042e57 100644 --- a/cerebro/config.sls +++ b/cerebro/config.sls @@ -6,7 +6,7 @@ config_cerebro: - source: salt://cerebro/templates/application.conf.jinja - template: jinja - context: - cerebro: {{ cerebro }} + cerebro: {{ cerebro|json }} - user: {{ cerebro.user }} - group: {{ cerebro.group }} - mode: 0755 diff --git a/cerebro/service.sls b/cerebro/service.sls index 2fb48e2..121c66d 100644 --- a/cerebro/service.sls +++ b/cerebro/service.sls @@ -6,7 +6,7 @@ cerebro_systemd_unit: - source: salt://cerebro/templates/cerebro.service.jinja - template: jinja - context: - cerebro: {{ cerebro }} + cerebro: {{ cerebro|json }} module.run: - name: service.systemctl_reload - onchanges: From 274646a34ecca4363f19600bb8d5e2d68793a619 Mon Sep 17 00:00:00 2001 From: Erik Anders Date: Wed, 12 Jun 2019 15:52:01 +0200 Subject: [PATCH 7/7] update default version --- cerebro/defaults.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cerebro/defaults.yaml b/cerebro/defaults.yaml index 8447062..ee16e33 100644 --- a/cerebro/defaults.yaml +++ b/cerebro/defaults.yaml @@ -1,7 +1,7 @@ cerebro: # binaries - version: '0.6.5' - hash: 'e0fab203496c3216561070df0b2dbd90ade83dfa0dc2fb380a88369958dc1e28' + version: '0.8.3' + hash: 'fdda73f7d56c4ead29590a8b1567d0bbfc3b39c14d2b7bde75a440954e2f435b' home: /opt/cerebro # user user: cerebro