Skip to content

Instantly share code, notes, and snippets.

@q1x
Created March 20, 2017 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save q1x/2d713f277caa030238827a8d15f38bf8 to your computer and use it in GitHub Desktop.
Save q1x/2d713f277caa030238827a8d15f38bf8 to your computer and use it in GitHub Desktop.
Conditional mysql-server install via mysql-formula
# Setup the mysql client
include:
- mysql.client
# Only setup mysql server if a root password has been set
{% if salt['pillar.get']('mysql:server:root_password',false) %}
- mysql.server
- mysql.remove_test_database
{% else %}
Mysql root password is not set, skipping Mysql installation:
test.fail_without_changes
{% endif %}
@q1x
Copy link
Author

q1x commented Mar 20, 2017

not setting root pwd in pillar will trigger this response:

----------
          ID: Mysql root password is not set, skipping Mysql installation
    Function: test.fail_without_changes
      Result: False
     Comment: Failure!
     Started: 13:53:01.164876
    Duration: 0.578 ms
     Changes:
----------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment