Closed jakubek closed 6 years ago
Thanks for the report @jakubek. We technically don't actually have a test=False
option, and the output that I am seeing from your state looks like it should if you were running test=True
. I bet the state is only checking for the existence of the test
kwarg, regardless of it's =True
or =False
status or something along those lines. If you run your state without test=False
, the state should run as it normally would. Can you give that a try and see if you get the result you expect?
@rallytime as I mentioned I'm always running minion with option test: true in /etc/salt/minion. In this case state is always fired as dry-run.
root@saltmaster:/srv/pillar/p-vipnet# salt 'test1' state.sls_id mycnf mw.mysql
test1:
----------
ID: mycnf
Function: file.managed
Name: /etc/my.cnf
Result: None
Comment: The following values are set to be changed:
diff: ---
+++
@@ -12,7 +12,6 @@
character_set_server = utf8
collation_server = utf8_unicode_ci
init_connect = 'SET NAMES utf8'
-
# Replication settings
log-bin=mysql-bin
@@ -33,20 +32,20 @@
read_buffer_size = 256K
sort_buffer_size = 8M
-# tune me!
query_cache_type = 1
query_cache_size = 2G
-# tune me!
thread_cache_size = 32
max_connections = 1024
bind-address = 0.0.0.0
-# tune me!
-innodb_buffer_pool_size = 12G
-innodb_buffer_pool_instances = 6
+innodb_read_io_threads = 64
+innodb_write_io_threads = 64
+
+innodb_buffer_pool_size = 20G
+innodb_buffer_pool_instances = 20
innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_log_file_size = 128M
Started: 16:19:42.663503
Duration: 940.818 ms
Changes:
Summary
------------
Succeeded: 1 (unchanged=1)
Failed: 0
------------
Total states run: 1
Ah, it seems that I was misunderstanding your question, and I was also incorrect about the test=False option. I'd never seen that before.
We do want to support defaulting to test: True
in the minion or master config for dry "test" runs on states and setting test=False is completely legitimate to override the config option and actually run the state.
We had a bug with this a while ago where setting test: True
in the master config couldn't be overridden that has been fixed. Are you in a position to switch the config option from minion config to master to config? I am wondering if that would be a good work-around for now and is only broken in the minion config option, or if this is something that has regressed for both master and minion config values.
@rallytime are you sure that there is "test:" key in master config? Maybe we are writing about different things?
jakubek@x240:~/gits/other/salt/conf$ git branch
* develop
jakubek@x240:~/gits/other/salt/conf$ grep '#test' master
jakubek@x240:~/gits/other/salt/conf$ grep '#test' minion
#test: True
#test.foo: foo
#test.bar: [baz,quo]
#test.baz: {spam: sausage, cheese: bread}
Maybe it's related to this Bug https://github.com/saltstack/salt/issues/12624?
Bah. You're right. It's not supported in the master, only the minion. Sorry for the confusion. We'll get this fixed up.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
All my minions are running in test: true mode by default.
VERSIONS: