Streamline path, prevent file from being written before volume is mounted

This commit is contained in:
Marco Streich 2021-01-21 17:17:43 +01:00
parent f8c23f16d5
commit 37465492a9
2 changed files with 3 additions and 3 deletions

View File

@ -87,7 +87,7 @@ write_files:
}
owner: root:root
permissions: '0644'
- path: /mnt/data/kibana-elasticsearch-password
- path: /opt/cloud-init-misc-data/kibana_elasticsearch_password
content: ${kibana_elasticsearch_password}
owner: root:root
permissions: '0600'

View File

@ -28,7 +28,7 @@
sleep 5
done
printf "Setting up Kibana user\n"
curl -uelastic:changeme -XPUT -H 'Content-Type: application/json' 'http://10.0.1.51:9200/_xpack/security/user/kibana/_password' -d "{ \"password\":\"$(head -n 1 /mnt/data/kibana-elasticsearch-password)\"}"
curl -uelastic:changeme -XPUT -H 'Content-Type: application/json' 'http://10.0.1.51:9200/_xpack/security/user/kibana/_password' -d "{ \"password\":\"$(head -n 1 /opt/cloud-init-misc-data/kibana_elasticsearch_password)\"}"
'';
services.kibana.enable = true;
@ -37,7 +37,7 @@
services.kibana.listenAddress = "0.0.0.0";
services.kibana.elasticsearch.hosts = [ "http://10.0.1.51:9200" ];
services.kibana.elasticsearch.username = "kibana";
services.kibana.elasticsearch.password = (builtins.readFile /mnt/data/kibana-elasticsearch-password);
services.kibana.elasticsearch.password = (builtins.readFile /opt/cloud-init-misc-data/kibana_elasticsearch_password);
system.activationScripts = {
mnt = {