ansible-playbooks | my playbooks | Automation library
kandi X-RAY | ansible-playbooks Summary
kandi X-RAY | ansible-playbooks Summary
my playbooks for Ansible.
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-playbooks
ansible-playbooks Key Features
ansible-playbooks Examples and Code Snippets
Community Discussions
Trending Discussions on ansible-playbooks
QUESTION
I'm rather new to ansible and would like to deploy prometheus-grok-exporter (via ansible-grok-exporter role) with a specific configuration for all my nodes that run the cacti application.
My inventory is like this:
...ANSWER
Answered 2021-Jun-02 at 14:51You can't use this kind of for loop in a variables file or a playbook - it only works in template files. To acheive what you're after, you can use product filters, as described https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#products
In your example, you would have:
QUESTION
I have a Pipeline that expect a Ansible-Playbook as passed variable on queue-time (string
). After converting my classic Pipeline to YAML I recognize that Quotes in the Playbook-String are missing.
"
)
...ANSWER
Answered 2021-Mar-16 at 09:40I can successfully passed the parameter string with " and " \" keeped using String.raw
method. See below:
QUESTION
I have ansible tooling to generate images in azure, and terraform tooling to apply the images to the vmsses I have in azure. However azure only marks the vmss instances with the lates_model boolean flag, thus I need to open each instance in the vmss and hit the upgrade button, that restarts the machine.
I saw several modules to manage vmsses, however my I need to upgrade(reboot) the instances using the serial parameter in my playbook. That is the problem I can go this way. In general getting the inventory in the module is not the best idea I guess, as Ansible does not know that list is in fact an inventory. I need an advice.
...ANSWER
Answered 2020-Nov-18 at 07:34When you update the configuration of the VMSS and I see you set the upgrade policy with the manual
. And in this situation, you need to upgrade all the instances yourself by selecting.
In ansible, you only can use the module azure_rm_virtualmachinescaleset
to update the VMSS, the other module just get the facts of the VMSS. If you want to update the configuration and then all the instances upgrade automatically, you need to set the upgrade_policy
with Automatic
.
QUESTION
Concerning: Ansible-Playbooks
Is it possible to run a command on the remote machine and store the resulting output into a variable? I am trying to get the kernel version and install the matching headers like this:
...ANSWER
Answered 2020-Nov-06 at 20:14I found a solution but I am not sure if this is really elegant
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
I have cloned ansible repository and setup following official ansible documentation.
I have setup from source directly, by creating venv
for python3.
Running this: . venv/bin/activate && . hacking/env-setup
does set up ansible environment. And if I write this (while venv
is activated):
ANSWER
Answered 2019-Oct-11 at 08:54venv is a bit tricky to use. It is tied to your session. Ansible uses a different session when gets executed than you as a user who logs in. You need to activate venv for that specific session that Ansible uses when gets executed.
You can try two things:
1: setting environment variables:
QUESTION
Is it possible to use KV information from Consul to populate the inventory during runtime?
I would like to pull KV information from Consul when running ansible-playbooks to populate the inventory with the host and role assignment. Since consul_kv is a lookup plugin I'm assuming it doesn't work for inventory (at least it doesn't when I briefly tested it :) ).
The basic idea is to use --extra-vars and supply the hostname and from there pull the information from Consul.
Just need to know if it's possible using the built-in functions (if so which plugins would be appropriate if needed) or if some sort of workaround is the only way. E.g. create the inventory/role files via a script before running the playbook.
...ANSWER
Answered 2019-Jun-18 at 06:18The answer to your question is to use the dynamic inventory mechanism, and from there you can use any programming language you'd like, including bash
and invoking the consul CLI to run whatever queries you want. So long as the output is the JSON that ansible is expecting, that contract is well-defined.
However, I was actually curious how hard it would be to reach into ansible and take advantage of the existing consul_kv
since it is already implemented, will already be available wherever you have ansible, you seem to want to use it, and so forth.
And the answer appears to be "not very hard" (here I'm using the dig
lookup since I don't have consul
nor python-consul
available to test, but dig
will do for our purposes):
QUESTION
I am new to using Ansible-Playbooks, and I am running into issues in accepting license agreements with Splunk.
Any time I have shell run:
...ANSWER
Answered 2019-May-29 at 21:19You should look at the expect module. It will allow you to execute commands and respond to their respective prompts.
QUESTION
I am trying to just run a playbook with:
ansible-playbook roles/java/tasks/debian.yml -i /etc/ansible/hosts
and the output is as follows:
...ANSWER
Answered 2017-Jun-27 at 20:08You try to run tasks list as a playbook.
To make it work, write a simple playbook:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ansible-playbooks
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