Questions tagged [yaml]
3293 questions
1
votes
2
answer
2.2k
Views
What does “!Sub |” mean in AWS UserData field with YAML syntax?
In this example from AWS docs we have a UserData field that allows a multiline string, using the following syntax:
UserData:
Fn::Base64: !Sub |
#!/bin/bash -xe
yum update -y aws-cfn-bootstrap
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --region ${AWS::Region}
/opt/aws/...
1
votes
1
answer
2.6k
Views
Swagger 3.0 schema error “should NOT have additional properties”
What does this error below mean? (Running in Swagger Editor)
Schema error should NOT have additional properties additionalProperty:
/buildinfo, /clearcache,
/countries/{countryId}/cinemas/{theatreid}/screens/{screenid}/layout,
/countries/{countryId}/cinemas/{theatreid}/screens Jump to line 0
Below i...
0
votes
0
answer
4
Views
How to set environments automatic?
i want to set my environments automatically when i bind a Service with my application. For Example:
Now i have to set my environments for the datasource manuell, but i want to set it automatically, how does it work ?
thorntail:
datasources:
data-sources:
FleetDS:
driver-name: postgresql
connection-u...
1
votes
1
answer
96
Views
How to return boolean value from a function in Kotlin
I am new to kotlin.
I am reading a key and value from properties file, in a kotlin program. But I don't know how to directly return the value of a key.
Please find the application.yml and abc.class(this is a kotlin class) below.
application.yml
abcconfig:
isabcEnabled:
default: false
xyz: true
def:...
1
votes
1
answer
58
Views
Yq: retrieve object keys names
I have a YAML file (docker-compose file in my case) that looks like this:
networks:
foo:
some_opts: 'covfefe'
bar:
some_opts: 'such wow'
services:
apache:
image: 'apache:1.0.0'
restart: always
mysql:
image: 'mysql:1.0.0'
restart: always
php:
image: 'php'
restart: always
I would like to extract the s...
1
votes
2
answer
36
Views
docker-compose.yaml won't parse
I am having trouble with running my docker-compose.yml. I have retrieved a pre-made docker-compose file from a github page and customized it to my needs. When trying to parse it, it returns errors.
I am not very schooled in yaml syntax, so it is difficult for me to understand where the error stems f...
1
votes
1
answer
18
Views
YAML - Dumping a nested object without types/tags
I'm trying to dump some Python objects out into YAML.
Currently, regardless of YAML library (pyyaml, oyaml, or ruamel) I'm having an issue where calling .dump(MyObject) gives me correct YAML, but seems to add a lot of metadata about the Python objects that I don't want, in a form that looks like:
!!...
0
votes
0
answer
4
Views
Karate: How to configure karate mock-servlet using a YAML file instead of application.properties?
We have a Spring Boot project which uses an application.yml file to configure the spring context for things like datasource, rabbitmq etc.
The yml file can be loaded in the karate-config.js to pick-up the baseUrl and that works fine.
function fn() {
var env = karate.env; // get system property '...
0
votes
0
answer
5
Views
How to use `inject-passwords`in yaml for jenkins?
I am using a yaml file to configure a jenkins job, and I came across the feature inject-passwords (see here). However, this documentation neither describes on how to use the variable within the jenkins environment, nor what 'encrypted' password means (How to encrypt?). The link leading to the EnvInj...
2
votes
0
answer
22
Views
How to export typescript into a YAML list
I would like to reference a Typescript file that exports an object as a list of mappings in a YAML file.
So far, I figured out how to insert mappings using a JS file that routes to an exported Typescript object with the following code:
//YAML file
functions:
- ${file(./functions.js):functions}
// f...
1
votes
2
answer
721
Views
Can I remove actuator word from spring boot 2 actuator integration for health check
I have used spring-boot-acturator for health check in my micro-services. And earlier my health api was:
mydomain:healthPort/health
Which are already integrated with Third party health check clients. Now after upgrading the spring-boot version to spring-boot 2 my health api became :
mydomain:healthPo...
1
votes
1
answer
198
Views
Using Environment Variables in a cURL request on Azure Devops
I'm trying to upload a zip file to Netlify with a command line task using cURL on Azure DevOps.
Obviously I don't want to have my Netlify access token in the yaml file, so I've created a secret variable for it (using the UI designer) and mapped it using the syntax in the docs.
However I keep gettin...
1
votes
3
answer
69
Views
Wrong result when evaluating multi-line boolean variable in Ansible yaml file
Using ansible 2.7.5 I am trying to create a multi-line boolean parameter.
I first verified that it works as expected as one-line with:
FOOD: apple
IS_FRUIT: '{% if FOOD == 'carrot' %}false{% elif FOOD == 'apple' or FOOD == 'banana' %}true{% endif %}'
and then a task:
- name: 'FOOD is: {{ FOOD }}'
d...
1
votes
1
answer
73
Views
How do I pass an array of configurations to a YAML file in Golang?
I am trying to create a YAML configuration file using gosexy/yaml.
I know how to create a YAML file of the following format:
another:
tree:
- 1
I use the code settings.Set('another','tree',[]int{1}) to create the above file.
Now, how can I create a file of the format
another:
- tree: 1
I tried using...
1
votes
1
answer
39
Views
gitlab pipeline on sub projects
Suppose main project has sub-projects
MainProject/
\-------- android
\-------- .gitlab-ci-android.yml
\-------- ios
\-------- lib
\-------- .gitlab-ci.yml
I want my .gitlab-ci.yml to run parallel jobs for each subfolder. My goal is to have separate .gitlab-ci.yml files. Yes, it looks messy to touch...
7
votes
1
answer
212
Views
Modify existing yaml file and add new data and comments
I recently saw that the go yaml lib has new version (V3)
with the nodes capabilities (which in my opinion is a killer feature :) ) which can helps a lots with modifying yamls without changing the structure of the file
But since it is fairly new (from last week ) I didn't find some helpful docs and e...
1
votes
1
answer
49
Views
Ansible issue with line file module
I have sample file called clado.txt with following content.
[server]
[backend]
[frontend]
I am trying to inset a line 'apache1' under the [server] section.
[server]
apache1
[backend]
[frontend]
My playbook
---
- hosts: aws
become: yes
remote_user: ec2-user
tasks:
- name: editing /home/ec2-user/clad...
1
votes
1
answer
273
Views
How can i access application.yml values at entity class level
I am working on spring boot application and using application.yml file for configuration and looks like:
center:
setting:
beforeCancellationLimit:
min: 0
max: 50
maximumBeforeCancellationLimit:
min: 0
max: 60
rangeOfCancellation:
min: 0
max: 30
I want to access these values into my @Entity level cla...
1
votes
1
answer
282
Views
Is it possible to embed YAML into a JSON payload?
Is it possible to embed YAML into a JSON payload? And if so, How?
I'm trying to come up with a JSON request which has a embedded YAML embedded, a very large YAML file at that:
{
'deployment':{
'family':'mui',
'assemblyfile': 'large YAML file here'
}
}
1
votes
0
answer
378
Views
swagger editor UI sends a OPTIONS request method instead of PUT and DELETE
http://editor.swagger.io sends a OPTIONS request method instead of PUT and DELETE but for POST and GET it's work perfectly
even I have installed a Chrome extension that adds Access-Control-Allow-Origin to outgoing requests. and same added in the c# code like below
[EnableCors(origins: '', headers:...
1
votes
0
answer
100
Views
Symfony Repository service configuration with multiple connections
I have a Symfony app with two different database connections. Until yesterday I only needed the default connection but now I need the other one.
I configure my services in yaml and I have absolutely no idea what I have to do differently for the other connection to inject my repository.
The configur...
1
votes
0
answer
73
Views
Task Queue Issue - Endpoint v2, Google App Engine
We are facing issues with taskqueues after recently updating the Endpoints API to version 2 in Google App Engine - Python. Following are the issues faced with respect to taskqueus,
Taskqueue doesn't get added to the queue at all , Just gets ignored and never executed.
Taskqueue get terminated with e...
1
votes
0
answer
446
Views
how to Appoint yml file path
I have use springboot to creat a project.
when I make yml file at src/main/resources/config or src/main/resources , I cant set :
spring:
profiles:
include:
- 'scheduling'
- 'yml'
in application.yml to appoint file file path,
and use @Value('${importance_info.message.notice}') to get the appointed v...
1
votes
2
answer
334
Views
Disqus comments on Jekyll show when hosted on localhost but not when hosted on GitHubPages
I've created a blog type page using Jekyll and hosting it using GitHub pages. I've recently tried to add disqus comments; when inside my directory and I run a Jekyll serve and I access my page via localhost:4000 the comments are there and are fully functional. My problem comes when I push my changes...
1
votes
2
answer
185
Views
How to print a Java List to a Yaml List in brace ([ ]) format, using Jackson yaml
I am trying to find a way to print Java ArrayLists to Yaml lists, in the following format:
[list-element1,list-element2,list-element3...]
However,I have only managed to print them into Yaml lists in the alternative format:
-list-element1
-list-element2
-list-element3
Is there a way that the first ca...
1
votes
0
answer
195
Views
yaml file create a container cluster in google cloud platform
I am trying create a cluster with the help of deployment manager script. I found some python scripts to do that in GitHub. But I am looking for YAML file. PLease share any reference.
1
votes
0
answer
345
Views
Trouble configuring Nginx with puppet/nginx module using Hiera
I'm trying to configure Nginx with puppet/nginx module from forge.puppet.com (by Vox Pupuli), using this Hiera yaml file:
nginx::nginx_servers:
'devops-alldomains':
server_name:
- '~^(?.+?)$'
www_root: '/var/www/$fqdn'
index_files:
- 'index.php'
try_files:
- '$uri'
- '$uri/'
- '/index.php?$args'
acc...
1
votes
1
answer
178
Views
CircleCI test failing due to the “hstore” Postgres extension not being installed
I'm trying to get a certain commit to pass the tests on CircleCI, but there are some differences with my local environment that I'm still trying to resolve. Here is the ./circleci/config.yml file:
version: 2
jobs:
build:
working_directory: ~/lucy/lucy_web/
docker:
- image: python:3.6.0
environment:...
1
votes
1
answer
256
Views
How do I programmatically read/parse yml values using Spring Boot's SPEL?
If I have an annotation where people can set an SPEL expression (it might have yaml/environment values), how would I parse this to find the actual values?
Example:
public @interface TestA
{
String spel() default '';
}
@TestA( spel = '${some.value.in.app.yml}' )
public class Test {}
The application.y...
0
votes
0
answer
20
Views
Python Template
I am creating a python script to validate mongodb credentials for all databases, How to create a template to solve my purpose ?
I tried hardcoding the keys which are in my yaml file, i dont want to do that, could anyone help me?
from yaml import load
import argparse
import os
from string import Temp...
0
votes
0
answer
3
Views
PHP MVC: Choose .env or .yaml files for sensitive data in MVC application?
Currenly, in my web MVC application I have a pretty flexible configuration system, with configuration settins defined in .php files (in a config directory). Though, sensitive data (like db credentials, etc) is saved in some .env files, as CONSTANT_NAME= pairs. Technically, these values overwrite any...
1
votes
1
answer
184
Views
Create Jekyll link from YAML array
I have a YAML array in a file called navigation.yml as follows:
docs:
- title: Home
url: index.md
id: index
- title: Support
url: support.html
id: support
- title: About
url: about.md
id: about
I am creating a navigation bar as follows:
{% for item in site.data.navigation.docs %}
{{ item.title }}
{%...
1
votes
1
answer
478
Views
Unmarshal a YAML to a struct with unexpected fields in Go
I encountered an issue while trying to unmarshal a struct with an unexported field using github.com/go-yaml/yaml. The struct looks like:
type Example struct {
ExportedField string `yaml:'exported-field'`
OneMoreExported string `yaml:'one-more-exported'`
unex...
1
votes
0
answer
304
Views
convert jenkins config.xml to yaml to used in jenkins_job_builder
I am using jenkins-job-builder to generate jenkins jobs.
I added ansible plugin to my jenkins, and I want to use that as my deployment tool.
When I start converting builder section of my job in yaml it works fine for most of the element. But, I am not able to convert Extra Variables or extraVars and...
1
votes
0
answer
41
Views
How to read out of a yml map<string, Map<string, string>> structure with cfg4j?
I have the following yml file
test-files:
testSets:
smoke:
- 'a' : 'b'
video:
- 'c' : 'd'
I am trying to read this out using cfg4j but I don't seem to get the interface right.
What I want to get is a map with all the testSets with all the data for that set inside it.
So e.g. if I have the following...
1
votes
1
answer
479
Views
ObjectMapper - add new value to yaml file
Below is my yaml file. Requirement is to add new line '2.log' under 'paths'. Now i am reading yaml file as Map.
My code:
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
Map obj = mapper
.readValue(new File('filebeat.yml'), Map.class);
obj.get('filebeat.prospectors').get(0).get('paths');
/...
1
votes
1
answer
167
Views
Filter specific log messages using YAML file logging configuration
Ideally, I would like to prevent duplicate log messages by using YAML logging configuration. Something similar to TurboFilter class in logback
https://logback.qos.ch/manual/filters.html#TurboFilter
2
If not possible, I would like to suppress/ filter/ redirect log messages from one specific class or...
1
votes
1
answer
343
Views
How to change a KEY in yaml data
I have below yaml file as a template. From another python program I am fetching the name of the device, assume deviceB is the name of the new device. Can someone show how to replace the deviceA with deviceB using python (replace the mapping KEY but not the VALUE)?
The place holder for the device is...
1
votes
1
answer
457
Views
How to map yaml keys to structs in golang?
I'm looking to write a go script that can parse through a yaml file. I created a test yaml file with the following:
Dog:
- name: 'Dog'
- secrets:
username: 'Shiba'
password: 'inu'
color: 'yellow'
Cat:
- name: 'Cat'
- secrets:
words: 'meow'
color: 'black'
What would the mapping to a struct look like...
1
votes
1
answer
533
Views
How to preserve the order of Key Value in YAML file using python (not alphabetical order)
I have the python code below for generating (dumping) a YAML document to a file.
import yaml
import os
device_name = 'NN41_R11'
ip = '10.110.11.11'
port = '2022'
def genyam():
data = {
'testbed' : {
'name' : 'boot_ios'},
'devices' : {
device_name : {
'type' : 'IOS',
'connections' : {
'defaul...