Implement log directory link checking
This change implements the log directory link checking. This will ensure the role is able to handle instances where memcached is deployed outside of a container using the "is_metal: true" property from OSA. Change-Id: Ia5e38dd1fda9f7fa5876e0a2824c88d0fa3d2b8d Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
ee6ff9a709
commit
3ab920ce2b
@ -13,10 +13,23 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Ensure logging folder exists
|
- name: Test for log directory or link
|
||||||
|
shell: |
|
||||||
|
if [ -h "{{ memcached_log | dirname }}" ]; then
|
||||||
|
chown -h root:root "{{ memcached_log | dirname }}"
|
||||||
|
chown -R root:root "$(readlink {{ memcached_log | dirname }})"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
register: log_dir
|
||||||
|
failed_when: false
|
||||||
|
changed_when: log_dir.rc != 0
|
||||||
|
|
||||||
|
- name: Create memcached log dir
|
||||||
file:
|
file:
|
||||||
path: "{{ memcached_log | dirname }}"
|
path: "{{ memcached_log | dirname }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
when: log_dir.rc != 0
|
||||||
|
|
||||||
- name: Apply memcached config
|
- name: Apply memcached config
|
||||||
template:
|
template:
|
||||||
|
Loading…
Reference in New Issue
Block a user