Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
cf502735
Commit
cf502735
authored
8 years ago
by
Smaine Kahlouch
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #407 from bogdando/ansible_logs
Collect ansible logs as artifacts
parents
677c4c4c
252a30ae
No related branches found
No related tags found
Loading
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.travis.yml
+2
-0
2 additions, 0 deletions
.travis.yml
scripts/configure-logs.yaml
+39
-0
39 additions, 0 deletions
scripts/configure-logs.yaml
with
41 additions
and
0 deletions
.travis.yml
+
2
−
0
View file @
cf502735
...
...
@@ -109,6 +109,8 @@ before_script:
-
$HOME/.local/bin/ansible-playbook --version
-
cp tests/ansible.cfg .
# - "echo $HOME/.local/bin/ansible-playbook -i inventory.ini -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root -e '{\"cloud_provider\": true}' $LOG_LEVEL -e kube_network_plugin=${KUBE_NETWORK_PLUGIN} setup-kubernetes/cluster.yml"
## Configure ansible deployment logs to be collected as an artifact. Enable when GCS configured, see https://docs.travis-ci.com/user/deployment/gcs
# - $HOME/.local/bin/ansible-playbook -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root scritps/configure-logs.yaml
script
:
-
>
...
...
This diff is collapsed.
Click to expand it.
scripts/configure-logs.yaml
0 → 100644
+
39
−
0
View file @
cf502735
---
-
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment