k8s-sig-cluster-lifecycleawskubesprayhigh-availabilityansiblekubernetes-clustergcekubernetesbare-metal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
---
|
|
- hosts: localhost
|
|
become: true
|
|
gather_facts: no
|
|
|
|
vars:
|
|
log_path: /var/log/ansible/
|
|
conf_file: /etc/ansible/ansible.cfg
|
|
human_readable_plugin: false
|
|
callback_plugin_path: /usr/share/ansible/plugins/callback
|
|
|
|
tasks:
|
|
- name: LOGS | ensure log path
|
|
file: path="{{log_path}}" state=directory owner={{ansible_ssh_user}}
|
|
|
|
- name: LOGS | ensure plugin path
|
|
file: path="{{callback_plugin_path}}" state=directory owner={{ansible_ssh_user}}
|
|
when: human_readable_plugin
|
|
|
|
- name: LOGS | get plugin
|
|
git: repo=https://gist.github.com/cd706de198c85a8255f6.git dest=/tmp/cd706de198c85a8255f6
|
|
when: human_readable_plugin
|
|
|
|
- name: LOGS | install plugin
|
|
copy: src=/tmp/cd706de198c85a8255f6/human_log.py dest="{{callback_plugin_path}}"
|
|
when: human_readable_plugin
|
|
|
|
- name: LOGS | config
|
|
lineinfile:
|
|
line: "log_path={{log_path}}/ansible.log"
|
|
regexp: "^#log_path|^log_path"
|
|
dest: "{{conf_file}}"
|
|
|
|
- name: LOGS | callback plugin
|
|
lineinfile:
|
|
line: "callback_plugins={{callback_plugin_path}}"
|
|
regexp: "^#callback_plugins|^callback_plugins"
|
|
dest: "{{conf_file}}"
|
|
when: human_readable_plugin
|