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

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
20 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
41 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
votes
0answers
13 views

Pass SIGTERM to binary started with Ansible

I'm trying to run a large number of processes on gCloud preemptible instances. I start the processes with Ansible as an async task. How to ensure that the commands started with ansible catches the ...
1
vote
2answers
94 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
87 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
0answers
21 views

Get “gs_secret_key” and “gs_access_key” values for Google Bucket

I need to create a directory in a Google Cloud Bucket using Ansible. I would like to know where I can find the values to complete "gs_secret_key" and "gs_access_key" to use "gc_storage" module in ...
-1
votes
1answer
69 views

Change user as root in Ansible

We have a requirement to install Siebel application using Ansible. We are trying to install Oracle Client with Siebel user which we did successfully. Now next step we want to run one custom shell ...
0
votes
1answer
53 views

ansible find and change permissions

I am scratching my head to why my code is not registering files in the dict something wrong with my code in the playbook but cannot see what vars: file_vars: - { spath: /var/log/ctm, type:...
0
votes
1answer
26 views

AWS credentials not being picked up by AWX template

I've got a new Ansible AWX server running and one of the things I'd like to do with it is to create an AMI of AWS instances before then installing regular updates to the instances. I've got the ...
-1
votes
1answer
43 views

Test ansible role on localhost

How can you test(-run) an ansible role on your localhost? So far I have done this on my ubuntu 16.04 machine: $ sudo apt-get update $ sudo apt-get install software-properties-common $ sudo apt-add-...
0
votes
1answer
48 views

Register var with dict and loop over output dynamically

I want to create and boostrap multiple vm's with an ip. This is working when only creating one at a time, but I would like scale this playbook to create more than one at a time. I make a call to ...
0
votes
1answer
42 views

Ansible: Pass a variable gererated in a role af a host1 to another role of a host2

I am trying to use a variable generated in a role for a host1 and use it in another role for a host2. This is the general layout used: | # Group variables +-- group_vars | +-- all # variables ...
-2
votes
0answers
46 views

Ansible chgrp failed when changing permission and owner of a directory

I have a following task that change the owner ship of directory to be able to writeable by webserver - name: give writeable permissions to laravel storage directory file: > path={{ ...
1
vote
0answers
15 views

Setting a mountpoint as immutable with ansible makes the mounted volume unable to be written, while it works manually

As a force of habit after losing several hundred TB of data in the past during a NAS outage, I always set mountpoints on servers to be immutable. It prevents any changes to the disk structure ...
0
votes
2answers
53 views

Ansible - wrong passphrase - even if it has to be correct

i am running ansible modules/playbooks (for example ping) with this command by user, who have sudo rights: sudo ansible -m ping hosts "hosts" is group of 2 hosts. When i run this, i'm asked for ...
0
votes
1answer
33 views

Jenkins API intermittent authentication errors

I'm using Ansible's jenkins_job task to set up some Jenkins jobs. I'm authenticating with a username+password which is authenticated as a Linux user on the Jenkins machine. - name: Install my job ...
0
votes
0answers
26 views

Ansible - manage installed apps and send output via email - variables are filling wrong

so i have this playbook, which checking, if there are installed selected packages. nothing special there. Then i would like to send an output to my email, if everything went right etc. --- - name: ...
0
votes
1answer
29 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 ...
0
votes
1answer
55 views

Ansible: run additional tasks for specific inventory

As per the "Best Practices" chapter in Ansible's documentation, I have separate inventory files for my development and production environments. While both environments get the same software stack ...
1
vote
1answer
70 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 ...
4
votes
1answer
194 views

What does Ansible push to the remote host?

Wondering how Ansible works at a brick level. Most sites say a module is pushed and Ansible does not need an agent on the remote host - just SSH and Python. It seems like Ansible would need to ...
-1
votes
2answers
92 views

Creating users via Ansible and with_subelements

I'm trying to write an Ansible playbook which will allow me to define a list of groups to apply to a list of users, across a list of defined servers. It seems to be getting close to working except ...
1
vote
0answers
45 views

Explanation needed on what situations make a task run on two hosts in the same try?

I came across a task that seems to be trying to run on two hosts like so: TASK [setup] ******************************************************************* fatal: [====]: UNREACHABLE! => {"changed":...
0
votes
1answer
33 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 ...
1
vote
0answers
45 views

How Do I Use Ansible Tower's Credential Parameters (Machine, Network, Cloud) in my Playbook or inventory file

I am using AWX (open source Ansible Tower) and I have 2 cloud based linux machines I would like to manage with it. The 2 Linux machines have 2 different private keys that I have uploaded to the ...
2
votes
3answers
85 views

How to select all hosts except the inventory_hostname from a group?

I have a group of two hosts. I want to delegate a task to the one that is not the current host. The following doesn't match anything and just returns a list of my initial two hosts. - debug: msg=...
0
votes
2answers
62 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 ...
0
votes
1answer
55 views

Ansible best practise - multiple administrators [closed]

Didnt find anywhere what is best practise for using Ansible by multiple administrators. We would like to login with SSH keys to both control machine and remotes. Is the best way to do this: Create ...
-3
votes
1answer
80 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 --...
-1
votes
1answer
40 views

Ansible versioning on git

I've got a git repo, I've got my playbooks and hosts. Now what? What is the recommended way to get my /etc/ansible folder on my GitLab? I can just create the repo, but then how and when do I pull ...
0
votes
1answer
99 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
1answer
90 views

Ansible: check supplied tags are valid before running a playbook

I suspect that this is trying to be too clever (and failing), but - especially in development of a PB, it's really useful to use tags to limit the roles which are run - so for example we have: (...
0
votes
1answer
216 views

ansible [WARNING]: Ignoring invalid attribute: update_cache

I'm not sure why I'm getting this warning. I've already checked the apt module and it says: update_cache bool Choices: no ← yes Run the equivalent of apt-get update before the operation. Can be run ...
0
votes
1answer
53 views

No packages matching ** is available in ansible

I'm trying to install a list of packages with ansible, and I can't seem to understand what the problem is. - name: Add PHP 7.2 repo apt_repository: repo: ppa:ondrej/php state: ...
1
vote
1answer
157 views

Global handlers in Ansible

Is it possible to have truly global handlers in Ansible so that I can "notify" the handler from any task of any role of any playbook? And without explicitly importing. I just want to define a ...
1
vote
1answer
81 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
2answers
165 views

Ansible Loop Over Custom Facts

I have the following structure in custom facts . { "ansible_local":{ "finance":{ "facts":{ "files":{ "file1":{ "dest":"/tmp/...
0
votes
0answers
34 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
17 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
12 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
100 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
0answers
24 views

How can I add multiple variables in Ansible PB from another file

I plan to add few hundred of lines in some files using Ansible. My idea is to put all those lines in a file and then use a variable inside the playbook. This is the first part. The second one is ...
1
vote
1answer
29 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
2answers
242 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
vote
1answer
56 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
58 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
189 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
41 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
137 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
62 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 ...