diff --git a/playbooks/roles/nodepool-base/tasks/main.yaml b/playbooks/roles/nodepool-base/tasks/main.yaml index 1db9045a09..55820437b6 100644 --- a/playbooks/roles/nodepool-base/tasks/main.yaml +++ b/playbooks/roles/nodepool-base/tasks/main.yaml @@ -25,6 +25,14 @@ group: nodepool mode: 0755 +- name: Create nodepool log dir + file: + name: /var/log/nodepool + state: directory + owner: nodepool + group: nodepool + mode: 0755 + - name: Look for a host specific config file stat: path: /opt/project-config/nodepool/{{ inventory_hostname }}.yaml diff --git a/playbooks/roles/nodepool-builder/files/logging.conf b/playbooks/roles/nodepool-builder/files/logging.conf new file mode 100644 index 0000000000..9de3dd722d --- /dev/null +++ b/playbooks/roles/nodepool-builder/files/logging.conf @@ -0,0 +1,55 @@ +[loggers] +keys=root,nodepool,requests,openstack,kazoo + +[handlers] +keys=console,debug,normal + +[formatters] +keys=simple + +[logger_root] +level=WARNING +handlers=console + +[logger_requests] +level=WARNING +handlers=debug,normal +qualname=requests + +[logger_openstack] +level=WARNING +handlers=debug,normal +qualname=openstack + +[logger_nodepool] +level=DEBUG +handlers=debug,normal +qualname=nodepool + +[logger_kazoo] +level=INFO +handlers=debug,normal +qualname=kazoo +propagate=0 + +[handler_console] +level=WARNING +class=StreamHandler +formatter=simple +args=(sys.stdout,) + +[handler_debug] +level=DEBUG +class=logging.handlers.TimedRotatingFileHandler +formatter=simple +args=('/var/log/nodepool/builder-debug.log', 'H', 8, 30,) + +[handler_normal] +level=INFO +class=logging.handlers.TimedRotatingFileHandler +formatter=simple +args=('/var/log/nodepool/nodepool-builder.log', 'H', 8, 30,) + +[formatter_simple] +format=%(asctime)s %(levelname)s %(name)s: %(message)s +datefmt= diff --git a/playbooks/roles/nodepool-builder/tasks/main.yaml b/playbooks/roles/nodepool-builder/tasks/main.yaml index db821cd593..a65cbcdee3 100644 --- a/playbooks/roles/nodepool-builder/tasks/main.yaml +++ b/playbooks/roles/nodepool-builder/tasks/main.yaml @@ -1,3 +1,8 @@ +- name: Copy logging config + copy: + src: logging.conf + dest: /etc/nodepool/builder-logging.conf + - name: Ensure dib directories file: state: directory diff --git a/playbooks/roles/nodepool-builder/templates/docker-compose.yaml.j2 b/playbooks/roles/nodepool-builder/templates/docker-compose.yaml.j2 index 3594256ed4..41d5eac840 100644 --- a/playbooks/roles/nodepool-builder/templates/docker-compose.yaml.j2 +++ b/playbooks/roles/nodepool-builder/templates/docker-compose.yaml.j2 @@ -5,6 +5,7 @@ services: user: nodepool network_mode: host restart: always + command: nodepool-builder -c /etc/nodepool/nodepool.yaml -l /etc/nodepool/builder-logging.conf privileged: true diff --git a/playbooks/roles/nodepool-launcher/templates/docker-compose.yaml.j2 b/playbooks/roles/nodepool-launcher/templates/docker-compose.yaml.j2 index 95c8d8fce7..1cee0cae60 100644 --- a/playbooks/roles/nodepool-launcher/templates/docker-compose.yaml.j2 +++ b/playbooks/roles/nodepool-launcher/templates/docker-compose.yaml.j2 @@ -5,6 +5,7 @@ services: user: nodepool network_mode: host restart: always + command: nodepool-launcher -c /etc/nodepool/nodepool.yaml -l /etc/nodepool/launcher-logging.conf environment: - DEBUG=1