Questions tagged [ansible]
Ansible is an IT automation tool. Use this tag for questions regarding the Ansible IT automation tools.
221
questions
0
votes
0
answers
9
views
How to use wildcard in win_stat module in ansible
I created below ansible script where i checking directory is present or not with wildcard but it failed for me:
- host: windows
vars:
dir: 'c:\inetpub\wwwroot\mysite*' № without * playbook ...
0
votes
1
answer
37
views
Linux - Setting up a multi-user and multi-machine system where anyone can log to their user from any machine
I Have the following setup:
Many computers (all of them have the latest Ubuntu), and more users than computers. I would like to make it so anyone can log to their user from any computer, and they have ...
0
votes
1
answer
14
views
Ansible variable in action (get first ip of second interface) with jinja
I need to get the first IP of the second interface on my server (within a jinja variable).
---
- name: Playbook testing
hosts: all
become: true
tasks:
- name: Debug
debug:
msg:
...
0
votes
0
answers
19
views
Need ansible task to open CIFS share on localhost
I an creating a "recovery" ansible playbook, and I need to
link to a read-only share on the backup machine so I can copy files.
The share on the backup machine is //io.hcs/backup. In windows ...
1
vote
1
answer
12
views
How can I create RedHat VM and Ubuntu VM with one Vagrantfile?
Below is my Vagrantfile. However, instead of creating 1 RedHat VM and 2 Ubuntu VMs, it "vagrant up" 3 Ubuntu VMs.
Could someone let me know why?
Thank you in advance!
Vagrant.configure("...
1
vote
1
answer
24
views
Ansible roles supposed to install different mounts dependent on subnet, install all mounts on anything
My ansible script is doing a great job at putting all the mounts on any system I specify. But my intention was to install mounts dependent on subnet.
People on .35 are privileged and need acccess to ...
1
vote
1
answer
64
views
(Re-)starting a systemd unit with user input on Ansible
Tools like gocryptfs have some advantages when they're used in combination with systemd, because dependency, status and permissions can easily be defined.
Since it needs a passphrase, it would either ...
0
votes
1
answer
78
views
Ansible playbook runs from user, but not from crontab
I have a weird behavior on a crontab job I'm trying to run using Ansible's playbook.
First of all, I have similar crontab's lines using Ansible playbooks that works perfectly, so the issue is either ...
0
votes
1
answer
163
views
Cannot uninstall ansible with pip or brew on Mac OSX
I cannot remove ansible from my machine.
If I run:
which ansible
/usr/local/bin/ansible
and
ansible --version
ansible 2.7.0
...
0
votes
1
answer
68
views
Ansible playbook hangs in interactive mode
If I run the command (redis-cli --cluster create 192.168.1.10:6379 192.168.1.11:6379 192.168.1.15:6379) from the host(192.168.1.10) it prompts me for "yes" and it's working but in ansible ...
0
votes
0
answers
31
views
RE: host pip server on cloud
we are moving from on premises to a cloud. we currently host some of our custom build python packages on on premises pip server. but as we move to cloud we would like to have these custom pip packages ...
0
votes
1
answer
66
views
Ansible UFW allow outgoing, deny incoming
try to roll out UFW via Ansible.
- name: Install UFW Firwall
hosts: all
tasks:
- name: UFW enabled
community.general.ufw:
state: "enabled"
policy: "deny&...
0
votes
0
answers
106
views
Microsoft VisualFoxPro 9 silent install with Ansible
I need to automate Microsoft Visual FoxPro 9 installation via Ansible, but it seems like VFP9 installer does not have silent install mode.
(please note that I am installing MS Visual FoxPro 9, not a ...
0
votes
0
answers
14
views
Ansible to set IOPS limits on all disks of all vCenter guest VMs
For some testing reason I need to set all VM disks IOPS limits for all VMs on given vCenter (a) to some given number or (b) to unlimited.
I planed to use API calls to get VM list, the disks list, the ...
0
votes
1
answer
30
views
Ansible creates DNS records in FreeIPA differently than when they're created manually
I've found that Ansible creates DNS records differently than when I create them manually; particularly when creating the Reverse DNS records (PTR). I'm running Ansible version 2.9.27 on Rocky Linux ...
0
votes
0
answers
75
views
ansible: copy file between hosts when ssh keys are not setup
This is not another question about how to copy a file between remote hosts, I already know how to do that. I'm asking for workarounds when the involved servers are not setup to trust each other (...
0
votes
0
answers
200
views
How to disable syntax errors on ansible template files?
I am using VSCodium with the Docker plugin. When I have a docker-compose file in an ansible
template folder, the linter will show syntax errors whenever it encounters jinja2 template-variables.
The ...
0
votes
0
answers
31
views
`vboxmanage list hostonlyifs` creates host-only interfaces
If I run vboxmanage list hostonlyifs in my shell, I get the following output:
$ vboxmanage list hostonlyifs
Name: vboxnet0
GUID: 786f6276-656e-4074-8000-0a0027000000
DHCP: ...
0
votes
1
answer
132
views
How can I employ a "truly" dynamic inventory with Ansible, which changes along the way when new hosts become reachable?
I provision virtual machines dynamically and they become reachable along the way, whilst my playbook is already executing. How do I obtain a "truly" dynamic inventory?
By "truly" ...
1
vote
1
answer
268
views
How to identify the hard drive with the OS installed using Ansible?
I have an Ubuntu server, with 2 drives /dev/sdb and /dev/sdc. The OS is installed under /dev/sdb. Now, I am trying to write an Ansible playbook which will identify whether the particular partition ...
0
votes
0
answers
425
views
Kubernetes installation using ansible fails for admin.conf not found
I'm trying to setup Kubernetes cluster on Ubuntu-18.04 systems using ansible with below playbooks.
kube-dependencies.yml
- hosts: all
become: yes
remote_user: root
gather_facts: yes
connection:...
0
votes
1
answer
46
views
Full-text search the content of ansible-doc
I am using Ansible in an isolated network. To search for examples of a playbook, I want to do a full-text search for all the content of ansible-doc that is installed on the local machine.
Is there any ...
1
vote
1
answer
925
views
Ansible keyword - throttle
I am trying to use and understand how throttle keyword works.
Below is how I am using it (test-playbook.yaml).
---
- name: Test throttle
hosts: all
tasks:
# list of pre tasks
- ...
0
votes
1
answer
231
views
Extremely Slow Image Pulls Docker Private Registry
I have two servers:
1.Server-1 (GitLab-CE & Private docker registry)
2.Server-2 (Staging)
After build stage and push container to registry inside GitLab CI, next stage is deploy(CD) using Ansible. ...
1
vote
1
answer
5k
views
Ansible fails to create temporary directory
I am trying to use a jumpbox to reach my target VM on ansible.
I have the following file structure
play.yaml
hosts
serverA
serverB
testServers/
serverX
serverY
group_vars/
all....
-1
votes
0
answers
62
views
find the main disk of a montpoint
So I need help with this, I want to find every multipathed disk or LUN /main resides on i.e sd[a,b,c,d] then put the results in a file.
sda 8:0 0 893.3G 0 disk
├─sda1 ...
1
vote
0
answers
92
views
VSCode Ansible Language extension Python not loading
I'm trying to install the "Ansible Language" Extension for VS-Code:
https://marketplace.visualstudio.com/items?itemName=zbr.vscode-ansible
It installs the following Extensions as ...
0
votes
1
answer
494
views
Ansible playbook failing with "/bin/sh: /bin/sh: cannot execute binary file" on a Debian 5 target
A playbook I'm using is failing mysteriously on a client's legacy Debian 5 box. The playbook itself and my Ansible configuration are solid, and I've been running them successfully against a variety of ...
0
votes
1
answer
88
views
Running ansible_pull from systemd: git/ssh credentials?
I currently have a home server (old laptop) I'm provisioning with Ansible in
the classical push fashion, by pushing from my personal computer to it.
This works, but requires me to push after every ...
0
votes
0
answers
32
views
How could I do a list from an AWS account listing all running instances?
I'm using AWSCLI at Windows 10 Professional with GitBash. I need to have a list of all running AWS instances by account. Will start doing in an account to make a list to populate the public keys from ...
0
votes
1
answer
179
views
How to create a own CA bundle for import in FireFox using Ansible
I am trying to create certificates for my own CA. After importing the CA certificate ca-mydomain.com.crt into FireFox my website doesn't work but displays message
Secure Connection Failed
An error ...
0
votes
1
answer
84
views
Ansible debug permissions of ansible scripts
I have a user AAA, and set my remote path (successfully) to /home/AAA/.ansible_tmp/, and ansible successfully ssh'ed into the box with AAA, and I still get permission denied on the python scripts of ...
1
vote
1
answer
372
views
Ansible check mode giving error on copy task
I am running a playbook in check mode meaning I run the playbook with the --check flag. I need to transfer files from one node to the ansible control node and then from the control node to a remote ...
0
votes
0
answers
245
views
Installing particular version of Nginx using Ansible Playbook
My agenda is to write Ansible Playbook for installing nginx-1.8.1. But I couldn't install the specific version of Nginx using my below playbook. Getting error as "Failed to install some of the ...
1
vote
1
answer
3k
views
Ansible - Python - Docker: Module not found docker / docker-py — WHY No module found error is coming in Python prompt and in Ansible
Ansible 2.8.3
When I run my playbook, I see the following error.
TASK [deployer_role : Creating network] ************************************************************************************************...
2
votes
1
answer
3k
views
Ansible installed via pip3, but Ansible commands not found
I have installed Ansible via pip3, but I can't find the Ansible commands (ansible --version, ansible-playbook, etc.)
Here's the listing that shows that Ansible is installed via pip3:
:~# pip3 list | ...
0
votes
1
answer
25
views
Error while running ARA server on Alpine linux
I am trying to install the latest version of the Ansible Records Analyzer server on an alpine Linux I made sure that all requirements are well installed ( Django, GCC,python3, Pypi, ansible) the ...
0
votes
1
answer
291
views
Not able to copy a file with ansible
Learning Ansible, and mine is windows 10 machine. I enabled the windows feature, Windows Subsystem for Linux(WSL) and then installed Ubuntu app.
Then installed ansible as described here.
Now I ...
0
votes
1
answer
314
views
Ansible Customizing a local log file that contains multiple tasks outputs from a playbook
In my playbook I have two major tasks one task that change the gateway last digit for Debian machines and the second one applies to Redhat machines everything works fine but to be able to trace the ...
2
votes
1
answer
122
views
Jenkins SSH Host/User Certificates workflow
How to setup SSH key signing process every time some Ansible stage runs? Or at some interval at least.
I have pipeline which creates VM's with the Terraform and then runs Ansible. At cloud-init stage ...
0
votes
0
answers
959
views
Ansible won't copy files from /etc directory but will from others (ansible.errors.AnsibleFileNotFound: Could not find or access)
Ansible Version=2.7
I am trying to copy files from the local machines to a remote machine using an ansible playbook. The playbook is simple:
- name: Copy file to remote
become: yes
copy:
...
1
vote
1
answer
480
views
Why is ssh-keygen generating two types of keys between Ubuntu 18 and Ubuntu 20?
I have two virtual machines.
VM1 is on ubuntu 18.04
VM2 is on ubuntu 20.04.1
When I ssh-keygen on VM1 it gives me an RSA private key.
When I do the same thing on VM2, its giving me an OpenSSH ...
1
vote
0
answers
103
views
Icinga2 node setup fails. "Too many arguments. At most 0 arguments must be specifed"
Icinga Version: r2.10.3-1
I am trying to use an ansible playbook to automate my icinga client configuration. When i run the icinga2 node setup command in my playbook I get the error I mentioned in the ...
0
votes
1
answer
152
views
Ansible Conditional Role Dependencies
I have a question that has been bugging me for quite some time and I cannot find a proper way to handle it. I read all the documentation I could get, but I cannot find a satisfying answer.
Consider my ...
0
votes
2
answers
67
views
Ansible created user on Windows, gets ".EC2AMAZ-ELNOCH3" appended to username
I have created a Windows Server 2019 AMI using Packer, and Ansible as provisioner.
I have added a user jenkins, and copied SSH files (public/private key, known_hosts, authorized_keys) to C:\Users\...
2
votes
1
answer
9k
views
Ansible error “ Could not find or access on Ansible Controller”
I am trying to write an ansible playbook to send certificates to my client machines from my local machine. The error message I get is:
msg": "Could not find or access '/etc/icinga2/pki/...
1
vote
0
answers
490
views
cannot download repodata/repomd.xml
I'm training for my RHCE 8 EXAM, and I have to:
Create a playbook with the name setupreposerver.yaml to set up the control host as a repository host. Make sure this host meets the following ...
1
vote
3
answers
3k
views
"hostname: command not found" CentOS 8
On CentOS 8 the hostname command was removed. With seemingly no way to get it back. No documented way at least Duckduckgo tells me.
The problem with this approach is that the whole world expects the ...
0
votes
1
answer
713
views
Ansible windows update module how to install ALL updates
Is there a way to use the win_updates module in ansible to install ALL updates without having to specify every update category manually on the playbook?
3
votes
2
answers
1k
views
Ansible - ignore whitespace differences in lineinfile
I am starting to look into using ansible for maintaining a set of servers. I have ran into a difficulty with lineinfile. I am setting up rsyslog and want to make sure a few lines are in the /etc/...