From bc8618126f12d3a0d41aa59701c0575c70e17879 Mon Sep 17 00:00:00 2001 From: Christian Schwede Date: Wed, 7 Feb 2018 10:56:15 +0100 Subject: [PATCH] Fix missing Swift d1 directory The /srv/node/d1 directory was missing, thus creating it in advance. Note: there is a related change that merged earlier (f6108f5d) but for some reason didn't work as expected. Closes-Bug: 1746734 Change-Id: Iabaa2033d065c9da653f7ba9e25430c3554a1169 --- docker/services/swift-storage.yaml | 12 ++++++++++++ ...ift-create-d1-containerized-8eda040d9088be7d.yaml | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 releasenotes/notes/swift-create-d1-containerized-8eda040d9088be7d.yaml diff --git a/docker/services/swift-storage.yaml b/docker/services/swift-storage.yaml index 9d1ddad71e..e35cd0d7f5 100644 --- a/docker/services/swift-storage.yaml +++ b/docker/services/swift-storage.yaml @@ -49,6 +49,10 @@ parameters: default: {} description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})' type: json + SwiftUseLocalDir: + default: true + description: 'Use a local directory for Swift storage services when building rings' + type: boolean UpgradeRemoveUnusedPackages: default: false description: Remove package if the service is being disabled during upgrade @@ -435,6 +439,14 @@ outputs: - /srv/node - /var/log/swift - /var/log/containers + - name: Set swift_use_local_disks fact + set_fact: + swift_use_local_disks: {get_param: SwiftUseLocalDir} + - name: Create Swift d1 directory if needed + file: + path: "/srv/node/d1" + state: directory + when: swift_use_local_disks - name: Create swift logging symlink file: src: /var/log/swift diff --git a/releasenotes/notes/swift-create-d1-containerized-8eda040d9088be7d.yaml b/releasenotes/notes/swift-create-d1-containerized-8eda040d9088be7d.yaml new file mode 100644 index 0000000000..f02988b9cf --- /dev/null +++ b/releasenotes/notes/swift-create-d1-containerized-8eda040d9088be7d.yaml @@ -0,0 +1,7 @@ +--- +fixes: + Swift added a requirement to ensure that storage directories exist before + using them. However, when local directories are used in Tripleo (storing + data in /srv/node/d1), these are missing by default and thus Swift won't + store any data. This fix creates this directory if needed on a + containerized environment.