[ansible-project] Re: Need help

2018-10-28 Thread Sathya Narayanan
Any suggestions/ideas on the below ask? On Sat, 27 Oct 2018, 11:14 pm Sathya Narayanan, wrote: > Hi All, > > I am new to ansible and I would like to understand or get some ideas about > how to use ansible to maintain standard operating system environment. > > For example : I would like to hav

[ansible-project] Re: need help on simple arrays

2022-09-15 Thread Todd Lewis
Does this help? *$ cat arrays.yml* --- - name: show arrays hosts: localhost vars: users: - username: test homedir: /home/test shell: /bin/bash - username: test1 homedir: /home/test1 shell: /bin/bash - username: test2 homedir: /home/t

[ansible-project] Re: need help on simple arrays

2022-09-17 Thread Ahmed Elhusseini
yes, it does. Thank you. but I have a question why I cannot use this: --- - name: show arrays hosts: ansible1.technyati.com vars_files: - /home/ansible/rhce8/lesson5/arrays/vars/users tasks: - name: print array values debug: msg: "User {{ users.test.username }} has hom

[ansible-project] Re: need help on simple arrays

2022-09-17 Thread Ahmed Elhusseini
yes, it does. Thank you. but I have a question why I cannot use this: --- - name: show arrays hosts: ansible1 vars_files: - /home/ansible/rhce8/lesson5/arrays/vars/users tasks: - name: print array values debug: msg: "User {{ users.test.username }} has homedirectory {{

[ansible-project] Re: Need Help in Ansible regex

2020-01-24 Thread Cyril Stoll
Hi Not quite sure what you are trying to do with the slash ("/") symbol in your regex. If you want to use it to escape the dot (".") sign then you need to use a backslash ("\") instead of a slash and you need to put it before the dot not after it. So try this: dp-steps-common-[0-9\.]+[0-9\.]+[

[ansible-project] Re: Need help to automate tasks.

2017-10-29 Thread 'J Hawkesworth' via Ansible Project
You can do something like this (thanks to Matt Martz who originally suggested it) - name: check if app is up and ready to serve the wsdl uri: url: 'http://{{ inventory_hostname }}/app/app.wsdl' return_content: yes timeout: 2 delegate_to: localhost register: poll_result until:

[ansible-project] Re: Need help to automate tasks.

2017-10-29 Thread 'J Hawkesworth' via Ansible Project
Oh, I meant to say you can use the block...rescue ... allways with 'debug' module to display the messages you want. See http://docs.ansible.com/ansible/latest/playbooks_blocks.html and http://docs.ansible.com/ansible/latest/debug_module.html Jon On Sunday, October 29, 2017 at 9:34:19 AM UTC, J

[ansible-project] Re: Need help to automate tasks.

2017-10-30 Thread abhay gupta
Thanks Jon I am able to complete my task now... Abhay Gupta On Sunday, October 29, 2017 at 3:07:20 PM UTC+5:30, J Hawkesworth wrote: > > Oh, I meant to say you can use the block...rescue ... allways with 'debug' > module to display the messages you want. > > See http://docs.ansible.c

[ansible-project] Re: Need help with ssh connection

2015-02-02 Thread Drew Marold
> > Further data point: If I try to use the command module instead of raw, > while it still fails, I do at least get the debugging output, and it looks > like the initial connection succeeds, but then it fails when it tries to > run a bunch of shell commands which obviously are not valid in AOS

[ansible-project] Re: Need help with ssh connection

2015-02-02 Thread John Oliver
Can you just 'ssh rack1_pdu'? Or do you have to 'ssh user@rack1_pdu' and supply a password? You can add '-u username' to your ansible command line. Does your PDU support SSH public keys? I've always used keypairs with ansible, so aren't sure how you'd pass a password along. -- You received

[ansible-project] Re: Need help with ssh connection

2015-02-02 Thread Drew Marold
If you look at the bottom of the first post I did ssh to it from the Linux command line. It doesn't have a dns name, so I have a host_vars file defining the IP, and a group_vars file specifying username & password for all the APC gear. Just to be thorough I did just try with the -u but that di

[ansible-project] Re: Need help with ssh connection

2015-02-02 Thread Drew Marold
On further investigation, this appears to be an issue with the ssh server built into the PDU rather than an Ansible issue. While I can ssh to it for an interactive session, if I try to just send a command like 'ssh apc@10.26.1.129 olstatus 6' it connects but the session closes before I get the

[ansible-project] Re: Need help with ssh connection

2015-02-04 Thread Drew Marold
Unfortunately neither -t option made any difference. I'm going to just fall back & use Expect for these things. Thanks for the suggestions. > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receivin

[ansible-project] Re: NEED HELP - connecting via winrm

2016-06-03 Thread Matt Davis
The var definition in your inventory file is wrong- try: [Windows:vars] Also, if you're on 2.x you should probably use the new ansible_user/ansible_port/ansible_password vars. The old ansible_ssh_X versions will continue to work, but the new ones are much clearer. On Friday, June 3, 2016 at 7

[ansible-project] Re: Need help with deprecation warnings

2016-09-13 Thread ayush . kumar
Thanks for the sleuthing. It seems like using a "is-defined" check as a conditional is pointless if we have to send everything through default anyway. I understand the change for loops (since it checks each item now), but this behavior seems really counter-intuitive for blocks. What's even the

[ansible-project] Re: need help to configure a loop

2021-06-28 Thread david...@mycit.ie
Hi, Have you tried using the Block function of Ansible? https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html https://ericsysmin.com/2019/06/20/how-to-loop-blocks-of-code-in-ansible/ On Monday, June 28, 2021 at 11:14:40 AM UTC+1 yahi...@gmail.com wrote: > Hello guys, > I ne

Re: [ansible-project] Re: need help on simple arrays

2022-09-17 Thread Todd Lewis
"users" is an array of three things. So you have to either iterate over the array as with something like "loop:", or index it as with "users[0]['username']", "users[0]['homedirectory']", "users[0]['shell']", or use some sort of filter that does the iteration for you and selects list items that

Re: [ansible-project] Re: need help on simple arrays

2022-09-20 Thread Ahmed Elhusseini
Thank you so much, I appreciated On Saturday, September 17, 2022 at 11:36:31 PM UTC+3 uto...@gmail.com wrote: > "users" is an array of three things. So you have to either iterate over > the array as with something like "loop:", or index it as with > "users[0]['username']", "users[0]['homedirect

[ansible-project] Re: Need help about Ansible block syntax

2018-01-31 Thread ZillaYT
block does not support ALL the features of a simple task so this may be your issue. For example, it may not support notify, but you'll need to look at this. On Wednesday, January 31, 2018 at 10:29:00 AM UTC-5, JiElPe-Fr38 wrote: > > Dear all, > > I am quite new to Ansible and try to "make a tour

[ansible-project] Re: Need help about Ansible block syntax

2018-01-31 Thread Malcolm Hussain-Gambles
Notify should go after each of the tasks. You could set a fact in the block then check that and notify afterwards though -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an

[ansible-project] Re: Need help about Ansible block syntax

2018-02-01 Thread JiElPe-Fr38
Thanks all for your help. I have been really bored with the block... but I finally succeed. The ansible / yaml syntax is not always straightforward to understand (or I lack some skills). I went back to the ansible block documentation

[ansible-project] Re: Need Help with writing ansible playbook

2017-10-19 Thread Ken Jenney
I think you're overthinking it. If you need a script to regularly get disk utilization ansible is overkill at best. You could use pssh to accomplish the same thing. The email part of this is a separate beast altogether. ``` ansible all -i inventory/your-machines -a "df -h" > output.txt mailx -a

Re: [ansible-project] Re: Need help with ssh connection

2015-02-02 Thread Mark McCoy
The device might use a non-standard SSH daemon that only implements enough of the SSH protocol to allow remote interactive logins, but not enough to allow the types of non-interactive connections that Ansible is trying to make. Try your test from the command line with and without the -T and -t fla

Re: [ansible-project] Re: Need help with deprecation warnings

2016-09-13 Thread Brian Coca
blocks let you do 2 things, handle errors and 'share settings', the conditional does not affect the block itself, it is a way to allow all tasks to inherit it, instead of writing it N times. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "An

Re: [ansible-project] Re: Need help with deprecation warnings

2016-11-15 Thread Ralph Bolton
I've been bitten by this too. In my case I had this: - name: Create plain FTP groups group: name={{ item.user }} gid={{ item.uid }} state={{ item.state|default('present') }} with_items: "{{ customer_ftp_accounts[inventory_hostname] }}" when: inventory_hostname in customer_ftp_account I got

[ansible-project] Re: Need help with a jinja2 filter

2017-03-12 Thread Kenton Brede
Actually "sg_facts | json_query('instances[*].groups[*])" spits out: TASK [debug] *** ok: [localhost] => (item={u'id': u'sg-828889fe', u'name': u'Default / EC2 / Linux Ansible Clients'}) => { "": "VARIABLE IS NOT DEFINED!", "i

[ansible-project] Re: Need help for ternary operator in ansible

2020-06-24 Thread BIJAY PARIDA
Try escaping the % character. Thanks Bijay On Wednesday, 24 June 2020 12:41:56 UTC+5:30, Rahul Kumar wrote: > > Hi Ansible Gurus , > i have below task : > - name: RPM EPOCH Finder > #command: rpm -qa --qf '%|EPOCH?{%{EPOCH}}:{0}|\n' {{ > item.split('.')[0] | regex_replace('-\d+', '')}} >

[ansible-project] Re: Need help with Loop and Stat playbook

2020-12-17 Thread Roberto Paz
Maybe some of the files are missing in the target. If that's the case, there is no "stat" for that file. Maybe you should add "audit_tools.stat is defined and audit_tools.stat.mode != '0755'" El miércoles, 16 de diciembre de 2020 a la(s) 17:09:12 UTC-6, thuan...@gmail.com escribió: > Hi all, >

Re: [ansible-project] Re: need help to configure a loop

2021-06-28 Thread Yahia CHILALI
Thx David, Ansible is very new for me... :) I didn't see block stuff. I'm going to try! Le lun. 28 juin 2021 à 12:56, david...@mycit.ie a écrit : > Hi, > > Have you tried using the Block function of Ansible? > > https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html > > https:/

Re: [ansible-project] Re: need help to configure a loop

2021-06-28 Thread Yahia CHILALI
Hi again, I can't feed the correct syntax... i tried with with_lines: cat /etc/ansible/group_vars/afyahia or loop: cat /etc/ansible/group_vars/afyahia Do you know the good attribute? ERROR! 'loop' is not a valid attribute for a Block ERROR! 'with_lines' is not a valid attribute for a Block Le lun.

Re: [ansible-project] Re: need help to configure a loop

2021-06-28 Thread Roberto J. R. Paz
You can't apply a loop to a block. A possible caveat for that is to include the code of the block as a separated playbook and run the loop on that. Example here: https://ericsysmin.com/2019/06/20/how-to-loop-blocks-of-code-in-ansible/ El lun, 28 jun 2021 a las 9:53, Yahia CHILALI () escribió: >

Re: [ansible-project] Re: Need help about Ansible block syntax

2018-02-19 Thread Brian Coca
'tasks' is a property of a play, it should ONLY appear at the play level -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansibl

[ansible-project] Re: Need help with Jetty restart using ansible

2015-12-01 Thread eric hanzl
I edited my ansible script to use async mode: # restart jetty - name: Restart jetty shell: sudo /sbin/service jetty restart when: service_status.stat.exists async: 300 poll: 0 Now i get the restart and jetty stays up! On Monday, November 30, 2015 at 5:13:34 PM UTC-5, eric hanzl wrote:

Re: [ansible-project] Re: Need help with Loop and Stat playbook

2020-12-17 Thread Stefan Hornburg (Racke)
On 12/17/20 5:05 PM, Roberto Paz wrote: > Maybe some of the files are missing in the target. If that's the case, there > is no "stat" for that file. > That's not true. If a file is missing you have stat.exists = false in the result. The problem here is that the stat task is called in a loop, w

Re: [ansible-project] Re: Need help with Loop and Stat playbook

2020-12-17 Thread Thuan
Hi all, So I made a slight chance, I added "failed_when: audit_tools.stat.mode != '0755'' below 'register' module and the error message went away. By the way, all files are exist. I changed two files chmod to 0640 for testing purpose. However, I still get the 'Passed' as a result when I ran the -

Re: [ansible-project] Re: Need help with Loop and Stat playbook

2020-12-17 Thread Thuan
Another issue, when all the files have proper permissions, then the playbook would give me the result as 'Failed.' This is the opposite of what I want. TASK [debug] *** ok: [localhost] => { "msg": "V-

[ansible-project] Re: Need help to run my first ansible playbook

2019-11-26 Thread Michael
It appears you may have wrongly mapped the attribute - commands beneath the ios_commands module in task "Run Show Command" see examples here and pay attention to indentation, the line "tasks" appears to be wron

[ansible-project] Re: Need help to run my first ansible playbook

2019-11-26 Thread 'Richard' via Ansible Project
Thanks for your help Michael. The playbook is working now but ran into a another error PLAY [Run Show Command] TASK [run show command] fatal: [all]:

[ansible-project] Re: Need help on building ansible inventory file properly

2019-12-31 Thread 'J Hawkesworth' via Ansible Project
I suggest using a directory that contains the files you need to build up your inventory. You can also use symlinks I think This is described in the documentation in the section starting '*Aggregating inventory sources with a directory' *here: https://docs.ansible.com/ansible/latest/user_guide/in

[ansible-project] Re: Need help on building ansible inventory file properly

2019-12-31 Thread Yehuda Pinhas
Hi J Hawkesworth, Can you explain exactly in which file do I need to add what code? Considering I have the inventories POC_ENV.yml, avaya.yml, nexus.yml for example. What file do I need to edit? the ansible.cfg and the inventory file? can you provide the exact solution? currently my ansible.cfg

[ansible-project] Re: Need help on building ansible inventory file properly

2019-12-31 Thread 'J Hawkesworth' via Ansible Project
I suggest doing this: mkdir /etc/ansible/inventory # copy POC_ENV.yml, avaya.yml, nexus.yml to /etc/ansible/inventory changing your ansible.cfg so that it looks for inventory in /etc/ansible/inventory IIRC that will load all the inventory files in that directory I have not tried this using .ya

[ansible-project] Re: Need help on building ansible inventory file properly

2019-12-31 Thread Yehuda Pinhas
Hi Hawkesworth, I have followed your instruction and it's working so my inventories are now working like I wanted. My end goal is to run show_vlan.yml role on the requested inventory but im getting syntax problem on my include_role module. (ansible now fetching the right hosts from the right inve

[ansible-project] Re: Need help on building ansible inventory file properly

2019-12-31 Thread Yehuda Pinhas
Hi Hawkesworth, I have followed your instruction and it's working so my inventories are now working like I wanted. My end goal is to run show_vlan.yml role on the requested inventory but im getting syntax problem on my include_role module. (ansible now fetching the right hosts from the right inve

[ansible-project] Re: Need help on building ansible inventory file properly

2019-12-31 Thread Yehuda Pinhas
*Hi,* *I have followed the instruction and it's working so my inventories are now working like I wanted. My end goal is to ssh to the specified machine in POC_ENV inventory (TEST-AGG-SW) and run the command "show vlan brief" and return it to stdout.* *For some reason it is not working and im not

[ansible-project] Re: Need help on building ansible inventory file properly

2019-12-31 Thread 'J Hawkesworth' via Ansible Project
Hi I can see a couple of things that might need changing to get this to work: Try changing your playbook so it looks like this: --- - name: Playing VLAN Configuration hosts: POC_ENV connection: local vars: vlan_id: 999 vlan_name: TEST_VLAN_TEST tasks: - include_role:

[ansible-project] Re: Need help on building ansible inventory file properly

2020-01-01 Thread Yehuda Pinhas
Hi, I have followed your instructions and its working perfectly. Just one logistic problem left, I am getting the output in a not human friendly output, which is not clear and I cant understand anything from it. Look: [image: Ansible add vlans errors.PNG] I'm expecting to get the output this w

[ansible-project] Re: Need help on building ansible inventory file properly

2020-01-02 Thread Yehuda Pinhas
Hi Jon, Thank you so much, it's working now. Also, much thanks Vladimir for his assistance. Take care. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansib

[ansible-project] Re: Need help on building ansible inventory file properly

2020-01-02 Thread Yehuda Pinhas
Last question. How can I do that correctly? --- - name: Playing VLAN Configuration hosts: POC_ENV connection: local vars: vlan_id: 999 vlan_name: TEST_VLAN_TEST tasks: - include_role: name: vlan_creation tasks_from: show_vlan.yml tasks_from

[ansible-project] Re: Need Help for REST API integration with Ansible

2019-07-30 Thread Rahul Kumar
Any experts view on this ? On Tue, 23 Jul 2019 at 18:08, Rahul Kumar wrote: > There is URI module present in Ansible which lets you invoke REST End > Points and it works preety well. > Currently i have lot of JSON Objects and corresponding REST end points > ofcourse for each. > Is it a good prac

[ansible-project] Re: Need Help for REST API integration with Ansible

2019-07-30 Thread Abhijeet Kasurde
On Tuesday, July 23, 2019 at 6:09:06 PM UTC+5:30, Rahul Kumar wrote: > > There is URI module present in Ansible which lets you invoke REST End > Points and it works preety well. > Currently i have lot of JSON Objects and corresponding REST end points > ofcourse for each. > Is it a good practice

[ansible-project] Re: Need help with win_package [msi file with TRANSFORMS]

2018-08-08 Thread 'J Hawkesworth' via Ansible Project
Try putting all the arguments on one line perhaps? I don't think 'arguments' takes a list, just a string: *- name: win_package: path: C:\tmp\The msi package.msi arguments: /passive TRANSFORMS='"Group Policy Deployment.mst"' state: present* MSIs seem to have different command

[ansible-project] Re: Need help with win_package [msi file with TRANSFORMS]

2018-08-30 Thread Julien
Hi Jon and thank's for the reply, I've tried to put all arguments in one line, but i have the same result, my playbook stay stuck : The thing that i don't understand is the command with the same command (*msiexec /i The msi package.msi /passive **TRANSFORMS='"Group Policy Deployment.mst"'*)

[ansible-project] Re: Need help with win_package [msi file with TRANSFORMS]

2018-08-30 Thread Julien
Missed the " " on the command, here it is : *msiexec /i "C:\tmp\The msi package.msi" /passive **TRANSFORMS='"Group Policy Deployment.mst"'* Le jeudi 30 août 2018 14:41:11 UTC+2, Julien a écrit : > > Hi Jon and thank's for the reply, > > I've tried to put all arguments in one line, but i have the

[ansible-project] Re: Need help with win_package [msi file with TRANSFORMS]

2018-09-04 Thread 'J Hawkesworth' via Ansible Project
There's lots of ways msi installations can fail. You can debug it a bit by passing the logging output switches in the arguments and then reviewing the logging from msi. I would probably take a pragmatic approach and use `win_shell` to run msiexec, perhaps with the `creates` option to stop it fr

[ansible-project] Re: need help in passing external variables using vars_prompt

2023-02-20 Thread Todd Lewis
You're getting your "target" variable from vars_prompt just fine. It's a 'unicode object' (i.e. a string), so you can't use its non-existent 'ms' attribute. If you really want to pull in the "target" host interactively, the easiest fix is to restructure your "lparlist.yml" file like this: --- l

[ansible-project] Re: need help in passing external variables using vars_prompt

2023-02-20 Thread Todd Lewis
Another solution is to use the "vars" lookup with your vars_prompt for "target" as you showed them above. - name: Start a logical partition. powervm_lpar_instance: hmc_host: "{{ lookup('vars',target).hmc }}" hmc_auth: "{{ curr_hmc_auth }}" system_name: "{{ lookup

[ansible-project] Re: need help with if condition in jinja template

2023-02-26 Thread Todd Lewis
I tried running your code on my local machine. Of course I don't have "mksysb" so I had to substitute things I've got, but your logic with respect to "failed_when:" and "hostvars[host]['mksys']['msg']" appears to be okay. The only thing that stuck out to me is that you have some leading tabs in

[ansible-project] Re: need help with if condition in jinja template

2023-02-26 Thread Kenady Inampudi
Hi Todd, my original playbook works just fine, the problem is with the second one where i want the report just for the failed ones, my first play book give me all the output due to special variable {% for host in ansible_play_hosts_all %} I tried to use if condition to filter the result of the

[ansible-project] Re: need help with if condition in jinja template

2023-02-27 Thread Todd Lewis
I understand the problem. Thanks for restating it concisely. Your template *is* creating /home/user1/mksysb_error_report.out, but not on localhost. It's creating it on each of the target hosts. It's doing *that* because of the leading tabs I asked you about earlier. There's one in front of your

[ansible-project] Re: Need help with executing a python script automation

2023-06-20 Thread Prady A
I found one solution to with delegate_to option to run on the task on particular server. Regards On Wed, Jun 21, 2023 at 10:23, Prady A wrote: > Hi all > > I want to execute a python script which is available in control node. And > the python script uses the ansible_hostname variable and update

[ansible-project] Re: Need help in setting ansible for sonicwall backups

2024-04-17 Thread dbs34
Hello! I can offer some advice. In my findings, often there are no vendor canned, provided modules so you have to use the netcommon.cli module which works just as well. I have successfully deployed playbooks for cisco ios, cisco asa, dell, wlcs and nxos. Here is one playbook I use for my asa

[ansible-project] Re: Need help on Dynamic Inventory (AWS) with Ansible

2016-04-18 Thread MrVegas
also all of this is being done on an AWS ec2 amazon linux instance so AWS shouldn't be down -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+u

Re: [ansible-project] Re: Need Help for REST API integration with Ansible

2019-09-04 Thread Rahul Kumar
I think purpose of httpapi plugin is different. Here I have my own API (say built in JAX-RS or Spring Boot), and list of REST ends points are of order (10-100) where each Resource have multiple parameters to deal with. In that context , is it good to make each param configurable using ansible? On

Re: [ansible-project] Re: Need help to run my first ansible playbook

2019-11-27 Thread Stefan Hornburg (Racke)
On 11/27/19 5:29 AM, 'Richard' via Ansible Project wrote: > Thanks for your help Michael. > The playbook is working now but ran into a another error > > PLAY [Run Show Command] > > > TASK [run show command] > *

Re: [ansible-project] Re: Need Help for REST API integration with Ansible

2019-07-30 Thread Andrew Feller
You really should consider developing a plugin for this rather than twisting YAML to make it happen. Check out https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html for writing this in Python in a way that’s callable from Ansible Sent from my iPhone > On Jul 30, 2019, at 5

Re: [ansible-project] Re: Need Help for REST API integration with Ansible

2019-07-30 Thread Rahul Kumar
Thanks Andrew , but is it good to make each and every parameter of Rest api response as configurable using Ansible , considering we have huge parameters? On Tue, 30 Jul 2019 at 3:19 PM, Andrew Feller wrote: > You really should consider developing a plugin for this rather than > twisting YAML to

Re: [ansible-project] Re: Need Help for REST API integration with Ansible

2019-07-30 Thread Mark Anthony Garcia
It is best to use jinja template to create the bosy file and call it for scalability. This is what I do using data from mssql query. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails f

Re: [ansible-project] Re: Need Help for REST API integration with Ansible

2019-07-30 Thread Rahul Kumar
Thanks abhijeet . - https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/httpapi - What this plugin does , any usage , as i dont see any readme file also? or i need to look at its code? Regards Rahul On Tue, 30 Jul 2019 at 15:42, Abhijeet Kasurde wrote: > > > On Tuesday, July 23

Re: [ansible-project] Re: need help with if condition in jinja template

2023-02-26 Thread Vladimir Botka
On Sun, 26 Feb 2023 18:11:02 -0800 (PST) Kenady Inampudi wrote: > {% for host in ansible_play_hosts_all %} > {% if 'Completed Successfully' not in hostvars[host]['mksys']['msg'] %} > > This condition generates nothing. Your code works as expected. For testing, put the variable into the invent

[ansible-project] Re: Need help organizing tasks/playbooks for multiple operating systems

2014-05-01 Thread Adam Morris
On Thursday, May 1, 2014 10:12:58 AM UTC-7, Snyder, Chris wrote: > > I’m stuck. I’m sure this can all be done a better way, but right now, > I’m just not seeing it. Can anyone offer suggestions of what else to try > here? > I'm sure that there are many better ways... First, you can detect y

[ansible-project] Re: Need help with a static inventory of dynamic groups

2016-06-23 Thread pporada
Why is it not possible to perform complex pattern matching in the inventory? How do other companies handle this? -- *The information contained in this transmission (including any attachments) is confidential and may be privileged. It is intended only for the use of the individual or entity nam

[ansible-project] Re: Need help with logical steps--Disabling NetworkManager and enabling networking

2017-10-30 Thread John Harmon
The only way I get this to work is with a cmd: cmd: service NetworkManager stop; sleep 3; service network start On Monday, October 30, 2017 at 9:04:53 AM UTC-6, John Harmon wrote: > > I need to disable and remove NetworkManager, and enable and start > networking. My current configuration will l

Re: [ansible-project] Re: Need help organizing tasks/playbooks for multiple operating systems

2014-05-01 Thread Michael DeHaan
I think this comes from some sort of OCD and you may wish to give this up :) State what should be on the machines, not what should not. It would be impossible to define all the things a server could not be. On Thu, May 1, 2014 at 1:59 PM, Adam Morris wrote: > > > On Thursday, May 1, 2014 10

Re: [ansible-project] Re: Need help organizing tasks/playbooks for multiple operating systems

2014-05-01 Thread Brian Coca
If you really really need to ensure that software wasn't installed by mistake, keep package list dumps and compare to that, much more efficient than doing it package by package.​ -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

Re: [ansible-project] Re: Need help organizing tasks/playbooks for multiple operating systems

2014-05-01 Thread Adam Morris
I have to say that I agree. I was trying to show a better general solution but in my case I use an initial os load that puts the absolute minimum on the server. Then I add to it with ansible. On May 1, 2014 3:01 PM, "Brian Coca" wrote: > If you really really need to ensure that software wasn't

RE: [ansible-project] Re: Need help organizing tasks/playbooks for multiple operating systems

2014-05-06 Thread Snyder, Chris
Re: [ansible-project] Re: Need help organizing tasks/playbooks for multiple operating systems I think this comes from some sort of OCD and you may wish to give this up :) State what should be on the machines, not what should not. It would be impossible to define all the things a server could not b

Re: [ansible-project] Re: Need help organizing tasks/playbooks for multiple operating systems

2014-05-06 Thread Michael DeHaan
l. > > Chris. > > > > > > *From:* ansible-project@googlegroups.com [ > mailto:ansible-project@googlegroups.com ] > *On Behalf Of *Michael DeHaan > *Sent:* Thursday, May 01, 2014 5:31 PM > *To:* ansible-project@googlegroups.com > *Subject:* Re: [ansible-project] Re: N

[ansible-project] Re: need help for XML to JSON Parsing Error with Ansible using Parse_xml

2022-07-07 Thread maulik patel
anyone here to help me out with this please ? thanks... On Thursday, July 7, 2022 at 6:57:27 PM UTC+5:30 maulik patel wrote: > hi , > > I was trying to parse a XML response to JSON using parse_xml from an AWS > VPN output, but I'm getting the below error. > I am able to parse data with > *"vpn_

[ansible-project] Re: Need help using URI module for a curl command with json body

2019-12-04 Thread Nick Schendel
Have you tried the body section with the the curly braces? Like so: body: "id": "{{ customer_id }}", "name": "{{ customer_name }}", "disabledFeatures": ["visualize","dev_tools","advancedSettings","indexPatterns","savedObjectsManagement","timelion","gr

[ansible-project] Re: Need help using URI module for a curl command with json body

2019-12-04 Thread Robert Heppe
Thanks Nick, I have not. I just tried this but get another error for the , at the end of the line. So I removed them and it errors again. body: "id": "{{ customer_id }}" "name": "{{ customer_name }}" "disabledFeatures": ["visualize","dev_t

[ansible-project] Re: Need help using URI module for a curl command with json body

2019-12-11 Thread Nick Schendel
Sorry for the delay, I meant to grab the example when I got back to my desk and lost track of it. Here is an example I am using currently that works - name: restore disk from snapshot uri: url: https://{{ cluser_ip }}/api/internal/vmware/vm/snapshot/ {{snapshotlist.json.data[0].id}}/

[ansible-project] Re: need help to install Visual studio code on linux machine through Ansible

2018-04-12 Thread Varun Chopra
Your question is more suited for https://github.com/mhalano/ansible-role-visual-studio-code/issues On Wednesday, April 11, 2018 at 4:23:22 PM UTC+5:30, Vishal Mane wrote: > > I took a role to install vs code from github. now trying to run the role, > it gets executes successfully, but vs code do

Re: [ansible-project] Re: need help for XML to JSON Parsing Error with Ansible using Parse_xml

2022-07-08 Thread Dick Visser
Perhaps, if you provide a clean piece of xml. On Fri, 8 Jul 2022 at 08:37, maulik patel wrote: > anyone here to help me out with this please ? thanks... > > On Thursday, July 7, 2022 at 6:57:27 PM UTC+5:30 maulik patel wrote: > >> hi , >> >> I was trying to parse a XML response to JSON using pa

Re: [ansible-project] Re: need help for XML to JSON Parsing Error with Ansible using Parse_xml

2022-07-10 Thread maulik patel
*i'm getting below error * *fatal: [localhost]: FAILED! => {"msg": "unable to locate parse_xml template: spec"}* *here is the xml data :* cgw-0d4ee490353c847a6 vgw-02843421cc2ba3987 ipsec.1 NoBGPVPNConnection 131.226.223.241

Re: [ansible-project] Re: Need help using URI module for a curl command with json body

2019-12-04 Thread Bram Mertens
Hi, Perhaps it is only a problem in your example but in the example you appear to use an IP address for by a port. (x.x.x.x:5601) but in the playbook you seem to use a hostname. Could it be a name resolution issue? Does it work if you hardcode the exact same URL in the playbook? Another thing I

Re: [ansible-project] Re: Need help using URI module for a curl command with json body

2019-12-05 Thread Robert Heppe
Hi Bram, Yes, I just removed the IP for the post. I think connectivity should be fine as I can telnet to the hostname from the ansible system. [centos@jumphost ~]$ telnet us1-ki01 5601 Trying x.x.101.185... Connected to us1-ki01. Escape character is '^]'. ^] I wonder if I have the double heade

Re: [ansible-project] Re: Need help using URI module for a curl command with json body

2019-12-06 Thread Nick Schendel
Sure, I will grab my entire example task in just a bit here. Happy to share if it might help. On Thu, Dec 5, 2019, 12:23 PM Robert Heppe wrote: > Hi Bram, > Yes, I just removed the IP for the post. I think connectivity should be > fine as I can telnet to the hostname from the ansible system. >

[ansible-project] Re: need help in checking if a variable string is in an item string

2016-06-14 Thread Jerome Yanga
I apologize. I forgot to provide the following. ansible version: 2.0.2.0 event: skipping: [server1] => (item={u'host_aliases': u'ca-srv-01.example.com ca-srv-01', u'ip_addr': u

[ansible-project] Re: need help in checking if a variable string is in an item string

2016-06-14 Thread Jerome Yanga
I apologize for not providing the info below. version: 2.0.2.0 event: skipping: [ca-server1] => (item={u'host_aliases': u'ca-srv-01.example.com ca-srv-01', u'ip_addr': u'10.1.1.1', u'srv_loc': u'ca'}) => {"changed": false, "item": {"host_aliases": "ca-srv-01.example.com ca-srv-01", "ip_addr"

[ansible-project] Re: Need help creating an Azure service principal for ansible. Redirect URI for ansible ?

2017-03-01 Thread juchausse
Hi there, Did you get any update about the information you are looking for ? Cheers Julien On Thursday, 22 December 2016 18:26:30 UTC+1, Prasanna Dhandapani wrote: > > Hello, I'm new to Ansible and I'm running into an issue with getting the > "azure_rm_storageaccount" module in ansible to work.

[ansible-project] Re: Need help with how to grab public ip and use it for later part in playbook

2019-03-21 Thread tinkuchowdary32
Thank you sebastian for quick reply unfortunately that didn't work here the part that i am running - name: "gather instance facts" ec2_instance_facts: instance_ids: i-xx region: "{{ region }}" delegate_to: localhost when: ec2_instance_prov == 'no' register: ec2

[ansible-project] Re: Need help with how to grab public ip and use it for later part in playbook

2019-03-26 Thread tinkuchowdary32
Hello Sebastian Thank you for the help i was able to get it working i have another problem how can i get only the arn value but not complete output saved in to variable in the below example TASK [debug] *

[ansible-project] Re: need help getting started using Ansible conditionals with regards to the absence/presence of Docker containers

2015-03-14 Thread Ash Wilson
Hi Ken, I don't think it's possible right now to remove *all* containers in one go. If you do have a name, and you're using the 1.9 prerelease, you should able to run: - name: stop and remove the container "thename" docker: state: absent name: thename image: ignored You can also

[ansible-project] Re: Need help with nested variables to use in a "when:" directive inside of a role playbook

2016-02-03 Thread Igor Cicimov
Try this: - name: Ensure user directory exists file: path=/opt/{{ item.item }} state=directory owner={{ item.item }} group={{ item.item }} mode=0755 with_items: passinfo.results not tested though. On Wednesday, February 3, 2016 at 7:48:21 A

Re: [ansible-project] Re: Need help with how to grab public ip and use it for later part in playbook

2019-03-22 Thread Sebastian Meyer
Hi, in this case verify that - debug: var: ec2 works first. Then try: - debug: var: ec2.instances Afterwards: - debug: var: ec2.instances.0 So basically you try to build the path to the value you want. If one fails, please post the output of the last succeeding debug. - Sebasti

Re: [ansible-project] Re: Need help with how to grab public ip and use it for later part in playbook

2019-03-27 Thread Dick Visser
On Wed, 27 Mar 2019 at 07:01, wrote: > > Hello Sebastian > > Thank you for the help i was able to get it working > > i have another problem how can i get only the arn value but not complete > output saved in to variable Please send a new message for that and don't pollute this thread for (judgin