Open jchoksijudopay opened 4 years ago
class { 'cassandra::schema': cqlsh_user => 'puppet', cqlsh_password => $puppet_user_password, users => { 'dummy1' => { password => $dummy1_user_password, superuser => true, }, 'dummy2' => { password => $dummy2_user_password, superuser => true, }, 'cassandra' => { ensure => absent, } }, require => Exec['cassandra-bootstrap'], }
The puppet module keeps trying to create the dummy1 and dummy2 users and fails to remove the cassandra user on each run.
The dummy1 and dummy2 users should have been created once and the cassandra user should have been removed.
We identified that the issue was being caused by the enabling of color output in query results. This broke the logic in https://github.com/voxpupuli/puppet-cassandra/blob/master/manifests/schema/user.pp as it was not expecting the extra characters when running cqlsh and checking its output.
File: ~/.cassandra/cqlshrc
[ui] ;; Whether or not to display query results with colors color = on
A quick fix for us was to make use of the cqlsh_additional_options parameter and set it to: --no-color.
cqlsh_additional_options
--no-color
Raised this issue to request whether the cqlsh_additional_options could be set to --no-color as a default to prevent others facing an issue.
yes, we could do that.
alternatively, we might want to ignore ~/.cassandra/cqlshrc
~/.cassandra/cqlshrc
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
The puppet module keeps trying to create the dummy1 and dummy2 users and fails to remove the cassandra user on each run.
What behaviour did you expect instead
The dummy1 and dummy2 users should have been created once and the cassandra user should have been removed.
Any additional information you'd like to impart
We identified that the issue was being caused by the enabling of color output in query results. This broke the logic in https://github.com/voxpupuli/puppet-cassandra/blob/master/manifests/schema/user.pp as it was not expecting the extra characters when running cqlsh and checking its output.
File: ~/.cassandra/cqlshrc
A quick fix for us was to make use of the
cqlsh_additional_options
parameter and set it to:--no-color
.Raised this issue to request whether the
cqlsh_additional_options
could be set to--no-color
as a default to prevent others facing an issue.