Add option for debug logging for containers

This adds a patch to allow debug logging to be enabled when
creating containers.

This is useful for troubleshooting why containers fail to
build/start.

Change-Id: I3b4a0be8cff6b5c3397fdfe2a087522e3ee5f32b
This commit is contained in:
Jesse Pretorius 2016-07-17 16:51:26 +01:00
parent e990f5c1c1
commit f036c25411
2 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
## Verbosity Options
debug: False
lxc_container_config: /etc/lxc/lxc-openstack.conf
# Mappings from Ansible reported architecture to distro release architecture
@ -23,6 +26,7 @@ lxc_architecture_mapping:
# lxc container rootfs directory and cache path
lxc_container_directory: "/var/lib/lxc"
lxc_container_cache_path: "/var/cache/lxc"
lxc_container_log_path: "/var/log/lxc"
lxc_container_rootfs_directory: "{{ lxc_container_directory }}/{{ container_name }}/rootfs"
# container_fs.* is only used with building on an LVM backend

View File

@ -58,6 +58,7 @@
lxc_container:
name: "{{ inventory_hostname }}"
container_log: "true"
container_log_level: "{{ (debug | bool) | ternary('DEBUG', 'INFO') }}"
config: "{{ lxc_container_config }}"
template: "{{ lxc_container_template }}"
state: started
@ -100,6 +101,8 @@
--name {{ lxc_container_map.distro }}-{{ lxc_container_map.release }}-{{ lxc_container_map.arch }}
--newname {{ inventory_hostname }}
-L {{ properties.container_fs_size | default(lxc_container_fs_size) }}
--logfile {{ lxc_container_log_path }}/lxc-{{ inventory_hostname }}.log
--logpriority {{ (debug | bool) | ternary('DEBUG', 'INFO') }}
delegate_to: "{{ physical_host }}"
when:
- lxc_container_backing_store == "overlayfs"