Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [ansible]

Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad-hoc task execution, and configuration management.

1
vote
1answer
12 views

How to automate F5 saas_idp template on BigIP from Ansible

I am deploying a BigIP IdP SAML virtual server in IdP initiated mode thanks to iApps template f5.saas_idp.v1.0.1rc1 based on instruction from https://www.f5.com/pdf/deployment-guides/saml-idp-saas-dg....
0
votes
1answer
25 views

Dynamic inventory in yaml format

Background I have domain managed via Terraform and it outputs server IP address. Then I have a script which outputs YAML inventory (outputs follows later). Ansible 2.6.2 Source of format: https://...
-1
votes
0answers
25 views

Ansible YAML inventory - Groups that are allways members of other groups

Situation: I have a group "webservers" where I put all webservers in. As well as a group "mysqlservers" for the database servers respectively. Now I do also manage some LAMP servers and I want them ...
1
vote
1answer
29 views

Monitoring Ansible pull with Nagios

I have a couple (say 40) of workstations and servers that are configured using Ansible in the pull configuration. Each machine has a cron job that uses ansible-pull to pull a git repository and apply ...
0
votes
2answers
35 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 - ...
-1
votes
0answers
41 views

Finding a fact on some random host in ansible

I am setting a fact on one of my hosts within my play like this: - name: set fact set_fact: foo: "bar" when: "someCondition == true" run_once: true and later I'd like all my other hosts to ...
0
votes
2answers
33 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
0answers
19 views

ansible choco module fails to install / update choco

When we run this task, we sometimes fail with the following error: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ReadTimeout: HTTPSConnectionPool(...
1
vote
1answer
90 views

Ansible | Access multi dimensional variable for when conditional in nested loop task

I try to use a conditional when inside a task with a nested loop. Specifically first of all I want to read different states per user, register the variable after that and want to iterate over this ...
0
votes
1answer
44 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
votes
0answers
31 views

Ansible - Create list of dictionary from register

Having requirement to create list of dictionary from command results. Unable to determine right way to do it. any help would be appreciated. stdout lines from command ok: [Host] => { "msg": [ ...
1
vote
3answers
66 views

Test if UFW firewall change would prevent me from reconnecting

I want to manage UFW firewall rules on a number of remote Ubuntu 18.04 machines using Ansible. If a change to the firewall rules prevents me from re-connecting to the machines via SSH that would be ...
1
vote
1answer
46 views

Is it possible to define host aliases in ansible, similar to ssh config?

In SSH config, you can use the following format to list multiple aliases that all specify the same host: Host DEV-USA-BGW100 dev-usa-bgw100 USA100 usa100 HostName 192.168.1.100 User ansible ...
4
votes
0answers
113 views

Docker + Ansible + google-compute-engine debian packages - a confusing story

Dear fellow Server Faulters! I have stumbled upon a problem that confuses me A LOT and you are my only help! Long story short: 1. I have a set of ansible playbooks to configure servers 2. These ...
1
vote
1answer
31 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 ...
1
vote
0answers
57 views

Ansible ssh forwarding is fine while adhoc, but failed in playbook

After much hair pulling and head banging, I can't seem to figure this one out. I am trying to get Ansible to clone/checkout a private repo on a remote machine, and decided to go with SSH forwarding ...
0
votes
1answer
41 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 ...
0
votes
1answer
71 views

Ansible throwing errors while installing packages via apt and yum

I am trying to install packages in ansible using playbook. For that i need to install some packages in yum and some in apt. The version of ansible i am using is: root@server:~# ansible --version ...
1
vote
2answers
36 views

Export An Env Var To Container With Ansible

I'd like to export an environment variable to Docker using Ansible (preferably) that has a value of a command substitution, e.g. export SSH_AUTH_SOCK=`cat /root/file.txt` file.txt's content changes ...
0
votes
1answer
29 views

Ansible replace. Replace part of the regular expresion

I create a playbook that will harden my linux servers. Part of the process is to replace the umask in the default profiles. So, I have created this task: - name: Change the umask for default profiles ...
1
vote
1answer
51 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 ...
1
vote
1answer
47 views

Ansible: Calling tags from role but they are not getting executed

I have some tasks as shown below - name: Add the server's domain to the hosts file lineinfile: dest: /etc/hosts #regexp='.*{{ item }}$' line: "{{ hostvars[item].ansible_default_ipv4....
1
vote
1answer
31 views

Managing multiple remote user accounts and pubkeys with Ansible

I'm trying to work out a way to manage a single user's pubkey across multiple sites, as well as dropping that key into multiple $HOME directories. Reason being; our devs login as themselves to check ...
1
vote
2answers
37 views

How to install a MySQL plugin with Ansible?

So far we've been using the Geerlingguy Ansible role for all of our database deployments, but now I'm expanding our usage of it for a new project, and it doesn't seem installing plugins is a supported ...
1
vote
1answer
54 views

Ansible setting up indempotent playbook with nonstandard ssh port

I set up my servers with non-standard ssh port. I would like to find a way to build an indempotent master playbook, but I seem to have trouble with an UNREACHABLE error while gathering facts. I have ...
1
vote
1answer
30 views

Restart MariaDB cluster with Ansible

I would like to restart my MariaDB cluster with Ansible. I applied serial option to run script on servers one by one, but at the end of the script (= after build cluster), I would like to run command ...
2
votes
0answers
44 views

Ansible: Replace (only) default config file

I'd like to place a custom configured /etc/my.cnf ONLY if the default my.conf is currently in place. Once the default my.cnf has been replaced or edited, I don't want to risk replacing it with my ...
0
votes
1answer
43 views

Iterating Over An Unknown number of custom Ansible Facts

I've written some custom facts which I reference to as values for a module in a task . When I have 1 custom fact I don't have a problem running the task , but the question is , what do I do when I ...
2
votes
1answer
282 views

Using if/else statement to run a command in shell

I wanted to run a command in shell (basically via ansible playbook), the condition is, if the ps status gives non zero exit code then it needs to run another command. I don't wanted to split this into ...
0
votes
1answer
80 views

issues with Ansible and vars precedence with dependencies

I'm having issues with vars precedence, hope you can help me here. I'm currently using geerlingguy.ansible-role-postgresql as a dependency of my own postgresql role. Is define as a dependency in meta ...
2
votes
3answers
131 views

Safe way to deploy iptables using ansible

I would like to deploy iptables rules in a "safe" way using ansible where for safe I think at something like the shorewall command safe-restart. So I'm looking for a workflow like this: install the ...
0
votes
0answers
60 views

Kerberos ticket issues for AD domain rejoined computers using Ansible

We have Windows domain spread across multiple sites and we are using Ansible for orchestrating Windows rebuild process. During the rebuild, we observe some Kerberos related issues that we suspect may ...
2
votes
2answers
74 views

Ansible parsing a JSON output

I'm using URI in order to get a JSOn output to a register called "vchosts" TASK [debug] ****************************************************************************************************************...
1
vote
1answer
51 views

Ansible = use facts as variables in inventory file

I'm using Ansible to install and configure Red Hat OpenShift. One of the challenges I'm currently facing is with setting up LDAP auth using a playbook. I need to add the following variable to the ...
0
votes
1answer
96 views

Ansible Debug-msg data as email content

I want to send email with content from .yml file output. I've created a Jenkins job using groovy script and inside groovy I'm using shell script to call .yml file and inside I'm checking the url's ...
0
votes
2answers
47 views

How can I find out why a task is running?

I'm working with a complicated Ansible system with a lot of roles in various repositories. When I run a certain playbook, a task is running that I think shouldn't be. Is there a way to find out what ...
0
votes
1answer
25 views

Ansible args content, porting a module from 1.9 to 2.x

I'm porting a module from ansible 1.9 to 2.x, and the args file content seems.. odd? After the shlex simple strings are fine but lists and dictionaries look like over-escaped garbage. An example: ...
0
votes
1answer
93 views

How to use multiple ansible versions in ansible tower

Ansible Tower 3.3.0 Currently we are using Ansible 2.4.2, need to upgrade to 2.5.x, to take advantage of new features, without breaking existing jobs that have been tested and currently working. Would ...
-1
votes
1answer
43 views

Ansible won't create yum repository

I'm trying to get Ansible to set up the EPEL repository on a new AWS instance. It fails if I use the yum_repository module. If I use the yum module and try to install it over the wire it reports as ...
0
votes
0answers
33 views

Can Ansible run plays from imported playbooks?

Is there a way to use import_playbook (or other include method) to set a variable and have that variable available to another playbook? Ideally, code below doesn't work but what I'm trying to ...
0
votes
1answer
91 views

IAM policy for ansible dynamic inventory in ec2

So, I am using the ec2.py script (provisioned by Ansible) for generating dynamic inventories. I have created the following IAM policy: { "Version": "2012-10-17", "Statement": [ { ...
0
votes
0answers
24 views

Ansible ios_l2_interface Error - Does not recognize interface as Layer 2

when I execute the ios_l2_interface module against a Cisco (IOS 12.2(55)SE) switch I get the following: ansible all -m ios_l2_interface -a"name='FastEthernet1/0/19' mode=access access_vlan=1" -i ...
0
votes
1answer
114 views

ansible-playbook doesn't work inside a bash script

I am not sure what is going on and hence I enquiring here as well in hopes that some of you might. I am trying to figure out why the same one-liner will successfully connect on my remote server ...
1
vote
0answers
258 views

Ansible can't connect with it's own ssh config to dynamic inventory hosts

My Ansible configuration ansible.cfg: [defaults] host_key_checking = False remote_user = centos roles_path = ./roles pipelining = True [ssh_connection] ssh_args = -F /etc/ansible/ssh/ssh_config ...
0
votes
0answers
113 views

Ansible vmware_guest_facts use facts for multple vm's

I am writing a script where I deploy and configure VM's on a vSphere environment. After the deployment I want to gather the IP's of the VM's for DNS registration. Facts can be gathered for 2 or more ...
2
votes
1answer
153 views

Managing /etc/security/access.conf with ansible

New to Ansible and have several machines which make use of the pam_access module which is configured in /etc/security/access.conf. Multiple lines specifying ALLOW/DENY (+/-) and then either users or ...
0
votes
1answer
91 views

Ansible import_playbook on directories or with regular expressions

Can Ansible directive import_playbook be used with regular expressions or simply on a directory? What I want to do is something like: - import_playbook: playbook*.yml (to import in order or ...
0
votes
0answers
23 views

ansible replace module doesnot work same for other file with same content

Using ansible replace module to comment the below lines "ftp and telnet" in the AIX /etc/inetd.conf file "ftp stream tcp6 nowait root /usr/sbin/ftpd ftpd -l -u 077 -t 180" "telnet stream ...
1
vote
1answer
45 views

Modifying pam with Ansible

As part of a new server setup, I provision /etc/security/access.conf with user/group and src IP addresses of allowed ssh logins. This requires enabling pam_access in the /etc/pam.d/login and /etc/pam....
0
votes
1answer
44 views

ansible update debian from fedora

So I got a bunch of Raspberry Pies, and I'm getting tired of logging on to each one to update them. So I got ansible to get that done. I'm running ansible from a Fedora laptop, and I got the python-...