14
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/...
8
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 ...
7
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 ...
6
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 ...
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 ...
6
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 ...
5
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 ...
5
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:
...
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".
4
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 '...
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-...
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 ...
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"
...
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 \
...
4
votes
Accepted
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.
3
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
...
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 ...
3
votes
Accepted
error validating data: ValidationError(Deployment): unknown field "spec" in
Sure enough, everything and including the last spec: needed to be tabbed to the left once:
apiVersion: apps/v1
kind: Deployment
metadata:
name: client-deployment
spec:
replicas: 3
selector:
...
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: ...
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: ...
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-...
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 ...
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: "{{ {{ ...
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 (...
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.
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:
...
2
votes
How to pass Gitlab env var with sensitive characters to bash script?
This is not answering only the question but also a bit more (I put this here for reference):
I found out a decent way to tackle this and some complications coming afterwards... (after hours and hours ...
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, ...
2
votes
Accepted
Running two containers in a kubernetes job each with their own initContainers
What you are describing is best achieved by either using two jobs or let task 1 also be an init Container as they run in sequence.
Alternatively you could use Argo Workflows.
https://github.com/...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
yaml × 67azure-pipelines × 17
azure-devops × 14
ansible × 13
kubernetes × 9
continuous-integration × 8
gitlab × 8
salt × 4
jinja × 4
ansible-inventory × 4
terraform × 3
azure × 3
continuous-deployment × 3
helm × 3
jenkins × 2
amazon-web-services × 2
linux × 2
cicd × 2
gitlab-ci-runner × 2
configuration-management × 2
build-pipeline × 2
configuration × 2
autoscaling × 2
kubectl × 2
centos × 2