SuperCollider: convert a Dictionary to YAML

SuperCollider has a String:parseYAML method that can create a nested Dictionary: "{44: 'woo'}".parseYAML Dictionary[ (44 -> woo) ] But how to go the other way, output a YAML string given a (possibly nested) Dictionary?

Yaml Multi-line literals in swagger editor?

I am trying to get a multi-line literal in Swagger editor (awesome tool, by the way!). post: summary: Translate one or more identifiers description: | Translate one or more identifiers for one entity into the identifiers of another entity. Translate one or more identifiers for one entity into the identifiers of another entity. consumes: - application/json I've tried it with | and >, with different endings (increasing indent vs. empty line), and every way I can think of, but

Anchor templates in GitLab-CI YAML file: how to reuse with different appended attributes

If an anchor is used like the example to define re-usable parts, but I would like to define the expire_in attribute of the artifacts keyword differently for each re-use of the template, the CI Linter reports: Error: (): did not find expected key while parsing a block mapping at ... (Line on which *save_ipk is used) .templ: &save_ipk stage: build script: - ls package/*.ipk artifacts: paths: - package/*.ipk #... save_ipk_tags: <<: *save_ipk expire_in: 6 m

Yaml Can i use same model but configure required/optional parameters per call in Swagger?

I'm designing my API using Swagger in Restlet studio, and there are some calls that use the same model. In my case the model is an Array of objects. I would like to declare some of the object parameters as required and some as optional (as they are by default). However it's something that should vary in different calls. I couldn't find a way to that in YAML nor in Restled studio. Is my only option to create different models for each API call? I did find a similar question here 2 years ago

Yaml Hyperledger Fabric configtxgen - Error reading config: map merge requires map or sequence of maps as the value

I'm trying to setup a simple Fabric network with the following: Orderer Organization [abccoinOrderers] Sample Organization [ABC] After generating the all the necessary files using cryptogen tool, running the configtxgen command gives the following error: student@abc:~/Desktop/fabric/network$ configtxgen -profile DefaultBlockOrderingService -outputBlock ./config/genesis.block -configPath $PWD 2019-12-26 12:35:42.131 MST [common.tools.configtxgen] main -> WARN 001 Omitting the channel

Yaml How to skip Reinitialized existing Git repository on Gitlab CICD Stage

Below is my YML file structure. I want the following up stage to be run without reinitiliaze the git repository. The git repository should only be initialie during the first stage which is the build stage. variables: GIT_STRATEGY: fetch stages: - build - run_test - run_test2 build_job: variables: test_env: "test" stage: build script: - "powershell -File ./Scripts/BuildSolution.ps1" only: refs: - TDD-G2 run_test:

Yaml Dynamic Template using dynamic variable group causing an issue when downloading a Secure File

I have a CI/CD Multistage template where my CD stages are dependent on a parameter I provide in a yaml file Pipeline points to pipeline.yml servers: DEV: - srv-apimgmt37p and in my template I have a loop that checks the servers and passes the value so it can dynamically produce my CI/CD pipeline depending on the above parameter. In my CD stage I have the following variable groups that I pass: variables: - group: ${{ variables['Build.DefinitionName'] }}_MS_${{env.key}} - group: DevSecOp

Yaml Preserve quotes with yq

I have the following yq command yq e '.values.tags="{tag1:'value1', tag2:'value2'}"' -i my file.yaml I need the values to be quoted. When I run the query with yq, the quotes arround the values are removed. I tried a couple of things to remove them, but so far nothing works. In my yaml file, it ends up like this: values: tags: "{tag1:value1, tag2:value2}" While i expect this: values: tags: "{tag1:'value1', tag2:'value2'}" Does anyone know how to do this?

How do you put HTML or XML into a YAML?

I would like to store HTML snippets inside a YAML file. What is the best way to do that? Something like: myhtml: | <div> <a href="#">whatever</a> </div>

How do I validate my YAML file from command line?

I am having issues pulling from a YAML config file: Fatal error: while parsing a block mapping; expected <block end>, but found block entry While there are plenty of online YAML validators, which I have tried and have helped, I'd like to validate my YAML files from the command line and integrate this into my continuous integration pipeline. How can I validate the syntax of a YAML file on the command line?

Extend an array in YAML?

Suppose I have: base_array: -1 -2 how could I do something like: my_array: << base_array -3 so that my_array was [1,2,3] Update: I should specify that I want the extending to occur inside the YAML itself.

Program to lint YAML files?

So my team is currently working on an application that uses a lot of YAML and we need to enforce some rules for common formatting. The best would be a command-line program so we can plug it into our CI. Most importantly, we want to force 2-space indentation and indentation of lists, like this: list: - not indented - not indented # this is BAD list: - indented - indented # this is GOOD mapping: 5 space indentation # this is BAD Also it would be great to pre

Yaml Multidimensional array in Symfony Configuration

So I have the following config: shinobi_ui: application_title: "PILIPINAS" modules: - { name: dashboard, submodules} - { name: general } How can i put another array inside each {}. Let's say submodules is an array like so: submodules: - { name: submodule in dashboard } - { name: another submodile} So how can I implement a configuration like this? Thanks

Using flux YAML, how to mention number of task for bolts in a Storm topology?

See this snippet of storm-flux YAML: ## spout definitions spouts: #spouts- Start - id: "perform-spout" className: "org.apache.storm.kafka.KafkaSpout" parallelism: 2 constructorArgs: - ref: "PerformSpoutConfig" #spouts- End ## bolt definitions bolts: #bolt - Start - id: "perform-bolt" className: "com.cc.adv.asp.test.KafkaPerformanceBolt" parallelism: 2 #bolt - End

Yaml How to pass a string containing quotes as an `include` parameter in Liquid/Jekyll?

Consider: I want to pass a block of text as a parameter in an include tag. The block of text contains a quote. For example: Breaking news: Area man says, "This is newsworthy!" There are several ways I can think of to do this: 1. Wrap in single quotes {% include newsitem.html content='Breaking news: Area man says, "This is newsworthy!"' %} This is not ideal since there may be single quotes/apostrophes in the text block. 2. Use captures {% capture newscontent %} Breaking news:

Yaml Getting Error : Circular dependency between resources

I'm getting circular dependency errors for my CloudFormation code: Circular dependency between resources: [WebServerScaleDownPolicy, WebServerScaleUpPolicy, LaunchConfig, ElasticLoadBalancer, CPUAlarmHigh, MySecurityGroup, CPUAlarmLow, WebServerGroup] Code File : https://drive.google.com/open?id=1SxDqc4oPRW0SgjtDg3eoVN_YE01iRLD1 I tried adding "DependsOn", but that doesn't help. I'm new to CloudFormation and looking for help. AWSTemplateFormatVersion: '2010-09-09' # this is the Cloud

Azure devops yaml: release to multiple web nodes

I'm trying to figure out how I can use yaml pipelines to deploy an application to a multi web-node environment. I'm trying to create a pipeline with 2 stages. Stage 1 will build the project, and stage 2 will deploy it to a staging environment. This staging environment (currently) has 2 web nodes. I don't want to hardcode the actual machines to deploy to into my pipeline. So I thought I'd add a variable group with a variable containing the web nodes to deploy to, and use a "each" statement to ge

Yaml Error in helm chart "cannot unmarshal TOML integer into float64"

I was trying to install the Telegraf helm chart to a kubernetes cluster in namespace internet-monitor. I want to integrate InfluxDB, Telegraf, and Grafana for internet connection monitoring. Grafana dashboard that I want to integrate is: https://grafana.com/grafana/dashboards/2690 It says that the Telegraf input ping plugin should have configuration: [[inputs.ping]] interval = "60s" urls = ["208.67.222.222", "208.67.220.220", "ddg.gg", "pfSense.home", "accessPoint.home", "amazon.com", "githu

Yaml Using variables in yml file

In a .yml file, I have written mine: exec_dir: "$GPROOT/bin/release/" data_dirs: "$GPROOT/data_dirs/" execs: - cdf: - "XXXXXXX/cdf/0.2M" where $GPROOT is defined via a bash variable with export in the terminal. What I have written as XXXXXXX must be $GPROOT/data_dirs/. However, it seems that defining a variable like these - "$data_dirs/cdf/0.2M" or - "{{ data_dirs }}/cdf/0.2M" are incorrect. How can I fix that?

MongoDB Error parsing YAML Config illegal map value for replica set

Here is my /etc/mongodb.conf - using MongoDB 3.6. I'm having a challenge with the config file being parsed when starting mongod. I have a single space after each colon and two spaces on each new line I took the replica set example from mongoDB docs here: https://docs.mongodb.com/manual/reference/configuration-options/#replication-options dbpath=/home/ubuntu/data/db logpath=/home/ubuntu/data/db/log/mongo.log logappend=true journal=true replication: replSetName: rep net: bindIp: 127.0.0.1

Yaml How to add item to YML collection conditionally using Serverless framework?

Given I have the following defined in a YML file for a resource: Type: AWS::Cognito::UserPoolClient CallbackURLs: - "my-first-url" How can I add a second item when only certain conditions are met? Unfortuantely it is not possible to simply set it to an empty string or null as it fails deployment validation. E.G something like: Type: AWS::Cognito::UserPoolClient CallbackURLs: - "my-first-url" - myCondition ? "" : undefined // Omit item Is this poss

How to concatenate several strings and variables in Yaml?

I need to do something like this: domain: &domain example.com ip: &ip 1.2.3.4 Address4: v=spf1 include:*domain ip4:*ip -all I tried this but didn't work, it says there's a syntax error: Address4: 'v=spf1 include:'*domain' ip4:'*ip' -all' The implementation (I'm using these files in Ansible) seems to support concatenation, for example this works fine: Address2: http://*domain # actually this doesn't work, I don't remember the exact example Any ideas?

Proper syntax for entry in Hiera yaml file

The goal is to supply a default value for a parameter being passed to a defined resource type. I have successfully supplied defaults for class parameters using the automatic defaulting procedure that uses Hiera, but this mechanism does not work for defined types. Here is how I call Hiera in my defined type: define git_down( $local_repo_dir = undef, $remote_repo_url = undef, $version = undef, $shell = hiera("git_down::shell"), $path = hiera("git_down::path"), $date_form

Yaml How to assign a variable to another variables in Ansible in a correct way?

I've faced an unexpected problem with Ansible. Here's simplified example. I have defined some global variables in groups_vars/all file like this: --- node01: {ipv4_address: '10.10.10.1', some_info: data} And use it like this in inventory file: [physical-hosts] phyn01 node="{{ node01 }}" ansible_ssh_host="{{ node.ipv4_address }}" The funny part is that Ansible can ssh on each of the hosts and get the facts. But I can not get the value of 'node' variable for each host when executing playboo

How to specify an empty element in YAML for Log4J 2 "OnStartupTriggeringPolicy"

How do I give any empty element in YAML? I'm configuring lo4j2 triggers with "OnStartupTriggerPolicy". <Policies> <OnStartupTriggeringPolicy /> </Policies> Log4J is not accepting this. Policies: OnStartupTriggeringPolicy: SizeBasedTriggeringPolicy: size: "20 MB" ERROR Policies contains an invalid element or attribute "OnStartupTriggeringPolicy"

Ansible YAML syntax error on inline array containing dictionary

I have an Ansible playbook which includes another playbook and then attempts to pass a variable to that playbook. It works fine, but I get a YAML syntax error whenever the variable I construct contains a dictionary: - hosts: all - include: other_playbook.yml var1=[ {key: value} ] What syntax can I use to pass dictionary variables to another playbook?

Convert user data types in yaml-cpp

This is example from tutorial from here: There is such class: struct Vec3 { double x, y, z; bool operator==(Vec3& other) const { return other.x == this->x && other.y == this->y && other.z == this->z;}}; This code for converting yaml data to user object(Vec3): namespace YAML { template<> struct convert<Vec3> { static bool decode(const Node& node, Vec3& rhs) { if(!node.IsSequence() || node.size() != 3) { return false; } rhs.x

Yaml Gitlab runner stop after npm install

For using the pipeline in Gitlab, i've created the following .gitlab-ci.yml file: image: node:8.2.1 cache: paths: - node_modules/ TestIt: script: - npm install - '/node_modules/@angular/cli/bin/ng test --single-run=true --browsers PhantomJS --watch=false' When the runner start the job it is doing the npm install successfully but by that it ends. It doesn't continue to the second script (like it ignores it from some reason). This is the output: What can be the cause for t

Yaml Can I remove Response Schema table. Just keep Example Value

I am creating an docs Api with Swagger 3.0.0 by YAML, convert to markdown by Widdershins, and then build to HTML by Slate. Can I remove or hide Response Schema table and keep showing Example value. Now I have just done empty the Response Schema table. It still show title "Response Schema" of that table. Can you guys help me to solve this problem. Thank you so much.

Yaml Missed comma between flow collection entries, how to fix?

I have this yaml definition and it gives the following error: missed comma between flow collection entries This is how my yaml looks like: create_bucket_lifecycle_policy: action: aws_boto3.boto3action input: params: Bucket: <% $.bucket_full_name %> LifecycleConfiguration: { Rules: <-- this is where error coming - {'Expiration': {'Date': <%= format(Sys.

using construct_undefined in ruamel from_yaml

I'm creating a custom yaml tag MyTag. It can contain any given valid yaml - map, scalar, anchor, sequence etc. How do I implement class MyTag to model this tag so that ruamel parses the contents of a !mytag in exactly the same way as it would parse any given yaml? The MyTag instance just stores whatever the parsed result of the yaml contents is. The following code works, and the asserts should should demonstrate exactly what it should do and they all pass. But I'm not sure if it's working for th

Yaml Build error on circleci (spin up enviroment )

I am facing a problem with the Build error on circle-ci. this is my repo Error Build-agent version 1.0.41563-0e4d6629 (2020-10-22T11:30:36+0000) Docker Engine Version: 18.09.6 Kernel Version: Linux 2e2f534dcc94 4.15.0-1077-aws #81-Ubuntu SMP Wed Jun 24 16:48:15 UTC 2020 x86_64 Linux Starting container circleci/node:6.14.8 Warning: No authentication provided, this pull may be subject to Docker Hub download rate limits. image cache not found on this host, downloading circleci/node:6.14.8 Error

Yaml How to link to another endpoint in Swagger

I'm writing a Swagger specification for an future public API that requires a very detailed and clean documentation. Is there a way to reference/link/point to another endpoint at some other location in the swagger.yml file? For example, here is what I am trying to achieve: paths: /my/endpoint: post: tags: - Some tag summary: Do things description: > This endpoint does things. See /my/otherEndpoint for stuff # Here I would like to have some kin

Yaml How to merge rules on a GitLab CI Job

Let's suppose I have this hidden "base" job. .base_job: rules: - if: "$CI_COMMIT_TAG" when: never - if: '$CI_PIPELINE_SOURCE == "web"' I'd like to add these rules to a new job and be able to extend them too, e.g.: job_1: rules: - <add .base_job here> - if: "$CI_MERGE_REQUEST_IID" job_2: rules: - <add .base_job here> - if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH" Note that job_1 and job_2 have d

Overwrite variable value in yaml mapping

I have defined a mapping in yaml that looks like: default: &DEFAULT bucket: &bucket default_path # Make sure that the second parameter of join doesn't start with a / # otherwise it is interpreted as an absolute path and join won't work path1: !!python/object/apply:os.path.join [*bucket, work_area/test1] path2: !!python/object/apply:os.path.join [*bucket, work_area/test2] I need to define more keys where the only value to be overwritten is bucket, sth like: pro

Yaml '=' key meaning

Yaml reference page mentions = key as Default "value" mapping key. but i cannot find any information about what does this key actually mean. Any ideas? Also side question: why neither << nor = are mentioned in spec when they are mentioned in reference page?

Replace a parameter in openshift scc restricted yaml

Currently in my openshift environment, I have to manually go and edit my scc restricted yaml file using the command oc edit scc restricted. In this file I am updating two parameters: allowHostDirVolumePlugin: false TO allowHostDirVolumePlugin: true AND runAsUser: type: MustRunAsRange TO runAsUser: type: RunAsAny I want to be able to update these values without actually editing them. I have tried the json patch method mentioned HERE but in that example, I am able to add. I am trying the s

YAML string with leading white space

I'm trying to place some whitespace at the start of a string, like so: - sbSecId: 4 title: ' VideoJS' link: /examples/video/instream/videojs/pb-ve-videojs.html isLastSubSectionItem: 0 isHeader: 0 isSectionHeader: 0 sectionTitle: subgroup: 1 this is for a site being generated by Jekyll. I'm using Liquid to make an array of the yml file, looping through the array and displaying the title key's value like so: {{thisSubItem.title}} despite having the key value in quotes the whi

Yaml Travis CI: Run branch conditional script

I am working in a .NET Core project. I have the following .travis.yml file. This works well, but I want to have a https://dev.mysite.co.uk environment. Anything merged into the develop branch, I want to end up on https://dev.mysite.co.uk, but anything merged into the master branch, I want deployed to https://www.mysite.co.uk. language: csharp mono: none sudo: required dist: xenial dotnet: 2.2 branches: only: - master - develop before_script: - chmod -R a+x scripts script: - "./scripts/

Yaml How to deploy an eureka naming server on aks?

I want to deploy my web service to Azure Kubernetes Service. I currently have 3 microservices in one node. 1 API gateway and 2 backend microservices. Error messages: none. Because I do not use routes in the API gateway, I cannot control my backend microservice via the API gateway. Now I have created a Eureka Naming Server, and want to deloy him in the same node, that I want to use so that my microservices can communicate with each other. This is my Yaml-File that i used for the Naming Server a

How to auto edit Yaml file containing Anchors & Aliases using snakeyaml

I want to automate YAML file processing using snake YAML Input: _Function: &_Template Name: A Address: B _Service: &_Service Problem1: <<: *_Template Problem2: <<: *_Template Function.Service: Service1: <<: *_Service Service2: <<: *_Service After Modifying the desired output is _Function: &_Template Name: A Address: B _Service: &_Service Problem1: <<: *_Template Problem2: <<: *_Template Function.Service:

hiera-eyaml undefined method `empty?'

I would like to store my node config in a .eyaml file. "hieradata/node/client.puppetmaster.local.eyaml" --- ntp::restrict: - ntp::autoupdate: false ntp::enable: true ntp::servers: - 0.pool.ntp.org - 1.pool.ntp.org - 2.pool.ntp.org - 3.pool.ntp.org but when I try to read a parameter with hiera ntp::servers ::fqdn=puppet.puppetmaster.local I get this error Messages /var/lib/gems/1.9.1/gems/hiera-eyaml-2.0.7/lib/hiera/backend/eyaml_backend.rb:39:in

Conda environment from .yaml offline

I would like to create a Conda environment from a .yaml file on an offline machine (i.e. no Internet access). On an online machine this works perfectly fine: conda env create -f environment.yaml However, it doesn't work on an offline machine as the packages are then not found. How do I do this? If that's not possible is there another easy way to get my complete Conda environment to an offline machine (including both Conda and pip installed packages)? Going through the packages one by one to

YAML invalid - maybe quote marks issue

I am getting the error info from Gitlab CI/CD Pipelines: yaml invalid. The problem is being caused by the fifth line of .gitlab-ci.yml script: - 'ssh deployer@gitadam.ga \'rm /var/www/html/hosts/production/current/temp__*\'' The section of the script script: - 'pwd' - 'whoami' - 'ls temp__*' - 'ssh deployer@gitadam.ga \'rm /var/www/html/hosts/production/current/temp__*\'' - 'if ls temp__* 1> /dev/null 2>&1; then for file in temp__*; do scp $file deployer@gita

Yaml How can I start running server in one yml job and tests in another when run server job is still running

So I have 2 yml pipelines currently... one starts running the server and after server is up and running I start the other pipeline that runs tests in one job and once that's completed starts a job that shuts down the server from first pipeline. I'm kinda new to yml and wondering if there is a way to run all this in a single pipeline... The problem I came across is that if I put server to run in a first job I do not know how to condition the second job to kick off after server is running. This jo

  1    2   3   4   5  ... 下一页 共 5 页