Hot answers tagged

11 votes
Accepted

Is it possible to have multiple gitlab-ci files in a single repo?

No, you can't have multiple gitlab-ci files per repository. You can see more information in the following links : https://gitlab.com/gitlab-org/gitlab-foss/issues/18157 https://gitlab.com/gitlab-org/...
user avatar
6 votes

Rename build pipeline .yml files in Azure DevOps

As suggested by @030, I have prepared two screenshots that show how to connect the .yml files with the build pipeline. Rename the .yml file in the repository Open the pipeline editor Select the ...
user avatar
5 votes

Rename build pipeline .yml files in Azure DevOps

This has been fixed in recent version of Azure DevOps. Currently you can easily rename or move the pipeline in the list of pipelines while clicking on 3 dots and select Rename/move and change your ...
user avatar
5 votes
Accepted

Rename build pipeline .yml files in Azure DevOps

According to this Azure Q&A it should be possible to change the name of the yaml file by clicking on "Edit in the visual designer".
user avatar
  • 12.6k
5 votes
Accepted

Kubernetes configuration with yaml anchors

YAML anchors are supported, but only for the same YAML file. You can't create the anchor (&) on a deployment file and reference (*) the value on another one. If you want to share ENVs values ...
user avatar
4 votes
Accepted

Unable to parse YAML: mapping values are not allowed here

Running your config.yml through yamllint, produced the following: 1:1 warning missing document start "---" (document-start) 13:3 error duplication of key "build" in mapping (key-...
user avatar
  • 835
4 votes

Unable to parse YAML: mapping values are not allowed here

You simply have an incorrect yaml syntax in your workflows jobs list. From what I could very quickly understand on circleCI's documentation, jobs names are accepted as a shorthand if you don't define ...
user avatar
4 votes
Accepted

Ansible: Use inventory_hostname variable in lineinfile module

The issue seems resolved, If I escape the backslash in the regex too: - name: Remove LE webroot definition lineinfile: path: "/etc/path/to/config/{{ inventory_hostname }}.conf" ...
user avatar
4 votes

Is it possible to have multiple gitlab-ci files in a single repo?

You are not able to create multiple .gitlab-ci.yml but you can manage to have what you want. You currently have multiple software in the same repository with the same CI/CD Pipeline or jobs for your ...
user avatar
4 votes
Accepted

Custom inventory file failing to parse properly

The keyword hosts is missing. Also colons : are needed after the hostnames. Fix the syntax, for example all: children: control: hosts: moriarty.server.com: toby.server.com: ...
user avatar
4 votes

Passing replicas number into container

If you launch the statefulset with the following key set {"spec":{"template":{"spec":{"serviceAccountName":"myserviceaccount"}}}} you can run curl \ ...
user avatar
  • 265
4 votes
Accepted

ansible error: skipping: no hosts matched

The answer is in the warning you get: [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' When you use hosts: all in your ...
user avatar
4 votes

How to get information about resources in an Azure Pipelines run?

You can do: variables: templates.ref: $[ resources.repositories['templates'].ref ] See Repository Details docs.
user avatar
  • 161
3 votes

docker-compose multiple services in a loop

Not in pure Docker Compose. If you have a plain-text templating engine you like (Mustache, Jinja, m4, ...) you can ask it to do this for you. You tagged this as shell-script, and Compose can take ...
user avatar
3 votes
Accepted

How to pass Gitlab env var with sensitive characters to bash script?

Surprisingly indeed GitLab works weirdly with the env vars. It evaluates them internally, though it shouldn't in my view. Value set as (in project Settings > CI/CD > Variables): 'aaa$bbb*%' becomes '...
user avatar
  • 146
3 votes

Unable to run playbooks using Ansible best practices layout

Generally, Ansible is very flexible and often there are more "correct" solutions. Start for example with the question "Where do the configuration data come from?", put the default data to the roles ...
user avatar
3 votes
Accepted

Error passing arguments to ansible playbook

I'd suggest that you first put some default values within the playbook (if you explicitly want your variables there, for the purpose of .. reducing interactivity/command line args lets say): - hosts: ...
user avatar
  • 749
3 votes
Accepted

How to exclude a certain linenumber of an Ansible playbook when testing it using Molecule?

According to the yamllint documentation you need to add a special comment to the line -- <string-to-be-excluded> # yamllint disable-line rule:line-length --- #defaults/main firefox_checksum: ...
user avatar
  • 3,058
3 votes
Accepted

Is it possible to use multiple if statements in a salt state?

You can have more than if statement per state. The issue is that your conditional doesn't seem actually be checking the hostname, it's just passing everything. Try this: {% if grains['host'] in ['dev-...
user avatar
  • 1,345
3 votes
Accepted

devops - Optomizing gitlab cicd pipeline's caching

I highly recommend using npm ci instead of npm install. The slow part of installing npm modules is figuring out everything that needs to be installed. If you commit your package-lock.json and use npm ...
user avatar
  • 556
3 votes

Ansible - Variable expansion inside hostvars declaration?

No, you cannot nest jinja2 expansion i.e. the following won't work: # Warning ! Those will fail ! some_var: "{{ some_dict[{{ some_dynamic_key }}] }}" other_var: "{{ {{ ...
user avatar
2 votes
Accepted

Salt State is running against all servers except one, why?

I have found the answer to my own question after some more investigation. The reason the state was skipping the contents of my if statement was because the hostname of the server was in lower-case (...
user avatar
  • 368
2 votes

CasC with Bamboo

This slide share gives an idea how to handle CasC in Bamboo. The presenter advocates to use yaml, but according to him there are also downsides.
user avatar
  • 12.6k
2 votes
Accepted

Are there dialects of YAML or just differences in parsing it?

There is only one YAML spec. That would lead me to say "There are no YAML dialects". There are certainly differences in implementation, perhaps due to what the article claims as the spec's ambiguity: ...
user avatar
  • 3,058
2 votes
Accepted

How to properly setup a multi-environment release pipeline in Azure YAML pipelines?

Assuming that deploy to DEV and QA steps look a lot like your deploy to production-staging environments, put the code that does that work into a yaml template and take advantage of parameters to allow ...
user avatar
2 votes

docker-compose multiple services in a loop

Using docker-compose version 3.3 extensions and with the long variants for ports & volumes: version: '3.3' services: s1: &s build: . ports: - published: 5001 target: 9000 ...
user avatar
2 votes
Accepted

how to prevent Ansible from showing output on screen?

This can be done by judicious use of one of the Ansible callback plugins. Set the relevant configuration in your ansible.cfg file. You have a few options... In order to print nothing to the screen, ...
user avatar
  • 3,058
2 votes

Passing replicas number into container

Define the number of replicas in the values.yaml and pass it anywhere in resources (statefulset) Update 1: You can neither have a dynamic environment variable nor refer to the replicas field in STS. ...
user avatar
  • 349
2 votes

gitlab CI job fails after manual ftp deploy (lftp) command completes successfully

Maybe solving space problem first. Then, in my opinion, I prefer using rsync for copy file to server.
user avatar
2 votes

network ansible command error: "msg": "network os centos is not supported"

This error is due to invalid value of ansible_network_os: The playbook you try setup is meant for network devices. And since centos is not a network device OS the playbook will fail. Here you can find ...
user avatar
  • 163

Only top scored, non community-wiki answers of a minimum length are eligible