Skip to content
Advertisement

Tag: ansible

Error using expect to execute shell script

I am using an expect script to automatically answer prompts in a shell script designed to add Linux systems to active directory. I only have three prompts: location, username, password. I am using Ansible to execute it. The issue when the script executes, it tries to install ~ 49 rpms on the vm, adcli, realmd, etc. Yum begins install the

How to use Ansible to add Linux environment variables

I’m trying to add environment variables to a Linux machine using vars like below: I’m using this task to add the variables to /etc/environment. But I’m getting the error below: What am I missing here? Answer The playbook below works as expected and created the file I only added the parameter create: true to avoid error msg: Destination /tmp/environment does

Install packages from a list through ansible

I have 2 servers named testserver and vsphere server. Ansible is installed on testserver and I have a list of packages stored in a text file packages.txt. How can I install those packages on vsphere server through ansible? This is my packages.txt file. I just have to fetch the package name from the packages.txt And this the yml file inside

ansible ansible_default_ipv4 set wrong interface

I am trying to configure a host and automatically select the relevant interface. For that I am trying to run the Ansible task: For some reason it stores in network_interfaces_to_configure an interface that is deactivated — it sets it to enp1s0f1 and it should be set to enp1s0f0 The host have the following interfaces: lo docker0 (virtual) enp1s0f0 (hardware connected

Ansible Replace the string variable in uri module

I want to download the filebeat7.15.2 binaries form artifactory. I am passing the version in my playbook as 7-15-2, but want to change in the playbook to 7.15.2 in uri module only. My binary is stored in example.com/artifactory/mvn-public-local/com/dbdb/rf/devops/filebeat/7-15-2/filebeat-7.15.2-linux-x86_64.tar.gz my playbook: I am running the playbook like I am getting error as url not found: “url”: “example.com/artifactory/mvn-public-local/com/dbdb/rf/devops/filebeat/7-15-2/filebeat-7-15-2-linux-x86_64.tar.gz”, Any suggest on how

unable to copy file from local machine to ec2 instance in ansible playbook

So I am running scp -i ~/Downloads/ansible-benchmark.pem ~/Documents/cis-playbook/section-1.yaml ubuntu@ec2-18-170-77-90.eu-west-2.compute.amazonaws.com:~/etc/ansible/playbooks/ to transfer an ansible playbook I created with VSCODE the section-1.yaml file, but I am coming up with an error scp: /home/ubuntu/etc/ansible/playbooks/: No such file or directory the directory definitely exists in the ec2 instance, I did install ansible, but for some reason I don’t know why it isn’t recognising the

Cannot convert string to boolean – ansible to powershell on linux

I read this whole thread about how to pass boolean values to a parameter to powershell on Linux. Nothing worked for me. My code in Ansible is as follows: I’ve used many variants, such as -ParticipateInCEIP:False, or -ParticipateInCEIP False, or -ParticipateInCEIP $false, but I get always the same error, that it expects boolean, but I sent string. I am running

Advertisement