Questions tagged [yaml]

YaML is a human-readable data serialisation format.

YAML is a data serialisation format designed to be written and read by humans. Modern YAML is a superset of JSON, meaning that YAML parsers can consume any valid JSON as well as the richer and more human-friendly long form.

For more information refer to the YAML Wikipedia page or the YAML homepage.

92 questions
8
votes
2 answers

quoting colon in ansible

I am trying to use ansible to check that the output of a particular program is set to a certain value. That value includes a colon followed by a space, and this seems to register as a syntax error no matter how I quote it. example: --- - hosts:…
stochastic
  • 316
  • 1
  • 3
  • 6
6
votes
1 answer

Adding an existing security group CloudFormation EC2 template

Instead of having to set ingress and egress rules, how do I reference existing EC2 security groups in a CloudFormation Template? Resources: EC2Instance: Type: AWS::EC2::Instance Properties: InstanceType: …
6
votes
2 answers

Is it possible to change the current user's password in-band with ansible?

I have a Linux distribution that is freshly installed. It has a regular user with a default password, and a locked down root account (no password on root - can't be SSHed as directly). I want to be able to run an ansible playbook to configure this…
Tal
  • 305
  • 1
  • 4
  • 11
6
votes
2 answers

How to merge variables of type hash across different variable files in ansible?

I have two YAML variable files which are reused for many playbooks: # playbook/group_vars/all settings: a: 1 b: 2 # inventory/group_vars/main.yml settings: c: 3 I want settings to be equal { a: 1, b: 2, c: 3 } in my playbooks. Instead it…
Jason Holcomb
  • 63
  • 1
  • 1
  • 5
6
votes
3 answers

Get current hostname and push it into conf file with ansible

I'm working into an ansible playbook to get the current hostname of a server and then set it into a configuration file. I cannot figure it out how can I push the shell output using the lineinfile module. - name: Get hostname shell: echo…
pedrocalixto
  • 63
  • 1
  • 1
  • 3
5
votes
1 answer

Why do some r10k configuration files start their YAML lines with :?

I'm looking at setting up r10k for Puppet deployment, and I have various example r10k.yaml configuration files, but some seem to use an extra : at the start of many lines, for instance, at http://www.rubydoc.info/gems/r10k/1.1.4: --- :cachedir:…
Iain Hallam
  • 447
  • 2
  • 6
  • 22
4
votes
1 answer

Verifying Salt states before committing

I'm storing my salt sls files in a git repository, but I have the perennial problem that I can't verify my YAML represents a valid set of states that could be applied (I've also had difficulty validating my YAML -- that's much easier, though). …
Andrew Aylett
  • 599
  • 3
  • 14
3
votes
1 answer

Problems with setting up bonding on Netplan (Ubuntu server 18.04)

I have a dual port network card that I want to bond both ports and balance the traffic between ports. I want 1 static IP address. I used to ubuntu 16.04 and this worked fine. Im now trying to set up the same thing in netplan and am struggling. …
Craig Armitage
  • 31
  • 1
  • 1
  • 3
3
votes
2 answers

How does the formatting policy look like since Ansible 2.0?

I have seen multiple Ansible examples on github and in the ansible docs, e.g.: --- # this might be in a file like handlers/handlers.yml - name: restart apache service: name=apache state=restarted Github example The following example contains both…
030
  • 5,901
  • 13
  • 68
  • 110
3
votes
1 answer

dict as value for YAML key in an Ansible task

I am unable to figure out how to pass a dictionary/hash-map of key-value pairs as the value for an option in an ansible tasks. Default Options: # roles/ec2/defaults/main.yml ec2: key_name: "{{ key_name }}" instance_type: m3.medium image:…
Mark Feltner
  • 131
  • 1
  • 3
3
votes
1 answer

How to define multiple /etc/hosts entries with Puppet ENC?

I'm writing an External Node Classifier for my Puppet infrastructure, and I have the need to manipulate the /etc/hosts file on each node. The following (due to the duplicate key) is invalid YAML: --- host: name: www1.example.com …
Chris Tonkinson
  • 475
  • 2
  • 6
  • 19
3
votes
1 answer

Contents in Kubernetes pod gets empty when persistent volume is mounted

persistent volume claim and persistent volume yaml file apiVersion: v1 kind: PersistentVolume metadata: name: my-volume labels: type: local spec: storageClassName: manual capacity: storage: 5Gi accessModes: - ReadWriteOnce …
aks
  • 57
  • 2
  • 7
3
votes
1 answer

Cross-reference Ansible variables within the same mapping

How can I define an Ansible variable whose value is another variable in the same mapping structure? To allow sensible namespacing of variables, I am defining mapping structures like this, where some values depend on other variables in the same…
bignose
  • 992
  • 1
  • 10
  • 22
3
votes
1 answer

Configure AWS CloudFront to send custom query params to origin

Is it possible to configure my AWS CloudFront distribution to append to the request a custom query param (e.g a private key) before sending it to the origin? For example, the front end is calling *.cloudfront.net/get and CloudFront forwarding the…
3
votes
3 answers

Ansible check if variable exists in attribute list

I have a variable containing details of host machines on my network (called 'hostlist' - I believe you call this a dictionary, but I'm not sure of the terminology. The variable is defined in a file in group_vars/all, so it's available in all…
Mike Williams
  • 33
  • 1
  • 1
  • 3
1
2 3 4 5 6 7