diff --git a/data/hostname/webapp0.softwareheritage.org.yaml b/data/hostname/webapp0.softwareheritage.org.yaml --- a/data/hostname/webapp0.softwareheritage.org.yaml +++ b/data/hostname/webapp0.softwareheritage.org.yaml @@ -8,3 +8,16 @@ apache::default_vhost: false swh::remote_service::search::config: "%{alias('swh::remote_service::search::config::storage0')}" + +swh::remote_service::storage::config: + cls: cassandra + args: + hosts: + - cassandra01.euwest.azure.internal.softwareheritage.org + - cassandra02.euwest.azure.internal.softwareheritage.org + - cassandra03.euwest.azure.internal.softwareheritage.org + - cassandra04.euwest.azure.internal.softwareheritage.org + - cassandra05.euwest.azure.internal.softwareheritage.org + - cassandra06.euwest.azure.internal.softwareheritage.org + keyspace: swh_test + objstorage: "%{alias('swh::remote_service::objstorage::config::azure_readonly_with_fallback')}" diff --git a/site-modules/profile/manifests/swh/deploy/storage.pp b/site-modules/profile/manifests/swh/deploy/storage.pp --- a/site-modules/profile/manifests/swh/deploy/storage.pp +++ b/site-modules/profile/manifests/swh/deploy/storage.pp @@ -18,4 +18,8 @@ and $storage_config['args']['journal_writer']['cls'] == 'kafka') { include ::profile::swh::deploy::journal } + + if $storage_config['cls'] == 'cassandra' { + include ::profile::swh::deploy::storage_cassandra + } } diff --git a/site-modules/profile/manifests/swh/deploy/storage_cassandra.pp b/site-modules/profile/manifests/swh/deploy/storage_cassandra.pp new file mode 100644 --- /dev/null +++ b/site-modules/profile/manifests/swh/deploy/storage_cassandra.pp @@ -0,0 +1,7 @@ +# Deployment of the cassandra storage's dependencies +class profile::swh::deploy::storage_cassandra { + package {'python3-cassandra': + ensure => present, + require => Apt::Source['softwareheritage'], + } +} diff --git a/site-modules/profile/manifests/swh/deploy/webapp.pp b/site-modules/profile/manifests/swh/deploy/webapp.pp --- a/site-modules/profile/manifests/swh/deploy/webapp.pp +++ b/site-modules/profile/manifests/swh/deploy/webapp.pp @@ -102,6 +102,11 @@ notify => Service['gunicorn-swh-webapp'], } + $storage_cfg = $full_webapp_config['storage'] + if $storage_cfg['cls'] == 'cassandra' { + include ::profile::swh::deploy::storage_cassandra + } + file {$production_db_dir: ensure => directory, owner => $user,