commit
482abf3bf0
@ -0,0 +1,24 @@
|
||||
#!/bin/bash -xe
|
||||
# Copyright 2019 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
DEST="/afs/.openstack.org/mirror/logs/"
|
||||
|
||||
K5START="k5start -t -f /etc/logs.keytab service/logs-mirror --"
|
||||
RSYNC="rsync -avz --no-perms --no-owner --no-group"
|
||||
|
||||
$K5START $RSYNC /var/log/rsync-mirrors $DEST
|
||||
|
||||
# NOTE(ianw) : r/w volume as this is infrequently accessed; thus no
|
||||
# replications and no "vos release" etc required.
|
@ -0,0 +1,32 @@
|
||||
- name: Install log publisher keytab
|
||||
shell: 'echo "{{ mirror_update_keytab_logs }}" | base64 -d > /etc/logs.keytab'
|
||||
args:
|
||||
creates: /etc/logs.keytab
|
||||
no_log: True
|
||||
|
||||
- name: Ensure permissions on log publisher keytab
|
||||
file:
|
||||
path: '/etc/logs.keytab'
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0400'
|
||||
|
||||
- name: Copy log publisher script
|
||||
copy:
|
||||
src: 'publish-mirror-logs'
|
||||
dest: '/usr/local/bin/publish-mirror-logs'
|
||||
mode: '0755'
|
||||
|
||||
- name: Install log publisher cron job
|
||||
cron:
|
||||
name: 'Publish mirror logs'
|
||||
state: present
|
||||
job: 'publish-mirror-logs >> /var/log/publish-mirror-logs.log 2>&1'
|
||||
hour: '*'
|
||||
minute: '30'
|
||||
|
||||
- name: Install logrotate rules
|
||||
include_role:
|
||||
name: logrotate
|
||||
vars:
|
||||
logrotate_file_name: '/var/log/publish-mirror-logs.log'
|
Loading…
Reference in new issue