Top Level Namespace

Instance Method Summary collapse

Instance Method Details

#cassandramajorversioninteger

Extract the major version from the cassandrarelease fact.

Returns:

  • (integer)

    The major version of the Cassandra instance.

See Also:

Caveats:

  • Requires that the cassandrarelease has been successfully retrieved.



21
22
23
24
25
26
# File 'lib/facter/cassandra.rb', line 21

Facter.add('cassandramajorversion') do
  setcode do
    release = Facter.value(:cassandrarelease)
    release.split('.')[0].to_i if release
  end
end

#cassandraminorversioninteger

Extract the minor version from the cassandrarelease fact.

Returns:

  • (integer)

    The minor version of the Cassandra instance.

See Also:

Caveats:

  • Requires that the cassandrarelease has been successfully retrieved.



33
34
35
36
37
38
# File 'lib/facter/cassandra.rb', line 33

Facter.add('cassandraminorversion') do
  setcode do
    release = Facter.value(:cassandrarelease)
    release.split('.')[1].to_i if release
  end
end

#cassandrapatchversioninteger

Extract the patch version from the cassandrarelease fact.

Returns:

  • (integer)

    The patch version of the Cassandra instance.

See Also:

Caveats:

  • Requires that the cassandrarelease has been successfully retrieved.



45
46
47
48
49
50
# File 'lib/facter/cassandra.rb', line 45

Facter.add('cassandrapatchversion') do
  setcode do
    release = Facter.value(:cassandrarelease)
    release.split('.')[2].to_i if release
  end
end

#cassandrareleasestring

Extract the release string from the running Cassandra instance.

undefined.

Returns:

  • (string)

    The version string (e.g. 3.0.1).

Caveats:

  • The Cassandra service needs to be running, otherwise the fact will be

Resolution:

  • Runs the command “nodetool version”.



9
10
11
12
13
14
# File 'lib/facter/cassandra.rb', line 9

Facter.add('cassandrarelease') do
  setcode do
    version = Facter::Util::Resolution.exec('nodetool version')
    version.match(/\d+\.\d+\.\d+/).to_s if version && version != ''
  end
end