Skip to content

Commit cf8b457

Browse files
fix(issues): file various minor issues
1 parent af35635 commit cf8b457

File tree

8 files changed

+30
-11
lines changed

8 files changed

+30
-11
lines changed

mongodb/config/alternatives/clean.sls

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,12 @@
3333
{%- endfor %} {# component #}
3434
{%- endif %} {# wanted #}
3535
{%- endfor %} {# components #}
36-
{%- endif %} {# linux #}
36+
37+
{%- else %}
38+
39+
{{ formula }}-config-alternatives-clean-notification:
40+
test.show_notification:
41+
- text: |
42+
Note: The linux alternatives state is not applicable for {{ grains.os }}
43+
44+
{%- endif %} {# os #}

mongodb/config/alternatives/install.sls

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,12 @@ include:
5858
{%- endfor %} {# component #}
5959
{%- endif %} {# wanted #}
6060
{%- endfor %} {# components #}
61-
{%- endif %} {# linux #}
61+
62+
{%- else %}
63+
64+
{{ formula }}-config-alternatives-install-notification:
65+
test.show_notification:
66+
- text: |
67+
Note: The linux alternatives state is not applicable for {{ grains.os }}
68+
69+
{%- endif %} {# os #}

mongodb/config/clean.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ include:
3737
- names:
3838
{%- if 'service' in software and software['service'] is mapping %}
3939
{%- set servicename = name if 'service' not in software else software.service.name %}
40-
- {{ d.dir.etc }}/{{ servicename|replace('org.mongo.mongodb.', '') }}.yml
40+
- {{ d.dir.etc }}/{{ servicename|replace('org.mongo.mongodb.', '') }}.conf
4141
{%- endif %}
4242
{%- if 'config_file' in software and 'config' in software and software['config'] is mapping %}
4343
- {{ software['config_file'] }}

mongodb/config/file.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ include:
3333
3434
{{ formula }}-config-file-{{ servicename }}-file-managed:
3535
file.managed:
36-
- name: {{ d.dir.etc }}/{{ servicename|replace('org.mongo.mongodb.', '') }}.yml
36+
- name: {{ d.dir.etc }}/{{ servicename|replace('org.mongo.mongodb.', '') }}.conf
3737
- source: {{ files_switch(['config.yml.jinja'],
3838
lookup=formula ~ '-config-file-' ~ servicename ~ '-file-managed'
3939
)

mongodb/install.sls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ include:
180180
{#- SYMLINK INSTALL #}
181181
182182
{%- if grains.kernel|lower in ('linux', 'darwin') %}
183-
{%- if package in ('archve', 'macapp') %}
183+
{%- if package in ('archive', 'macapp') %}
184184
{%- if d.linux.altpriority|int <= 0 or grains.os_family in ('MacOS', 'Arch') %}
185185
{%- if 'commands' in software and software['commands'] is iterable %}
186186
{%- for cmd in software['commands'] %}
@@ -246,6 +246,7 @@ include:
246246
{%- elif grains.kernel == 'Darwin' %}
247247
{%- set servicename = name if 'name' not in service else service.name %}
248248
249+
- require_in:
249250
- file: {{ formula }}-{{ comp }}-{{ servicename }}-install-service-launched
250251
251252
{{ formula }}-{{ comp }}-{{ servicename }}-install-service-launched:

mongodb/service/running.sls

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ include:
1111
- {{ sls_config_users }}
1212
- {{ sls_software_install }}
1313
14+
{%- if grains.kernel|lower == 'linux' %}
1415
{{ formula }}-service-running-prerequisites:
1516
file.managed:
1617
- name: /etc/init.d/disable-transparent-hugepages
1718
- source: salt://{{ formula }}/files/disable-transparent-hugepages.init
18-
- unless: test -f /etc/init.d/disable-transparent-hugepages
19+
- unless: test -f /etc/init.d/disable-transparent-hugepages 2>/dev/null
1920
- onlyif: {{ d.wanted.disable_transparent_hugepages }}
2021
- mode: '0755'
2122
- makedirs: True
2223
- require:
2324
- sls: {{ sls_software_install }}
25+
- sls: {{ sls_config_users }}
2426
cmd.run:
2527
- name: echo never >/sys/kernel/mm/transparent_hugepage/enabled
2628
- onlyif: {{ d.wanted.disable_transparent_hugepages }}
@@ -35,6 +37,7 @@ include:
3537
- onlyif: systemctl list-units | grep firewalld >/dev/null 2>&1
3638
- enable: True
3739
{%- endif %}
40+
{%- endif %}
3841
3942
{%- for comp in d.software_component_matrix %}
4043
{%- if comp in d.wanted and d.wanted is iterable and comp in d.pkg and d.pkg[comp] is mapping %}
@@ -96,7 +99,7 @@ include:
9699
selinux.fcontext_policy_present:
97100
- name: '{{ config['storage']['dbPath'] }}(/.*)?'
98101
- sel_type: {{ name }}_var_lib_t
99-
- require:
102+
- onchanges:
100103
- file: {{ formula }}-service-running-{{ comp }}-{{ servicename }}-install-datapath
101104
- require_in:
102105
- selinux: {{ formula }}-service-running-{{ comp }}-{{ servicename }}-selinux-applied
@@ -192,7 +195,7 @@ include:
192195
{%- endif %}
193196
194197
{%- endif %} {# config #}
195-
{%- if d.wanted.firewall and 'firewall' in software %}
198+
{%- if grains.kernel == 'Linux' and d.wanted.firewall and 'firewall' in software %}
196199
197200
{{ formula }}-service-running-{{ comp }}-{{ servicename }}-firewall-present:
198201
firewalld.present:

pillar.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ mongodb:
1717
connectors:
1818
# bi # enterprise subscription only
1919
- kafka
20-
upstream_repo: false
2120

2221
pkg:
2322
deps:

test/integration/default/controls/archive_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@
9090
its('owner') { should eq 'root' }
9191
its('group') { should eq 'root' }
9292
end
93-
describe file('/etc/mongodb/mongod.yml') do
93+
describe file('/etc/mongodb/mongod.conf') do
9494
it { should exist }
9595
its('mode') { should cmp '0644' }
9696
# its('owner') { should eq 'mongodb' }
9797
# its('group') { should eq 'mongodb' }
9898
end
99-
describe file('/etc/mongodb/mongos.yml') do
99+
describe file('/etc/mongodb/mongos.conf') do
100100
it { should exist }
101101
its('mode') { should cmp '0644' }
102102
its('owner') { should eq 'mongos' }

0 commit comments

Comments
 (0)