|
6 | 6 | placement, |
7 | 7 | horizon, |
8 | 8 | cinder, |
| 9 | + barbican, |
9 | 10 | }: |
10 | 11 | { |
11 | 12 | config, |
|
34 | 35 | (import ./neutron.nix { inherit neutron; }) |
35 | 36 | (import ./horizon.nix { inherit horizon; }) |
36 | 37 | (import ./cinder.nix { inherit cinder; }) # only cinder management component |
| 38 | + (import ./barbican.nix { inherit barbican; }) # only cinder management component |
37 | 39 | ]; |
38 | 40 |
|
39 | 41 | config = { |
|
68 | 70 | mysql -N -e "GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'cinder';" |
69 | 71 | mysql -N -e "GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'cinder';" |
70 | 72 |
|
| 73 | + # barbican |
| 74 | + mysql -N -e "drop database barbican;" || true |
| 75 | + mysql -N -e "create database barbican;" || true |
| 76 | + mysql -N -e "GRANT ALL PRIVILEGES ON barbican.* TO 'barbican'@'localhost' IDENTIFIED BY 'barbican';" |
| 77 | + mysql -N -e "GRANT ALL PRIVILEGES ON barbican.* TO 'barbican'@'%' IDENTIFIED BY 'barbican';" |
| 78 | +
|
71 | 79 | # Placement |
72 | 80 | mysql -N -e "drop database placement;" || true |
73 | 81 | mysql -N -e "create database placement;" || true |
|
154 | 162 | }; |
155 | 163 | }; |
156 | 164 |
|
| 165 | + systemd.services.barbican = { |
| 166 | + description = "OpenStack barbican setup"; |
| 167 | + after = [ "keystone-all.service" ]; |
| 168 | + wantedBy = [ "multi-user.target" ]; |
| 169 | + environment = adminEnv; |
| 170 | + path = [ |
| 171 | + pkgs.openstackclient |
| 172 | + barbican |
| 173 | + ]; |
| 174 | + serviceConfig = { |
| 175 | + Type = "oneshot"; |
| 176 | + User = "barbican"; |
| 177 | + Group = "barbican"; |
| 178 | + ExecStart = pkgs.writeShellScript "barbican.sh" '' |
| 179 | + set -euxo pipefail |
| 180 | + openstack user create --domain default --password barbican barbican |
| 181 | + openstack role add --project service --user barbican admin |
| 182 | + openstack role add --user barbican --user-domain default --system all reader |
| 183 | + barbican-manage --config-file ${config.barbican.config} db upgrade |
| 184 | + barbican-manage --config-file ${config.barbican.config} db sync_secret_stores |
| 185 | + ''; |
| 186 | + }; |
| 187 | + }; |
| 188 | + |
157 | 189 | systemd.services.cinder = { |
158 | 190 | description = "OpenStack Cinder setup"; |
159 | 191 | after = [ "keystone-all.service" ]; |
|
0 commit comments