Switching out the puppet version, as puppet_facts does, does not work,
as this will confuse code that wants to use version-dependent features.
Instead this uses rspec-puppet-facts, which doesn't touch the puppet
version.
This patch changes the raise_error matchers to use `catalogue` instead
of `subject` since `subject` is not evaluated the way it used to be;
changes a parameter value from empty string to nil to be compatible
with the future parser, and unpins rspec-puppet.
A user might need to import several files on database creation.
Currently the module only allows the import of a single file.
This commit allows one to, from now on, import severals.
Before :
mysql::db { 'test' :
sql => '/tmp/my_import1.sql',
}
Now :
mysql::db { 'test' :
sql => [
'/tmp/my_import1.sql',
'/tmp/my_import2.sql',
]
}
This conversion is done by Transpec 2.3.6 with the following command:
transpec -f -c "bundle exec rake spec"
* 69 conversions
from: it { should ... }
to: it { is_expected.to ... }
* 48 conversions
from: obj.should
to: expect(obj).to
* 34 conversions
from: == expected
to: eq(expected)
* 4 conversions
from: it { should_not ... }
to: it { is_expected.not_to ... }
* 3 conversions
from: obj.should_not
to: expect(obj).not_to
* 2 conversions
from: lambda { }.should
to: expect { }.to
* 2 conversions
from: pending
to: skip
For more details: https://github.com/yujinakayama/transpec#supported-conversions
When defining the mysql::db as exported resources, there are chances that the
same resource names are defined across the site, which will cause puppet agent
fail. By adding an optional dbname parameter, default to the $name, it allows the
resouce name to be defined differently, e.g. ${dbname}_${domain}.
Also updated test and docs for dbname parameter and add acceptance test for
dbname parameter feature
This is a major change to the module and would be released as a new
version.
* Add self.instances to database and database_user for puppet resource.
* Update database provider to use flush method.
* Update module to conform to puppet-lint recommendations.
* Cleanup some unecessary logic in mysql::db define type.
* Move mysql_restart to config class.
* Use class to class dependency instead of resource dependency.
* Change appropriate rspec-puppet tests.
* Add fixtures directory to simplify testing.
* Update raketask and spec_helper to reflect fixture changes.
* Update mysql_password function to support validation.
* Move client installation to a separate class.
* Update documentation and readme.
Commit e3b9fd broke the mysql::db defined type by always notifying the
Exec[${name}-import-import] resource even though the resource may not be
declared if the $sql parameter was not given. This commit adds an
in-selector to only notify the Exec resource if the $sql parameter has a
value. More extensive rspec-puppet tests have been provided to protect
against this in the future.
Previous to this commit, if the sql parameter was provided to a
declaration of the mysql::db defined type, the defined type would always
load the sql script on every catalog run. This changes the exec that
loads that sql script to be refreshonly unless the enforce_sql parameter
is set to true.