Skip to content

Commit

Permalink
Add rest module
Browse files Browse the repository at this point in the history
  • Loading branch information
gigi206 committed Jul 14, 2020
1 parent 4957bde commit 1daa8c7
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions salt/conf/srv/pillar/vscode-anywhere.sls
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ vscode-anywhere:
anaconda: False
remote:
enabled: False
rest:
enabled: False
restructuredtext:
enabled: False
ruby:
Expand Down
2 changes: 2 additions & 0 deletions salt/conf/tests/linux/vscode-anywhere.sls
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ vscode-anywhere:
anaconda: False
remote:
enabled: True
rest:
enabled: False
restructuredtext:
enabled: False
ruby:
Expand Down
2 changes: 2 additions & 0 deletions salt/conf/tests/windows/vscode-anywhere.sls
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ vscode-anywhere:
anaconda: False
remote:
enabled: True
rest:
enabled: False
restructuredtext:
enabled: False
ruby:
Expand Down
1 change: 1 addition & 0 deletions salt/modules/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ include:
- salt/modules/restructuredtext
- salt/modules/deepcode
- salt/modules/platformio
- salt/modules/rest
- salt/modules/custom
{%- if salt['state.sls_exists']('vscode-anywhere') %}
- vscode-anywhere
Expand Down
7 changes: 7 additions & 0 deletions salt/modules/rest/defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default:
enabled: False
vscode:
extensions:
humao.rest-client:
enabled: True
version: null
2 changes: 2 additions & 0 deletions salt/modules/rest/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include:
- salt/modules/rest/install
5 changes: 5 additions & 0 deletions salt/modules/rest/install/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{%- from 'salt/utils/init.jinja' import init with context %}
{%- from 'salt/modules/rest/map.jinja' import rest with context %}


{{ init(rest, action='install') }}
9 changes: 9 additions & 0 deletions salt/modules/rest/map.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{%- import_yaml 'salt/modules/rest/defaults.yaml' as defaults %}
{%- import_yaml 'salt/modules/rest/profilemap.yaml' as profilemap %}


{%- set rest = salt['grains.filter_by'](defaults, grain='kernel', base='default',
merge=salt['grains.filter_by'](profilemap, grain='vscode-anywhere:profile',
merge=salt['pillar.get']('vscode-anywhere:rest', {})
)
) %}
1 change: 1 addition & 0 deletions salt/modules/rest/profilemap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 5 additions & 0 deletions salt/modules/rest/uninstall/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{%- from 'salt/utils/init.jinja' import init with context %}
{%- from 'salt/modules/rest/map.jinja' import rest with context %}


{{ init(rest, action='uninstall') }}
5 changes: 5 additions & 0 deletions salt/modules/rest/update/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{%- from 'salt/utils/init.jinja' import init with context %}
{%- from 'salt/modules/rest/map.jinja' import rest with context %}


{{ init(rest, action='update') }}
1 change: 1 addition & 0 deletions salt/utils/update.sls
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ include:
- salt/modules/python2/update
- salt/modules/python3/update
- salt/modules/remote/update
- salt/modules/rest/update
- salt/modules/restructuredtext/update
- salt/modules/ruby/update
- salt/modules/saltstack/update
Expand Down

0 comments on commit 1daa8c7

Please sign in to comment.