Merge "Disable callback plugins"
This commit is contained in:
commit
c3918e9c2b
|
@ -1,20 +1,6 @@
|
||||||
bin_dir: /usr/local/bin
|
bin_dir: /usr/local/bin
|
||||||
log_path: /var/log/ansible/
|
log_path: /var/log/ansible/
|
||||||
conf_file: /etc/ansible/ansible.cfg
|
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
|
# Define custom diag info to collect
|
||||||
commands:
|
commands:
|
||||||
- name: git_info
|
- name: git_info
|
||||||
|
|
|
@ -6,12 +6,6 @@
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ansible_ssh_user}}"
|
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
|
- name: Configure logs | ensure config dir
|
||||||
file:
|
file:
|
||||||
path: "{{conf_file | dirname}}"
|
path: "{{conf_file | dirname}}"
|
||||||
|
@ -30,46 +24,12 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
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
|
- name: Configure logs | config
|
||||||
lineinfile:
|
lineinfile:
|
||||||
line: "log_path={{log_path}}/ansible.log"
|
line: "log_path={{log_path}}/ansible.log"
|
||||||
regexp: "^#log_path|^log_path"
|
regexp: "^#log_path|^log_path"
|
||||||
dest: "{{conf_file}}"
|
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
|
- name: Configure logs | Install script for collecting info
|
||||||
template:
|
template:
|
||||||
src: collect_logs.sh.j2
|
src: collect_logs.sh.j2
|
||||||
|
|
Loading…
Reference in New Issue