Questions tagged [ansible-role]

Ansible role is a set of tasks to configure a host to serve a certain purpose like configuring a service, whereby they are defined using YAML files with a predefined directory structure, as part of the provisioning, configuration management, and application-deployment tool Ansible. Use this tag for questions related to the role tasks in Ansible.

Ansible role is a set of tasks to configure a host to serve a certain purpose like configuring a service, whereby they are defined using YAML files with a predefined directory structure, as part of the provisioning, configuration management, and application-deployment tool Ansible. Use this tag for questions related to the role tasks in Ansible.

224 questions
0
votes
1 answer

ModuleNotFoundError: No module named 'kubernetes'

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'kubernetes' failed: [ubuntu] (item={'name': 'deploymentnginx.yaml.j2'}) => {"ansible_loop_var": "item", "changed":…
0
votes
1 answer

ansible docker-compose module, different result from ansible than over ssh on the host

I have a task in my Ansible Bitbucket role that simply starts two docker-compose.yml files. When executing this from Ansible it fails but when I execute the same command over ssh on the actual server it works just fine. I am currently executing my…
Oskar Granlund
  • 399
  • 1
  • 4
  • 9
0
votes
1 answer

delegate_to on individual host not working under ansible role

I have following code in ansible. elasticsearch role is set up to run as below on elasticsearch host group which consists of 3 es nodes. - name: elasticsearch hosts: elasticsearch become: true gather_facts: false roles: -…
prat
  • 103
  • 2
  • 10
0
votes
1 answer

ansible play to execute same role against 2 host groups with different parameters passed to each host group

My use case is to use a single playbook to run the same role on 2 different host groups, but I want to pass different variable values depending on the host group the role is executing against. I've tried many ways of doing this, but I am finding the…
joey_82
  • 41
  • 7
0
votes
0 answers

Changing host in a role

I was assigned to create playbook that will be used by all teams within our department. Under this circumstances it has to be flexible. It should allow to choose technologies (depending on project/release) and to control execution servers. Playbook…
Mateo
  • 1
  • 1
0
votes
0 answers

use the templates file as source in Ansible which takes the value from defaults

I want to pass a variable in the Jinja file template and use it as src for the community.kubernetes.k8s module - name: deploy the config-file community.kubernetes.k8s: state: present src:…
Navneet Nandan Jha
  • 1,416
  • 2
  • 17
  • 22
0
votes
0 answers

How to run ansible roles in parallel

I'm on the latest version of ansible and python I wrote a testcase depicting the issue I m facing. I run the below shell-script and pass three application names each of which is an ansible role that executes task on the same node and sleeps (waits)…
Ashar
  • 2,942
  • 10
  • 58
  • 122
0
votes
1 answer

can an ansible plugin call a role or a playbook?

I have a big role i am looking to pack in a collection, and i want to create a plugin that does calls the role, instead of doing "include_role". so, i am looking for my customers to be able to put something like: - name: call my plugin my_plugin: …
Ehud Kaldor
  • 753
  • 1
  • 7
  • 20
0
votes
0 answers

Ansible: How to pause tasks of role until event happened on other host configured by another role?

I have two hosts which I want to setup with Ansible. Each host is assigned a role (host1: r1 and host2: r2). I run the configurations in one playbook. Description: Both roles run multiple tasks, but at some point r2 needs to wait (pause execution of…
0
votes
1 answer

Ansible: how can I use a wildcard or an alternative?

I recently learned that it's not possible to use the wildcard on Ansible. So I would like to know how could I run the next command with a Role. cat /sys/class/net/*/address | while read mac I tried to do it so, but it doesn't work. - name: Cat…
user13876146
0
votes
1 answer

How to create and edit a file with ansible

I need to execute the next Role with ansible and somehow it doesn't work. The idea is to create a sddm.conf file and add some lines in. When I run the role all goes like normal, even says that it did changes, but when I look in the destiny computer,…
user13876146
0
votes
1 answer

Ansible roles using requirements.yml

I have a private Ansible git repo which I would like to use in another repo. So I installed the role locally using requirements.yml. my question now is, when I git push my requirements.yml, how will it be consumed by my other peers when executing in…
suj
  • 507
  • 1
  • 8
  • 22
0
votes
1 answer

problem with task Ensure that Nginx is stopped

I wrote a role to run the reactos application the problem occurs with a single task to Ensure that Nginx is stopped . I get a strange error if I remove this point from the role, the application closes successfully, but I would like it to work with…
Iceforest
  • 309
  • 1
  • 11
0
votes
1 answer

Testing Ansible-Roles using Ansible Tower

I'm starting a new project and the client uses Ansible Tower. I will be working on Playbook/Role development and will need to do extensive testing. My question is: Does Ansible Tower support testing with Molecule and if so, where can I find…
Keith
  • 51
  • 2
  • 9
0
votes
1 answer

Ansible, how to differentiate the targets based on the different cloud

Im trying to write a logic (ansible playbook) where different roles are called based on the conditions. Eg: AWS role should be in invoked if the condition matches for AWS, likewise for GCP, AZURE, vmware. Tried to check through ansible_facts, no…