Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kolla Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kolla Ansible
Commits
52611ecb
Commit
52611ecb
authored
1 year ago
by
Zuul
Committed by
Gerrit Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "Fix maximum width of the DIB Multiline-YAML"
parents
c0a45c7e
47862b56
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible/action_plugins/merge_yaml.py
+13
-1
13 additions, 1 deletion
ansible/action_plugins/merge_yaml.py
ansible/roles/bifrost/tasks/config.yml
+1
-0
1 addition, 0 deletions
ansible/roles/bifrost/tasks/config.yml
with
14 additions
and
1 deletion
ansible/action_plugins/merge_yaml.py
+
13
−
1
View file @
52611ecb
...
...
@@ -55,6 +55,14 @@ options:
default: False
required: False
type: bool
yaml_width:
description:
- The maximum width of the YAML document. By default, Ansible uses the
PyYAML library which has a default 80 symbol string length limit.
To change the limit, the new value can be used here.
default: None
required: False
type: int
author: Sean Mooney
'''
...
...
@@ -68,6 +76,7 @@ Merge multiple yaml files:
sources:
-
"
/tmp/default.yml
"
-
"
/tmp/override.yml
"
yaml_width: 131072
dest:
-
"
/tmp/out.yml
"
'''
...
...
@@ -113,6 +122,7 @@ class ActionModule(action.ActionBase):
output
=
{}
sources
=
self
.
_task
.
args
.
get
(
'
sources
'
,
None
)
extend_lists
=
self
.
_task
.
args
.
get
(
'
extend_lists
'
,
False
)
yaml_width
=
self
.
_task
.
args
.
get
(
'
yaml_width
'
,
None
)
if
not
isinstance
(
sources
,
list
):
sources
=
[
sources
]
for
source
in
sources
:
...
...
@@ -127,11 +137,13 @@ class ActionModule(action.ActionBase):
try
:
result_file
=
os
.
path
.
join
(
local_tempdir
,
'
source
'
)
with
open
(
result_file
,
'
w
'
)
as
f
:
f
.
write
(
yaml
.
dump
(
output
,
default_flow_style
=
False
))
f
.
write
(
yaml
.
dump
(
output
,
default_flow_style
=
False
,
width
=
yaml_width
))
new_task
=
self
.
_task
.
copy
()
new_task
.
args
.
pop
(
'
sources
'
,
None
)
new_task
.
args
.
pop
(
'
extend_lists
'
,
None
)
new_task
.
args
.
pop
(
'
yaml_width
'
,
None
)
new_task
.
args
.
update
(
dict
(
src
=
result_file
...
...
This diff is collapsed.
Click to expand it.
ansible/roles/bifrost/tasks/config.yml
+
1
−
0
View file @
52611ecb
...
...
@@ -17,6 +17,7 @@
-
"
{{
node_custom_config
}}/{{
item
}}.yml"
-
"
{{
node_custom_config
}}/bifrost/{{
item
}}.yml"
dest
:
"
{{
node_config_directory
}}/bifrost/{{
item
}}.yml"
yaml_width
:
131072
mode
:
"
0660"
become
:
true
with_items
:
...
...
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