Skip to content

Commit

Permalink
fix(freebsd): loader.conf is existing file
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Oct 4, 2019
1 parent a31079c commit d4d176f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion iscsi/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ iscsi:
name: iscsi_initiator
text: 'iscsi_initiator_load="YES"'
ctld:
name: ctld
name:
text: 'cfiscsi_load="YES"'
ietd:
name: iscsi_trgt
Expand Down
11 changes: 9 additions & 2 deletions iscsi/initiator/kernel/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@ include:
iscsi-initiator-kernel-install-file-line:
file.line:
- onlyif: iscsi.config.name.modprobe and 'text' in iscsi.config.kmodule[provider] }}
- onlyif: {{ iscsi.config.name.modprobe and 'text' in iscsi.config.kmodule[provider] }}
- name: {{ iscsi.config.name.modprobe }}
- content: {{ iscsi.config.kmodule[provider]['text'] }}
- backup: True
{%- if not iscsi.initiator.enabled %}
- mode: delete
cmd.run:
- onlyif: {{ iscsi.config.name.modprobe and iscsi.config.kmodule[provider]['name'] }}
- name: {{ iscsi.kernel.modunload }} {{ iscsi.config.kmodule[provider]['name'] }}
- onlyif: {{ iscsi.kernel.modquery }} {{ iscsi.config.kmodule[provider]['name'] }}
{%- else %}
- create: True
{%- if grains.os_family in ('FreeBSD',) %}
- mode: ensure
- after: 'autoboot_delay.*'
{%- else %}
- mode: ensure
- create: True
- match: None
{%- endif %}
cmd.run:
- onlyif: {{ iscsi.config.name.modprobe and iscsi.config.kmodule[provider]['name'] }}
- name: {{ iscsi.kernel.modload }} {{ iscsi.config.kmodule[provider]['name'] }}
- unless: {{ iscsi.kernel.modquery }} {{ iscsi.config.kmodule[provider]['name'] }}
{%- endif %}
Expand Down
9 changes: 8 additions & 1 deletion iscsi/target/kernel/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,21 @@ iscsi-target-kernel-install-file-line:
- cmd: iscsi-target-kernel-install-file-line
- backup: True
{%- if iscsi.target.enabled %}
- create: True
{%- if grains.os_family in ('FreeBSD',) %}
- mode: replace
- after: 'autoboot_delay.*'
{%- else %}
- mode: ensure
- create: True
- match: None
{%- endif %}
cmd.run:
- onlyif: {{ iscsi.config.name.modprobe and iscsi.config.kmodule[provider]['name'] }}
- name: {{ iscsi.kernel.modload }} {{ iscsi.config.kmodule[provider]['name'] }}
- unless: {{ iscsi.kernel.modquery }} {{ iscsi.config.kmodule[provider]['name'] }}
{%- else %}
cmd.run:
- onlyif: {{ iscsi.config.name.modprobe and iscsi.config.kmodule[provider]['name'] }}
- name: {{ iscsi.kernel.modunload }} {{ iscsi.config.kmodule[provider]['name'] }}
- onlyif: {{ iscsi.kernel.modquery }} {{ iscsi.config.kmodule[provider]['name'] }}
- mode: delete
Expand Down

0 comments on commit d4d176f

Please sign in to comment.