Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos.package
Commits
465a903f
Commit
465a903f
authored
Jun 16, 2016
by
Alain Takoudjou
Committed by
Rafael Monnerat
Jun 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log_parse plugin compatible with Ansible version 1 and 2
parent
ddb01dec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
playbook/roles/install-script/files/log_parse
playbook/roles/install-script/files/log_parse
+11
-3
No files found.
playbook/roles/install-script/files/log_parse
View file @
465a903f
...
@@ -2,9 +2,16 @@
...
@@ -2,9 +2,16 @@
import os
import os
import time
import time
import json
import json
from ansible.plugins.callback import CallbackBas
e
import ansibl
e
class CallbackModule(CallbackBase):
baseModule = object
ANSIBLE_VERSION = 1
if hasattr(ansible, 'plugins') and hasattr(ansible.plugins, 'callback'):
baseModule = ansible.plugins.callback.CallbackBase
ANSIBLE_VERSION = 2
class CallbackModule(baseModule):
"""
"""
logs playbook results, per host, in /var/log/ansible/hosts
logs playbook results, per host, in /var/log/ansible/hosts
"""
"""
...
@@ -13,7 +20,8 @@ class CallbackModule(CallbackBase):
...
@@ -13,7 +20,8 @@ class CallbackModule(CallbackBase):
def __init__(self):
def __init__(self):
super(CallbackModule, self).__init__()
if ANSIBLE_VERSION > 1:
super(baseModule, self).__init__()
if not os.path.exists(self.log_path):
if not os.path.exists(self.log_path):
os.makedirs(self.log_path)
os.makedirs(self.log_path)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment