Skip to content

Commit

Permalink
Use systemd-journald instead of log files
Browse files Browse the repository at this point in the history
This patch aims to migrate service from usage of regular syslog files
to journald. We also disable uwsgi logging, since it dublicates
requests that are logged by service itself.

Change-Id: I9f8a7f92d644775bd673dbade73fbaa1268712d5
  • Loading branch information
Dmitriy Rabotyagov committed Jul 16, 2019
1 parent 3cfc0ca commit 88c29bb
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 25 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Expand Up @@ -211,6 +211,7 @@ heat_pip_packages:
- python-openstackclient
- python-swiftclient
- python-troveclient
- systemd-python
- uwsgi

# Specific pip packages provided by the user
Expand Down
1 change: 1 addition & 0 deletions tasks/heat_install.yml
Expand Up @@ -41,6 +41,7 @@
name: "python_venv_build"
vars:
venv_build_constraints: "{{ heat_git_constraints }}"
venv_build_distro_package_list: "{{ heat_devel_distro_packages }}"
venv_install_destination_path: "{{ heat_bin | dirname }}"
venv_install_distro_package_list: "{{ heat_distro_packages }}"
venv_pip_install_args: "{{ heat_pip_install_args }}"
Expand Down
23 changes: 0 additions & 23 deletions tasks/heat_pre_install.yml
Expand Up @@ -93,26 +93,3 @@
group: "{{ heat_system_group_name }}"
mode: "{{ item.mode|default('0755') }}"
with_items: "{{ heat_plugin_dirs }}"

- name: Test for log directory or link
shell: |
if [ -h "/var/log/heat" ]; then
chown -h {{ heat_system_user_name }}:{{ heat_system_group_name }} "/var/log/heat"
chown -R {{ heat_system_user_name }}:{{ heat_system_group_name }} "$(readlink /var/log/heat)"
else
exit 1
fi
register: log_dir
failed_when: false
changed_when: log_dir.rc != 0

- name: Create heat log dir
file:
path: "{{ item.path }}"
state: directory
owner: "{{ item.owner|default(heat_system_user_name) }}"
group: "{{ item.group|default(heat_system_group_name) }}"
mode: "{{ item.mode|default('0755') }}"
with_items:
- { path: "/var/log/heat" }
when: log_dir.rc != 0
2 changes: 1 addition & 1 deletion templates/heat-uwsgi.ini.j2
Expand Up @@ -21,7 +21,7 @@ lazy-apps = true
add-header = Connection: close
buffer-size = {{ heat_wsgi_buffer_size }}
thunder-lock = true
logfile-chmod = 644
disable-logging = true

# Avoid filling up the logs with health check requests from haproxy.
route-user-agent = ^osa-haproxy-healthcheck$ donotlog:
2 changes: 1 addition & 1 deletion templates/heat.conf.j2
Expand Up @@ -6,7 +6,7 @@ use_stderr = False
debug = {{ debug }}
fatal_deprecations = {{ heat_fatal_deprecations }}

log_file = /var/log/heat/heat.log
use_journal = True

stack_domain_admin_password = {{ heat_stack_domain_admin_password }}
stack_domain_admin = {{ heat_stack_domain_admin }}
Expand Down
4 changes: 4 additions & 0 deletions vars/debian.yml
Expand Up @@ -21,8 +21,12 @@ heat_distro_packages:
- libxslt1.1
- libopenmpi-dev

heat_devel_distro_packages:
- libsystemd-dev

heat_service_distro_packages:
- python3-heat
- python3-systemd
- uwsgi
- uwsgi-plugin-python3

Expand Down
4 changes: 4 additions & 0 deletions vars/redhat-7.yml
Expand Up @@ -19,12 +19,16 @@ heat_distro_packages:
- which
- openmpi-devel

heat_devel_distro_packages:
- systemd-devel

heat_service_distro_packages:
- openstack-heat-agents
- openstack-heat-api
- openstack-heat-api-cfn
- openstack-heat-engine
- openstack-heat-ui
- systemd-python
- uwsgi
- uwsgi-plugin-python

Expand Down
4 changes: 4 additions & 0 deletions vars/suse.yml
Expand Up @@ -18,12 +18,16 @@ heat_distro_packages:
- libxslt1
- openmpi

heat_devel_distro_packages:
- systemd-devel

heat_service_distro_packages:
- openstack-heat
- openstack-heat-api
- openstack-heat-api-cfn
- openstack-heat-engine
- openstack-heat-templates
- python-systemd
- uwsgi-python

heat_oslomsg_amqp1_distro_packages:
Expand Down

0 comments on commit 88c29bb

Please sign in to comment.