Questions tagged [ansible-playbook]

468 questions
0
votes
2 answers

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". The passwords are the same for all examples…
Graham Nicholls
  • 291
  • 2
  • 5
  • 13
0
votes
1 answer

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 have an unknown number of facts that I want to run…
John Doe
  • 495
  • 1
  • 6
  • 12
0
votes
1 answer

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 and I'm using import_role on my main task. I was…
0
votes
0 answers

In ansible is it possible to use different users inside role task

In ansible is it possible to use different users inside role task # example: role # fuse_star # tasks # main.yml - name: start fuse command: " start fuse" become: yes become_user: test1 - name: check fuse…
khyathi
  • 1
  • 1
0
votes
1 answer

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 ansible-playbook initial.yml -u root -e…
Central
  • 1
  • 1
  • 1
0
votes
1 answer

Ansible : format Filesystem subtask fails

I have below task which fails at formatting EBS volume and just do not proceed further. I've checked all the documentation here but I find no issue with ansible task I defined here. --- # tasks file for aws-create-ec2 - name: Set instance file…
Shailesh Sutar
  • 1,517
  • 5
  • 23
  • 41
0
votes
3 answers

run long shell command on remote servers using ansible

I have a task in which I want to run below command on a shell on remote servers but whenever I run my playbook, it always gives me exception: - name: copy files shell: "machines=(machineA machineB machineC); for machine in $(shuf -e…
user1950349
  • 223
  • 1
  • 3
  • 10
0
votes
2 answers

template error with conditional check on "failed_when" ansible

I have an ansible task in which I need to verify whether I have all 1987 files and all those files were generated within 1 minute period. - name: check all 1987 files find: paths=/proc/files file_type=file age=-{{ window…
user5447339
  • 141
  • 2
  • 6
0
votes
1 answer

ansible-playbook to use subdirectory as variable

/var/lib/phoronix-test-suite/test-results/ it has 3 subdirs: 2018-04-22-1850 2018-04-23-1850 2018-04-24-1850 and a tiny file in each: composite.xml part of it's content: pts/ramspeed-1.4.1 RAMspeed…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ansible" class="post-tag grid--cell" title="show questions tagged 'ansible'" rel="tag">ansible</a> <a href="../../questions/tagged/ansible-playbook" class="post-tag grid--cell" title="show questions tagged 'ansible-playbook'" rel="tag">ansible-playbook</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 24 '18 at 20:08">asked Apr 24 '18 at 20:08</time> <a href="../../users/152607/big-nobody" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/152607.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="BiG_NoBoDy" /> </a> <div class="s-user-card--info"> <a href="../../users/152607/big-nobody" class="s-user-card--link">BiG_NoBoDy</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">138</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="8 bronze badges">8</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-908730"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/908730/how-to-skip-a-playbook-in-ansible" class="question-hyperlink">How to skip a playbook in Ansible</a></h3> <div class="excerpt">I have two playbooks one is fs.yml and nfs.yml..How can i add these two play books in single playbook and should prompt me which one i need to play. My playbooks pasted below. Tried multiple options but always vars_prompt executing first though tag…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ansible" class="post-tag grid--cell" title="show questions tagged 'ansible'" rel="tag">ansible</a> <a href="../../questions/tagged/ansible-playbook" class="post-tag grid--cell" title="show questions tagged 'ansible-playbook'" rel="tag">ansible-playbook</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 20 '18 at 14:06">asked Apr 20 '18 at 14:06</time> <a href="../../users/466283/sriramkannan-c" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/466283.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="SriramKannan C" /> </a> <div class="s-user-card--info"> <a href="../../users/466283/sriramkannan-c" class="s-user-card--link">SriramKannan C</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="2 bronze badges">2</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-907457"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/907457/variable-is-not-defined-response-from-api-call-in-ansible" class="question-hyperlink">VARIABLE IS NOT DEFINED ! response from API Call in Ansible</a></h3> <div class="excerpt">The following is my playbook containing a Rest Call --- - name: "REST CALL" hosts: local tasks: - name: "REST Call to Get Session ID" uri: url:…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ansible" class="post-tag grid--cell" title="show questions tagged 'ansible'" rel="tag">ansible</a> <a href="../../questions/tagged/ansible-playbook" class="post-tag grid--cell" title="show questions tagged 'ansible-playbook'" rel="tag">ansible-playbook</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Apr 13 '18 at 06:10">asked Apr 13 '18 at 06:10</time> <a href="../../users/465204/shyam-prasad" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/465204.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Shyam Prasad" /> </a> <div class="s-user-card--info"> <a href="../../users/465204/shyam-prasad" class="s-user-card--link">Shyam Prasad</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">11</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> <li class="s-award-bling s-award-bling__bronze" title="4 bronze badges">4</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-905371"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/905371/ansible-don-t-require-password-on-every-run" class="question-hyperlink">Ansible: don't require password on every run</a></h3> <div class="excerpt">I am looking for a way to securely handle passwords in ansible. Basically I'd like to avoid typing my password every time root or administrator access is required on a remote machine, but maintain some semblance of security (I know any solution…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ansible" class="post-tag grid--cell" title="show questions tagged 'ansible'" rel="tag">ansible</a> <a href="../../questions/tagged/ansible-playbook" class="post-tag grid--cell" title="show questions tagged 'ansible-playbook'" rel="tag">ansible-playbook</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 30 '18 at 17:36">asked Mar 30 '18 at 17:36</time> <a href="../../users/110282/ebarrere" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/110282.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="ebarrere" /> </a> <div class="s-user-card--info"> <a href="../../users/110282/ebarrere" class="s-user-card--link">ebarrere</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">330</li> <li class="s-award-bling s-award-bling__gold" title="1 gold badge">1</li> <li class="s-award-bling s-award-bling__silver" title="3 silver badge">3</li> <li class="s-award-bling s-award-bling__bronze" title="15 bronze badge">15</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-900751"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/900751/one-to-many-ansible-validation-of-firewall-ports" class="question-hyperlink">One to many ansible validation of firewall ports</a></h3> <div class="excerpt">I have this input.csv Server, Check-Server, Firewall-Port, Server1,Server2,80, ,Server2,9999, ,server8,8443, Server2,,, server3,Server6,8443, ,Server9,8888, and I will create a server.yml, --- Server1: name: Server2 - 80 -…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ansible" class="post-tag grid--cell" title="show questions tagged 'ansible'" rel="tag">ansible</a> <a href="../../questions/tagged/ansible-playbook" class="post-tag grid--cell" title="show questions tagged 'ansible-playbook'" rel="tag">ansible-playbook</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 08 '18 at 22:46">asked Mar 08 '18 at 22:46</time> <a href="../../users/459639/ricky-vene" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/459639.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Ricky Vene" /> </a> <div class="s-user-card--info"> <a href="../../users/459639/ricky-vene" class="s-user-card--link">Ricky Vene</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">21</li> <li class="s-award-bling s-award-bling__gold" title="1 gold badge">1</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badge">1</li> <li class="s-award-bling s-award-bling__bronze" title="4 bronze badge">4</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-899493"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/899493/ansible-library-strategy" class="question-hyperlink">Ansible library strategy?</a></h3> <div class="excerpt">I'm starting to use ansible for configuration management and wondering how to structure my ansible directory. For instance, web1 is a host which needs configuration edits made to Apache and /etc/ssh/sshd_config. jira1 is a host which doesn't use…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ansible" class="post-tag grid--cell" title="show questions tagged 'ansible'" rel="tag">ansible</a> <a href="../../questions/tagged/ansible-playbook" class="post-tag grid--cell" title="show questions tagged 'ansible-playbook'" rel="tag">ansible-playbook</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 01 '18 at 15:04">asked Mar 01 '18 at 15:04</time> <a href="../../users/151174/server-fault" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/151174.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Server Fault" /> </a> <div class="s-user-card--info"> <a href="../../users/151174/server-fault" class="s-user-card--link">Server Fault</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">3,714</li> <li class="s-award-bling s-award-bling__gold" title="12 gold badges">12</li> <li class="s-award-bling s-award-bling__silver" title="54 silver badges">54</li> <li class="s-award-bling s-award-bling__bronze" title="89 bronze badges">89</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-898332"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status "> <strong>0</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/898332/retry-ansible-remote-task-that-copies-the-file-if-there-is-any-failure" class="question-hyperlink">retry ansible remote task that copies the file if there is any failure?</a></h3> <div class="excerpt">I have ansible playbook as shown below which copies tar.gz file to remote servers and it works fine mostly.. - name: Play 2 hosts: ALL_HOSTS serial: "{{ num_serial }}" tasks: - name: untar latest process.tar.gz file unarchive:…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ansible" class="post-tag grid--cell" title="show questions tagged 'ansible'" rel="tag">ansible</a> <a href="../../questions/tagged/ansible-playbook" class="post-tag grid--cell" title="show questions tagged 'ansible-playbook'" rel="tag">ansible-playbook</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Feb 22 '18 at 07:24">asked Feb 22 '18 at 07:24</time> <a href="../../users/456491/user1950349" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/456491.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="user1950349" /> </a> <div class="s-user-card--info"> <a href="../../users/456491/user1950349" class="s-user-card--link">user1950349</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">223</li> <li class="s-award-bling s-award-bling__gold" title="1 gold badge">1</li> <li class="s-award-bling s-award-bling__silver" title="3 silver badge">3</li> <li class="s-award-bling s-award-bling__bronze" title="10 bronze badge">10</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/ansible-playbook_page=18" rel="prev" title="Go to page 18">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/ansible-playbook_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/ansible-playbook_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/ansible-playbook_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/ansible-playbook_page=31" rel="" title="Go to page 31">31</a> <a class="s-pagination--item" href="../../questions/tagged/ansible-playbook_page=32" rel="" title="Go to page 32">32</a> <a class="s-pagination--item" href="../../questions/tagged/ansible-playbook_page=20" rel="next" title="Go to page 20"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>