Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [yaml]

YAML is a data serialisation format designed for human readability, supporting data with self references. YAML 1.2 is a superset of JSON, so its tools can be used to process JSON. Use this tag for question that involve features specific to the YAML format.

2
votes
4answers
78 views

Filter YAML file content using sed/awk

I have a text file with the following content in it. $ cat hosts.yml [prod_env] foo.example.com bar.example.com [stage_env] foo_stage.example.com bar_stage.example.com [dev_env] foo_dev1.example.com ...
0
votes
0answers
37 views

sed command to insert between two strings that are returned from another sed command

I have a YAML file that's about 25K lines and I have about 450 instances where I need to insert between two specific lines. Here's an example of the file entries: - changeSet: id: ...
0
votes
2answers
52 views

Recommendations for editing same file on different machines

Our Rails app is scaled at multiple machines, from time to time, we need to change settings at production.yml , right now we have to ssh into each server and do the editing at each machine ...
1
vote
1answer
409 views

Ansible, docker_container and depends_on

I am using ansible and docker_container module. But when I start my playbook, I have error like: "'depends_on' is not a valid attribute for a Task" This is my playbook: - name: Docker-compose ...
2
votes
1answer
76 views

Finding incorrect YAML headers

I am trying to identify which files in my project have incorrect headers. The files all starts like this --- header: . . . title: some header: . . . more headers: level: . . . --- Where . . . only ...
0
votes
4answers
4k views

Using sed to replace multiline

I'm trying to replace the following section of a YAML file: ssl: enabled: false to read ssl: enabled: true I've tried this, which failed: sed -i s/ssl:\n enabled: false/ssl:\n ...
1
vote
1answer
42 views

How to return a values from a method which prints its out put [closed]

I have a method which prints its content with 'printf'. I want the printed contents to be return. parse_yml() { #some logics here printf("%s%s is %s", $1, code, $2, $3); } In above ...
1
vote
2answers
231 views

Trying to generate a spreadsheet of .yaml files within a folder including args

I have a folder full of .yaml files. in each yaml file i have a url arg among other things. im just trying to get a spreadsheet that has the name of the file in the first column and have the value of ...
2
votes
3answers
502 views

Replace all occurrences of dash to the left of a colon using sed

I have the following values in a config.yml file: scratch-org-def: config/project-scratch-def.json assign-permset: false permset-name: run-apex-tests: true apex-test-format: tap delete-scratch-org: ...
0
votes
1answer
39 views

How to remove a place holder in a text file with text from another file when multiple lines are present?

I have a file: - id: 1.4.25.2 name: 'Configuring a VNC Server' permalink: '/rhcsa/managing-network-services/configuring-vnc-access/configuring-a-vnc-server' description: '<*...
0
votes
2answers
112 views

puppet resource dependency

When I do puppet apply, I get the error: Warning: Scope(Mod::Cl[title]): Can't load '/tmp/file.yaml' File does not exist! Error: Evaluation Error: Error while evaluating a Resource Statement, ...
0
votes
2answers
451 views

SED or AWK?: Add character to each line after found pattern

I'm using Jenkins multi-line string parameter to append new entries to a yaml file. But then I want to format those entries to match the yaml syntax. The desired end result is: var: - subvar1 - ...
9
votes
4answers
15k views

Is it possible to modify a yml file via shell script?

This is how my docker-compose.yml looks like. nginx: container_name: 'nginx' image: 'nginx:1.11' restart: 'always' ports: - '80:80' - '443:443' volumes: - '/opt/nginx/conf.d:/...
0
votes
2answers
364 views

Error in yaml - possibly due to wrong escape, but unable to identify the issue

The line below causes an error (...request body malformed."}). It is part of a user-data.yml for use with cloud-init as part of the digital ocean api to bootstrap a server upon creation. sed -ie '\$a\...
0
votes
1answer
276 views

seeking hints for correct escaping of sed commands WITHIN yaml

I am having a hard time finding the issue why following lines of "code" break my cloud-init config. Basically I am calling a son object as part of the DigitalOcean API which has a YAML format - I got ...
3
votes
2answers
255 views

How to merge these commands into one?

This is what I am wanting to do: Convert a folder of HTML files into markdown, also copying over the the XML metadata of each of the HTML files by converting into YAML. I have done research and came ...
3
votes
2answers
10k views

How to escape in YAML the correct way?

On CentOS 7 I am using cloud-init to spin off a droplet using the DigitalOcean API which requires YAML formatting. I got most parts working fine, but struggle on escaping the commands running at '...
2
votes
3answers
2k views

Text to yaml conversion

I have a tab separated text file in this format: your-email your-order-id PayPal-transaction-id your-first-name your-second-name s@ess.com 12345 54321 sooky spooky t@tee.com 23456 ...