Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ansible-playbook]

The tag has no usage guidance.

1
vote
1answer
20 views

Make Ansible module use /etc/ansible/hosts instead of IP address

I have this Dell iDRAC management module I'm trying to use. For some bizarre reason it seems to demand an IP address instead of a respecting the hosts: directive. Here's the example I have been given:...
0
votes
1answer
25 views

Ansible: Debug and iteration over dicts fails in ansible playbook

Ansible version: ansible 2.6.2 python version 2.7.5 I have a debug output from an ansible playbook which gives this: "msg": { "changed": false, "failed": false, "guest_disk_facts": { ...
0
votes
1answer
32 views

Ansible multiline results and loop

Im registering with Ansible output from network checking in such way: - name: Test kube networking shell: kubectl exec -n iperf -it {{ item }} /test.sh loop: "{{ pods.stdout_lines }}" register:...
0
votes
0answers
11 views

UnicodeDecodeError during installation of OpenShift Container Plattform via Ansible Playbook

I'm trying to setup an openshift cluster using ansible on RHEL7. I configured everything in /etc/ansible/hosts according to the official setup instructions. However, while running the installation ...
0
votes
1answer
39 views

Ansible stdout from item collected with loop

Im trying to print stdout of registred items according to documentation documentation. Here is my yaml file: - name: network-check tags: stats shell: "tail -n 3 {{ ansible_facts['nodename'] }}_{{ ...
1
vote
1answer
34 views

Ansible - delete all partitions on a given list of disks

I'm having serious trouble to do something that seems very trivial, I guess I'm probably going on the wrong way. The scenario is quite simple, I have a host_group in which I have a list of disks like:...
1
vote
1answer
66 views

Ansible: How to get a subelement of a nested list of dictionaries

I'd like to build our DNS zones via Ansible. The user should just maintain one variable for the forward-lookup zones (e.g. foo.bar). Reverse-lookup zones (0.0.10.in-appr.arpa) should be auto-generated ...
1
vote
0answers
23 views

Ansible Digital Ocean APIv2 too fast?

I'm getting mixed results here provisioning new droplets with some new code. It seems like maybe Ansible is not waiting properly for the server to get an IP address. I have made several attempts to ...
1
vote
0answers
77 views

ansible empty dictionary conditional

I had an error when I run this code: - set_fact: my_var: "{{ my_var|default({}) | combine( {item.key: item.value} ) | default({}) }}" with_dict: "{{ my_dict }}" when: my_id in authorised[...
0
votes
1answer
70 views

How to prevent empty subelement list error in Ansible loop?

When I try to loop (with Ansible 2.6 loop) with subelements through all public keys of a list of users and encounter a user which has no public keys defined: - authorized_key: user: "{{ item.0....
0
votes
0answers
57 views

Error with Ansible 2.7.5 IOError: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/idna-2.8.dist-info/METADATA'

RHEL 7.5 kernel: 3.10.0-862.14.4.el7.x86_64 ansible-2.7.5-1.el7.noarch python-2.7.5-69.el7_5.x86_64 I'm getting the below error when I run ansible-playbook commands: ansible-playbook -i serverlist ...
0
votes
1answer
336 views

How to install mysql server using ansible playbook?

I am trying to install mysql server on centos using ansible playbook. My yml file looks like above. --- - name: Install MySQL database server hosts: test become: yes become_method: sudo ...
0
votes
1answer
44 views

How to configure nginx, access from web browser using ansible playbook?

I have an ansible playbook to install nginx. But when I type ip address I cannot access the server. Service is running fine. --- - name: Install nginx hosts: nginx become: true tasks: - ...
0
votes
0answers
26 views

how to access hostvar of other server in replace module

I'm trying to access hostvar in replace module but I could not access the same. hosts: [server1] server1.com [userpc] userpc.com ansible_ssh_user=dinesh [server1:vars] ansible_ssh_user=test ...
0
votes
1answer
50 views

set date on the mail body via ansible

I am trying to send a mail via ansible yaml that looks similar as below. The requirement is to send this email a week ahead of the patching. I can schedule it in cron, but I need to send an email 1 ...
0
votes
1answer
116 views

lineinfile module creating a file if it doesn't exist even I use “create=no”

--- - hosts: testhost become: yes tasks: - name: change user profile copy: src=/tmp/profile dest=/home/test/.bash_profile force=no owner=test group=test - name: update bashrc ...
0
votes
1answer
33 views

Ansible cloud stack module nested loop for security groups and ports

I'm trying to set multiple security groups at once using the ansible cloud stack module. The yaml file currently looks like this: - name: add inbound tcp rules to security group web ...
0
votes
0answers
20 views

Why is Terraform prompting for a variable value when I've already declared it?

Background In regards to ansible-playbook plays. I'm aware you can output to a log: log_path = ./ansible.log I'm aware of adding verbosity (-v, -vv, -vvv...) to the output. However what about ...
0
votes
2answers
50 views

How can I abstract away Ansible roles?

I have 2 different database instances in my infrastructure, each used to save different data, each running on different machines, and each of them needs different levels of availability & safety, ...
0
votes
1answer
164 views

Openshift installation playbook failing

I'm trying to install 2-node cluster with origin version 3.10 (one master, one node). Playbook fails on task openshift_control_plane : Wait for control plane pods to appear Initialization ...
0
votes
0answers
68 views

Ansible AWX playbooks pulled from github do not show in playbook drop-down box

I've got an installation of AWX 1.0.7.2, running on Ubuntu 18.04.1 and using Ansible 2.6.2. The installation was done using docker on linux. I have a couple of projects configured each of which uses ...
0
votes
2answers
29 views

ansible replace module is not working as expected

my ansible play book is working for me to uncomment certain lines in a .conf file, but its failing for one particular line its not making any change. below is my .conf file part. #<VirtualHost ...
2
votes
1answer
69 views

ansible -how to pickup hostname and create self signed certificate

i have working command for creating self signed certificate for IHS server's .kdb file and i was trying to use the same command through ansible. Here my aim is that ansible should detect the hostname ...
0
votes
0answers
392 views

Avoiding jinja templating delimiter in when statements

I'm currently porting my Ansible playbooks from version 2.1 to 2.7. Ansible now prints a warning if I use jinja templating delmiters such as {{ .. }} in a when clause. [WARNING]: when statements ...
0
votes
1answer
179 views

Ansible expect is not sending response

I'm new to ansible and trying it by writing an ansible playbook for installing graphite, as a part of it I have the graphite-manage syncdb command which I would like to automate. I wrote this task to ...
0
votes
1answer
27 views

Unable to access group address for template in Ansible

I'm trying to enumerate my eth0 address (set to default, because I read somewhere that eth0 is not always available..). In my template I attempt calling it from the group like so... [Unit] ...
0
votes
1answer
130 views

Ansible Playbook and syntax issue with variables

I'm trying to execute the below playbook I wrote but it fails on some syntax errors. I tried few things from the online doc but without sucess so far. The aim of these variable is to generate a ...
0
votes
1answer
59 views

Overriding ansible_skip_tags within a playbook

I’ve been able to manage Ansible's control variable that you usually specify on the command line using the set_fact module; such as - name: Use a default SSH key for this playbook set_fact: ...
0
votes
2answers
85 views

Ansible: user escalation failure

I am having a hard time understanding how to set privileges per task in ansible. So given the playbook scrappy, I want to log in as the admin user (ubuntu) but do something as the user scrappy. Note ...
1
vote
2answers
189 views

Ansible Variable above hosts

Ansible Variable above hosts hello its posible to create a variable for multi hosts like this? vars: some_vars: "./Prometheus/roles/" # <---- THIS Variable? - hosts: lxd1 vars_files: ...
1
vote
3answers
1k views

Rollback the changes in Ansible

Is there any method to rollback the changes in Ansible? Suppose my play book contains different plays like create 5 users,install 3 rpms, start the services. If I want to rollback a certain play how ...
0
votes
1answer
34 views

How to define Microsoft network client: Digitally sign communication (always) with ansible win_regedit

I want to select Define this policy setting for Microsoft network client: Digitally sign communication (always) in the Group Policy on Windows Server with Ansible and select Disabled radio button. The ...
1
vote
1answer
130 views

Ansible - Using different users to login when working on a dynamic inventory

I'm trying to install a package on a list of servers, these have a tag in common so I'm using that tag as they are all having Environment tag set to Dev. But the issue is some of them have OS as ...
0
votes
1answer
242 views

Force Ansible to log off to refresh user groups

I'm setting up a server with Ansible and Docker. I'm currently learning both technologies, so please bear with me if I'm being overly stupid here. In order to run run Docker commands, the user has to ...
0
votes
2answers
67 views

New to Ansible - adding users to servers depending on type

I'm relatively new to ansible, and am trying to write a playbook which adds users to a group of servers depending on the user_type (which i'm trying to define)... So... my playbook looks a little ...
-3
votes
1answer
328 views

How to copy a 1 GB file using ansible to remote machine as different remote user and password

I have tried to copy a file output of the ansible-playbook looks ok , but the file was copied to local machine not to remote machine in the location dest mentioned in yaml file. bash-4.2# ansible --...
0
votes
1answer
497 views

Ansible where do PreferredAuthentications SSH settings come from?

I'm running a standard ansible (v2.3.1) playbook using SSH username and password settings. When using the '-vvvv' setting i can see these SSH commands getting generated EXEC ssh -C -o ControlMaster=...
0
votes
0answers
77 views

ansible playbook to restart servers if necessary

I have tried to create a playbook to update servers and reboot if necessary. I cannot get it to work. I have managed to split it into 2 playbooks for Amazon Linux and Ubuntu. However, when I try to ...
0
votes
1answer
111 views

ansible double loops execute one by one based on when condition

In ansible variables are getting dynamically from register output first loop will collect the values from registered ouput result and once it will satisfy the when condition, next loop should start ...
1
vote
1answer
248 views

Ansible: cannot get contents of a variable

I seem unable to get the output from a yum command from ansible. I have $ cat mcve.yum - name: MCVE hosts: localhost tasks: - name: Install package yum: name=perl register: ...
0
votes
0answers
58 views

Ansible is stalling while running bundler module

I'm putting together a small ansible playbook to deploy a jekyll site and I'm running into some issues when running a task to update the codebase dependencies with bundler. I've tried debugging with ...
0
votes
0answers
35 views

ansible run from mac fails with objc error

I've been running ansible-playbooks from my mac for months and yesterday I began having problems. I'm reinstalled ansible and python 2.7 to no effect. I have a workaround but the reason for the ...
0
votes
0answers
20 views

ansible cuts off WINRM RESULT making investigation a challenge

Is there a way to get ansible-playbook execution to provide the entire winrm error? I am running with -vvvv and still see a cut off like below: WINRM RESULT u'<Response code 1, out "{"changed":...
0
votes
1answer
457 views

ansible-pull: what does `fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “one of the following is required: name, list”}` mean?

What does the following message mean? fatal: [localhost]: FAILED! => {"changed": false, "msg": "one of the following is required: name, list"} The scenario: I run: $ sudo ansible-pull -C ${user}/...
0
votes
2answers
176 views

Ansible variable for roles used several times

I have a role with some variables than I using several times with different parameters like below: roles: - role: my_role vars: role_uuid: uuud_1 first_param: first - ...
0
votes
2answers
1k views

Using ansible with password authentication and different usernames

We're in the position of maintaining multiple database servers, which have one of two admin accounts, and which use password authentication. Lets say that the two accounts are "db_admin" and "db_user"...
0
votes
1answer
123 views

Does ansible win_chocolatey module support retries?

Has anyone ever seen retries work on an ansible win_chocolatey task? The follow seems to fail on the first attempt with no retries and I'm getting timeouts at the ansible level while choco attempts ...
1
vote
1answer
59 views

Ansible hangs on pumactl start

I have a playbook to install puma on my ec2 instance and everything is fine except when I run bundle exec pumactl start at the the end it starts the server but the playbook hangs indefinitely. Here ...
0
votes
1answer
1k views

In ansible, how do I specify an exclusion set of hosts in a playbook?

With command line patterns, you can specify patterns like "all,!ntpservers" but I can't figure out how to specify this in a playbook. I'm regularly running into cases where I have to install a client ...
1
vote
1answer
53 views

Pooling package installs in ansible

I am trying to set up a system with multiple roles (e.g., webserver, database-server, mailserver etc.) Each of the roles requires the installation of some software packages defined as their own task ...