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:
Kevin Carter 2016-08-08 23:51:54 -05:00
parent ee6ff9a709
commit 3ab920ce2b
No known key found for this signature in database
GPG Key ID: 69FEFFC5E2D9273F
1 changed files with 14 additions and 1 deletions

View File

@ -13,10 +13,23 @@
# See the License for the specific language governing permissions and
# 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:
path: "{{ memcached_log | dirname }}"
state: directory
when: log_dir.rc != 0
- name: Apply memcached config
template: