ansible-roles | ansible roles
kandi X-RAY | ansible-roles Summary
kandi X-RAY | ansible-roles Summary
ansible roles
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ansible-roles
ansible-roles Key Features
ansible-roles Examples and Code Snippets
Community Discussions
Trending Discussions on ansible-roles
QUESTION
I'm using the latest version of Ansible, and I am trying to use a default variable in role-one
used on host one
, in role-two
, used on host two
, but I can't get it to work.
Nothing I have found in the documentation or on StackOverflow has really helped. I'm not sure what I am doing wrong. Ideally I want to set the value of the variable once, and be able to use it in another role for any host in my playbook.
I've broken it down below.
In my inventory I have a hosts group called [test]
which has two hosts aliased as one
and two
.
ANSWER
Answered 2020-Dec-16 at 12:57Variables declared in roles are scoped to the play. If you want to access a variable from role-one
in role-two
, they would both need to be in the same play. For example, you could write:
QUESTION
I am installing Openshift 3.11 version cluster on my Centos 7.8 VMS. The configuration is that there are there are three Centos VMs (one master node + two worker nodes). I have configured my inventory file also and 'prerequisites.yml' playbook also ran successfully. But when I am running the playbook 'deploy_cluster.yml', then it is generating errors as follows ----
...ANSWER
Answered 2020-Jun-23 at 17:41Copied from comments (as this seems to have been the issue):
So it seems that the repoquery is looking for "origin-3.11.0*". What is the output when you run yum search origin-3.11.0*? I am guessing that this will not find anything, check if the correct YUM repositories are attached.
It seems that you are mixing OpenShift versions, you have the 3.9 repository attached but are trying to install 3.11. You'll need to attach the 3.11 repository. I would recommend that you refer to the official documentation for the installation: https://docs.okd.io/3.11/install/index.html
QUESTION
Is there any way how i can resolve dependencies from private project in gitlab? On my actual gitlab-ci i use such a trick
requirements.tmpl:
...ANSWER
Answered 2020-May-03 at 03:17Current best solution looks like that
molecule.yml
QUESTION
I am trying to split my Ansible role variables into multiple files - as per this answer, it should be possible to create a vars/main
directory, and all the .yml files in that directory should be automatically loaded.
However, this does not seem to happen in my case.
My directory structure:
...ANSWER
Answered 2019-Oct-06 at 06:11TL;DR version: it is a bug in ansible, caused by the presence of empty .yml files in vars/main
. There is a PR out for it already. See
here .
The actual result (as mentioned in the comments) actually depends on the order the files are processed (by default, it looks like my Ansible processes them in alphabetical order - but this might depend on the version, or the underlying OS):
- If the empty file is processed first, you get an error message:
ERROR! failed to combine variables, expected dicts but got a 'NoneType' and a 'AnsibleMapping'
- If the empty file is processed after other files, there is no error message, but all the variables that have been set up to this point are destroyed
More details: since I have no idea how to troubleshoot this in Ansible itself, I went to the code and started to add print
statements to see what is happening.
In my case, I had some empty .yml files in the vars/main
directory (files that I was planning to populate later on. Well... it looks like when the code encounters such an empty file, it destroys the entire dictionary that it has built so far.
Either I'm missing something very important, or this is a bug... Steps to reproduce:
- create a role
- create the
vars/main
directory, and populate it with some .yml files - add an empty .yml file (named so that it is processed after the other files)
- try to print the variables from the first files
QUESTION
This is what i am trying to do.
...ANSWER
Answered 2019-Sep-04 at 20:47This is what i found. when i checkout ansible/roles from public github.com
repo it has already some .git
ancher. and later when i was trying to move same folder in my internal git server that was causing above issue.
After cleaning up all .git
it works.
QUESTION
I have been looking at different ways to test ansible playbooks and came across this blog post by Jeff Geerling.
Replicating his exact example works, however, when I replicate it but managing python (and ansible) via a pipenv install I get the following error
...ANSWER
Answered 2017-Sep-21 at 08:30The roles path is the path for all roles.
Ansible searches for a directory with the name of the role in the roles_path
. If the role is called ansible-test
, it is an error to put the name of the role into the roles_path
.
Set roles_path
this way:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ansible-roles
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page