Don't create symlink for swift container logs
logrotate 3.14.0 silently ignores all files when there is a broken symlink in the container. Replaces /var/log/containers/swift symlink with directories Once we remove the symlinks in update_staks, host_prep_tasks would create those directories. Assuming that minor update runs before upgrades, this should take care of upgrades too. Conflicts: docker/services/swift-proxy.yaml docker/services/swift-storage.yaml Change-Id: I52a74c7b5473340e2afd240d7d6af9ad5bc97544 Closes-Bug: #1833690 (cherry picked from commitd3a9614d8a
and90d05216b9
)
This commit is contained in:
parent
5f4cb7d604
commit
b1486301f2
|
@ -220,6 +220,7 @@ outputs:
|
||||||
- /run:/run
|
- /run:/run
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment:
|
environment:
|
||||||
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
|
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
|
||||||
- if:
|
- if:
|
||||||
|
@ -248,14 +249,7 @@ outputs:
|
||||||
with_items:
|
with_items:
|
||||||
- /srv/node
|
- /srv/node
|
||||||
- /var/log/swift
|
- /var/log/swift
|
||||||
- stat: path=/var/log/swift
|
- /var/log/containers/swift
|
||||||
register: swift_log_stat
|
|
||||||
- name: Create swift logging symlink
|
|
||||||
file:
|
|
||||||
src: /var/log/swift
|
|
||||||
dest: /var/log/containers/swift
|
|
||||||
state: link
|
|
||||||
when: swift_log_stat.stat.exists
|
|
||||||
- name: Check if rsyslog exists
|
- name: Check if rsyslog exists
|
||||||
stat:
|
stat:
|
||||||
path: /etc/rsyslog.d
|
path: /etc/rsyslog.d
|
||||||
|
@ -265,7 +259,7 @@ outputs:
|
||||||
copy:
|
copy:
|
||||||
content: |
|
content: |
|
||||||
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
|
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
|
||||||
local2.* /var/log/swift/swift.log
|
local2.* /var/log/containers/swift/swift.log
|
||||||
& stop
|
& stop
|
||||||
dest: /etc/rsyslog.d/openstack-swift.conf
|
dest: /etc/rsyslog.d/openstack-swift.conf
|
||||||
register: logconfig
|
register: logconfig
|
||||||
|
@ -274,6 +268,16 @@ outputs:
|
||||||
when:
|
when:
|
||||||
- logconfig|changed
|
- logconfig|changed
|
||||||
when: rsyslog_config.stat.exists
|
when: rsyslog_config.stat.exists
|
||||||
|
update_tasks:
|
||||||
|
- name: Check swift containers log folder/symlink exists
|
||||||
|
stat:
|
||||||
|
path: /var/log/containers/swift
|
||||||
|
register: swift_log_link
|
||||||
|
- name: Delete if symlink
|
||||||
|
file:
|
||||||
|
path: /var/log/containers/swift
|
||||||
|
state: absent
|
||||||
|
when: swift_log_link.stat.islnk is defined and swift_log_link.stat.islnk
|
||||||
upgrade_tasks:
|
upgrade_tasks:
|
||||||
- when: step|int == 0
|
- when: step|int == 0
|
||||||
tags: common
|
tags: common
|
||||||
|
|
|
@ -246,6 +246,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: &kolla_env
|
environment: &kolla_env
|
||||||
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
|
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
|
||||||
swift_account_replicator:
|
swift_account_replicator:
|
||||||
|
@ -262,6 +263,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_container_auditor:
|
swift_container_auditor:
|
||||||
image: &swift_container_image {get_param: DockerSwiftContainerImage}
|
image: &swift_container_image {get_param: DockerSwiftContainerImage}
|
||||||
|
@ -277,6 +279,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_container_replicator:
|
swift_container_replicator:
|
||||||
image: *swift_container_image
|
image: *swift_container_image
|
||||||
|
@ -292,6 +295,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_object_auditor:
|
swift_object_auditor:
|
||||||
image: &swift_object_image {get_param: DockerSwiftObjectImage}
|
image: &swift_object_image {get_param: DockerSwiftObjectImage}
|
||||||
|
@ -307,6 +311,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_object_replicator:
|
swift_object_replicator:
|
||||||
image: *swift_object_image
|
image: *swift_object_image
|
||||||
|
@ -322,6 +327,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
-
|
-
|
||||||
swift_account_reaper:
|
swift_account_reaper:
|
||||||
|
@ -338,6 +344,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_account_server:
|
swift_account_server:
|
||||||
image: *swift_account_image
|
image: *swift_account_image
|
||||||
|
@ -355,6 +362,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_container_updater:
|
swift_container_updater:
|
||||||
image: *swift_container_image
|
image: *swift_container_image
|
||||||
|
@ -370,6 +378,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_container_server:
|
swift_container_server:
|
||||||
image: *swift_container_image
|
image: *swift_container_image
|
||||||
|
@ -387,6 +396,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_object_expirer:
|
swift_object_expirer:
|
||||||
image: &swift_proxy_image {get_param: DockerSwiftProxyImage}
|
image: &swift_proxy_image {get_param: DockerSwiftProxyImage}
|
||||||
|
@ -402,6 +412,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_object_updater:
|
swift_object_updater:
|
||||||
image: *swift_object_image
|
image: *swift_object_image
|
||||||
|
@ -417,6 +428,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_object_server:
|
swift_object_server:
|
||||||
image: *swift_object_image
|
image: *swift_object_image
|
||||||
|
@ -434,6 +446,7 @@ outputs:
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
- /var/cache/swift:/var/cache/swift
|
- /var/cache/swift:/var/cache/swift
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
swift_rsync:
|
swift_rsync:
|
||||||
image: *swift_object_image
|
image: *swift_object_image
|
||||||
|
@ -449,9 +462,9 @@ outputs:
|
||||||
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
|
- /var/lib/config-data/puppet-generated/swift/:/var/lib/kolla/config_files/src:ro
|
||||||
- /srv/node:/srv/node
|
- /srv/node:/srv/node
|
||||||
- /dev:/dev
|
- /dev:/dev
|
||||||
|
- /var/log/containers/swift:/var/log/swift
|
||||||
# /var/cache/swift not needed in this container
|
# /var/cache/swift not needed in this container
|
||||||
environment: *kolla_env
|
environment: *kolla_env
|
||||||
|
|
||||||
host_prep_tasks:
|
host_prep_tasks:
|
||||||
- name: create persistent directories
|
- name: create persistent directories
|
||||||
file:
|
file:
|
||||||
|
@ -461,6 +474,7 @@ outputs:
|
||||||
- /srv/node
|
- /srv/node
|
||||||
- /var/log/swift
|
- /var/log/swift
|
||||||
- /var/log/containers
|
- /var/log/containers
|
||||||
|
- /var/log/containers/swift
|
||||||
- name: Set swift_use_local_disks fact
|
- name: Set swift_use_local_disks fact
|
||||||
set_fact:
|
set_fact:
|
||||||
swift_use_local_disks: {get_param: SwiftUseLocalDir}
|
swift_use_local_disks: {get_param: SwiftUseLocalDir}
|
||||||
|
@ -469,15 +483,6 @@ outputs:
|
||||||
path: "/srv/node/d1"
|
path: "/srv/node/d1"
|
||||||
state: directory
|
state: directory
|
||||||
when: swift_use_local_disks
|
when: swift_use_local_disks
|
||||||
- stat: path=/var/log/swift
|
|
||||||
register: swift_log_stat
|
|
||||||
- name: Create swift logging symlink
|
|
||||||
file:
|
|
||||||
src: /var/log/swift
|
|
||||||
dest: /var/log/containers/swift
|
|
||||||
state: link
|
|
||||||
ignore_errors: "{{ ansible_check_mode }}"
|
|
||||||
when: swift_log_stat.stat.exists
|
|
||||||
- name: swift logs readme
|
- name: swift logs readme
|
||||||
copy:
|
copy:
|
||||||
dest: /var/log/swift/readme.txt
|
dest: /var/log/swift/readme.txt
|
||||||
|
@ -494,7 +499,7 @@ outputs:
|
||||||
copy:
|
copy:
|
||||||
content: |
|
content: |
|
||||||
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
|
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
|
||||||
local2.* /var/log/swift/swift.log
|
local2.* /var/log/containers/swift/swift.log
|
||||||
& stop
|
& stop
|
||||||
dest: /etc/rsyslog.d/openstack-swift.conf
|
dest: /etc/rsyslog.d/openstack-swift.conf
|
||||||
register: logconfig
|
register: logconfig
|
||||||
|
@ -598,6 +603,15 @@ outputs:
|
||||||
file:
|
file:
|
||||||
path: /var/run/rsyncd.pid
|
path: /var/run/rsyncd.pid
|
||||||
state: absent
|
state: absent
|
||||||
|
- name: Check swift containers log folder/symlink exists
|
||||||
|
stat:
|
||||||
|
path: /var/log/containers/swift
|
||||||
|
register: swift_log_link
|
||||||
|
- name: Delete if symlink
|
||||||
|
file:
|
||||||
|
path: /var/log/containers/swift
|
||||||
|
state: absent
|
||||||
|
when: swift_log_link.stat.islnk is defined and swift_log_link.stat.islnk
|
||||||
fast_forward_upgrade_tasks:
|
fast_forward_upgrade_tasks:
|
||||||
- when:
|
- when:
|
||||||
- step|int == 0
|
- step|int == 0
|
||||||
|
|
Loading…
Reference in New Issue