Questions tagged [ansible-playbook]

468 questions
0
votes
2 answers

Does Ansible offer a way to build/compile on the control node, and then deploy to managed nodes?

Is there any way to have Ansible run a build script locally on the control node, and then deploy the resulting artifact to various managed nodes? Please let me know if there's something I've missed, but I looked at the docs for the shell, command…
0
votes
1 answer

Failing to download metadata with DNF upgrade playbook

i'm trying to learn something about ansible and the automation, unfortunately I'm getting frustrated at the early step. I just tried from debian 10 machine with ansible to write a yaml to upgrade 2 Oracle linux hosts, following a guide. What I've…
bind2lrz
  • 7
  • 5
0
votes
1 answer

How do I populate Ansible variables in a single pass

I have a simple Ansible role which creates a Foreman activation key, however it only "subscriptions" with the last value and not both? # cat roles/hammer/tasks/subscription.yml --- - name: Add Subscription key ID to Activation Key …
0
votes
2 answers

How can I ask a remote server that was never connected with my local machine to connect with me by SSH?

I use an old server, that has not been updated and that cannot be updated. The OS is FreeBSD, there is no Python, obviously Ansible, and no sshpass. I access this old server from my personal computer using Ansible and ssh. Both of them (my computer…
0
votes
1 answer

Run a remote playbook

I have a situation where I have the AWX repo cloned into the /tmp/ folder on a remote docker swarm container and I am already using ansible playbooks. What I am trying to do is run the playbook I have already and then run the playbook in the AWX…
0
votes
1 answer

How to cache Ansible group and host variables throughout a play

I have a playbook for some hosts which have group variables and host variables that use a custom lookup plugin to extract values from an API endpoint. ansible_user: "{{ lookup(get_value_from_endpoint) }}" One important information in the group…
Lester
  • 597
  • 4
  • 16
0
votes
1 answer

How to mount disks based on a ansible facts ansible_devices ids?

i'm trying to mount disks when a ansible device correspond a specific ids name: google-pgdata "sdc": { "holders": [], "host": "", "links": { "ids": [ "google-pgdata", …
0
votes
1 answer

Ansible --become not working when “sudo with NOPASSWD” is not activated on remote machine - MODULE FAILURE

In remote server, normal user is having sudo access but NOPASSWD not activated. sudo su - command ask for user password. I am trying to run a command using Ansible as providing sudo password but its not working getting "MODULE FAILURE\nSee…
0
votes
1 answer

Store ansible inventory files on a remote location

I'm trying to find a way to store Ansible inventory files on a location other than the server's local space (say for example Azure). Is this something that can be achieved by Ansible Dynamic Inventory? I have read the documentation about dynamic…
0
votes
1 answer

How to expose passwords/secrets in Ansible playbook

I have a simple Ansible playbook to Fetch a database connection config from an RestAPI, Extract the config object from the payload, Using the config JSON (as request body) to create a PUT request to another RestAPI. At the 3rd stage I found that…
Mehdi
  • 109
  • 1
  • 2
0
votes
1 answer

Ansible to rename a file only if exists

I need to rename /jp/Test to /jp/test only if /jp/Test exists , otherwise i dont need to perform this task. if Both exists i need to merge both into /jp/test I get below error {"msg": "The conditional check 'item.1.stat.exists == false and…
celcoprab
  • 43
  • 2
  • 3
  • 8
0
votes
1 answer

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 requirements, which must be done by the playbook: a. The…
Luan Moreira
  • 101
  • 2
0
votes
1 answer

sequential deployment in multiple servers using ansible playbook

I have 8 servers as(s1,s2,s3...)which are windows servers and an ansible-playbook with tasks in roles. How do I configure host inventory and execute all these tasks in s1 then in s2 then in S3...sequentially that is the execution of the playbook in…
vodevops
  • 11
  • 3
0
votes
1 answer

Pass encrypted value from xml file to ms build command

I have a xml file with passwords in it. I have to pass these passwords from a xml file to password property in MSBUILD command. Can anyone guide me Xml: newpassword My…
vodevops
  • 11
  • 3
0
votes
3 answers

Start systemd service after ansible playbook execution is complete

We are running ansible playbook on every boot and it does bunch of checks and configuration tasks on the host. We also have few systemd services that needs to run on that host. How do I make those services dependent on the ansible playbook…
ram
  • 13
  • 1
  • 6