Simplify 'noservices' condition
diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml
index 172f5b2..f847543 100644
--- a/.kitchen.travis.yml
+++ b/.kitchen.travis.yml
@@ -3,4 +3,4 @@
- name: <%= ENV['SUITE'] %>
provisioner:
pillars-from-files:
- neutron.sls: tests/pillar/<%= ENV['SUITE'] %>.sls
\ No newline at end of file
+ neutron.sls: tests/pillar/<%= ENV['SUITE'] %>.sls
diff --git a/neutron/compute.sls b/neutron/compute.sls
index bfefb53..cb02136 100644
--- a/neutron/compute.sls
+++ b/neutron/compute.sls
@@ -32,13 +32,15 @@
service.running:
- name: neutron-sriov-agent
- enable: true
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- watch_in:
- service: neutron_compute_services
- watch:
- file: /etc/neutron/neutron.conf
- file: /etc/neutron/plugins/ml2/openvswitch_agent.ini
- file: /etc/neutron/plugins/ml2/sriov_agent.ini
- - unless: grains.get('noservices', False)
{% endif %}
diff --git a/neutron/server.sls b/neutron/server.sls
index 94e3814..b652193 100644
--- a/neutron/server.sls
+++ b/neutron/server.sls
@@ -27,14 +27,15 @@
pkg.installed:
- name: neutron-plugin-contrail
-{%- if not grains.get('noservices', False) %}
neutron_server_service:
service.running:
- name: neutron-server
- enable: true
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- watch:
- file: /etc/neutron/neutron.conf
-{%- endif %}
{%- endif %}
@@ -55,14 +56,15 @@
- require:
- file: /etc/neutron/plugins/ml2/ml2_conf.ini
-{%- if not grains.get('noservices', False) %}
neutron_db_manage:
cmd.run:
- name: neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- require:
- file: /etc/neutron/neutron.conf
- file: /etc/neutron/plugins/ml2/ml2_conf.ini
-{%- endif %}
{%- endif %}
@@ -132,9 +134,9 @@
neutron_db_manage:
cmd.run:
- name: neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/midonet/midonet.ini upgrade head
- {% if grains.noservices is defined %}
- - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
- {% endif %}
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- require:
- file: /etc/neutron/neutron.conf
- file: /etc/neutron/plugins/midonet/midonet.ini
@@ -160,14 +162,15 @@
- python-neutron-lbaas
- python-neutron-fwaas
-{%- if not grains.get('noservices', False) %}
neutron_db_manage:
cmd.run:
- name: neutron-db-manage --subproject networking-midonet upgrade head
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- require:
- file: /etc/neutron/neutron.conf
- file: /etc/neutron/plugins/midonet/midonet.ini
-{%- endif %}
{%- endif %}
{%- endif %}
@@ -176,9 +179,9 @@
service.running:
- names: {{ server.services }}
- enable: true
- {% if grains.noservices is defined %}
- - onlyif: {% if grains.get('noservices', "True") %}"True"{% else %}False{% endif %}
- {% endif %}
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- watch:
- file: /etc/neutron/neutron.conf