Merge "Disable callback plugins"

This commit is contained in:
Jenkins 2017-03-01 14:57:30 +00:00 committed by Gerrit Code Review
commit c3918e9c2b
2 changed files with 0 additions and 54 deletions

View File

@ -1,20 +1,6 @@
bin_dir: /usr/local/bin
log_path: /var/log/ansible/
conf_file: /etc/ansible/ansible.cfg
callback_plugins:
- name: human_readable_plugin
enabled: true
repo: https://gist.github.com/cd706de198c85a8255f6.git
rev: cd706de198c85a8255f6
script_path: ./
script_name: human_log.py
- name: timestamp_plugin
enabled: true
repo: https://github.com/bogdando/ansible-plugins.git
rev: 0.1.0
script_path: ./callback_plugins
script_name: timestamp.py
callback_plugin_path: /usr/share/ansible/plugins/callback
# Define custom diag info to collect
commands:
- name: git_info

View File

@ -6,12 +6,6 @@
state: directory
owner: "{{ansible_ssh_user}}"
- name: Configure logs | ensure plugin path
file:
path: "{{callback_plugin_path}}"
state: directory
owner: "{{ansible_ssh_user}}"
- name: Configure logs | ensure config dir
file:
path: "{{conf_file | dirname}}"
@ -30,46 +24,12 @@
group: root
mode: 0644
- name: Configure logs | get plugins
git:
repo: "{{item.repo}}"
dest: "/tmp/{{item.name}}/{{item.rev}}"
when: "{{item.enabled == true}}"
with_items: "{{callback_plugins}}"
- name: Configure logs | install plugins
copy:
src: "/tmp/{{item.name}}/{{item.rev}}/{{item.script_path}}/{{item.script_name}}"
dest: "{{callback_plugin_path}}"
when: "{{item.enabled == true}} "
with_items: "{{callback_plugins}}"
- name: Configure logs | remove disabled plugins
file:
path: "{{callback_plugin_path}}/{{item.script_name}}"
state: absent
when: "{{item.enabled == false}}"
with_items: "{{callback_plugins}}"
- name: Configure logs | teardown plugins
file:
path: "/tmp/{{item.name}}/{{item.rev}}"
state: absent
when: "{{item.enabled == true}}"
with_items: "{{callback_plugins}}"
- name: Configure logs | config
lineinfile:
line: "log_path={{log_path}}/ansible.log"
regexp: "^#log_path|^log_path"
dest: "{{conf_file}}"
- name: Configure logs | callback plugin
lineinfile:
line: "callback_plugins={{callback_plugin_path}}"
regexp: "^#callback_plugins|^callback_plugins"
dest: "{{conf_file}}"
- name: Configure logs | Install script for collecting info
template:
src: collect_logs.sh.j2