[ansible-project] Re: ansible with elastic search with Jinja2 Template

2018-04-13 Thread Bishwajit Samanta
Thanks Larry for such great help.. i hope this solves my problem. !! :) On Saturday, April 14, 2018 at 10:25:50 AM UTC+5:30, Larry Smith wrote: > > You can use: > node.name: {{ansible_hostname}} > > Which will use the hostname defined on the remote host. > > Or you can use: >

[ansible-project] Re: Variables with quotes

2018-04-13 Thread Larry Smith
Try to use the Ansible rabbitmq_user module as this will be much easier to accomplish your needs. http://docs.ansible.com/ansible/latest/modules/rabbitmq_user_module.html On Friday, April 13, 2018 at 9:48:15 AM UTC-4, Shaun Lim wrote: > > Hi all, > > I'm new to Ansible and am trying to use some

[ansible-project] Re: ansible with elastic search with Jinja2 Template

2018-04-13 Thread Larry Smith
You can use: node.name: {{ansible_hostname}} Which will use the hostname defined on the remote host. Or you can use: node.name:{{inventory_hostname}} Which will use the inventory hostname defined in your Ansible inventory. For reference:

Re: [ansible-project] How to sort ansible output

2018-04-13 Thread Brian Coca
ansible -m script -a 'free.sh' |sort? you can also use --tree to save a file with the output of each server or you can just write your own callback to handle the output. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible

[ansible-project] include not working

2018-04-13 Thread Tcpip
Hi all I have the following playbook ! --- - hosts: lab

[ansible-project] Re: Getting two results with custom callbacks

2018-04-13 Thread tommcf64
Here is my my playbook. I am also running ansible version 2.4.2.0 --- - hosts: all tasks: - name: Run setup setup: # register: variables On Friday, April 13, 2018 at 11:39:58 AM UTC-4, tommcf64 wrote: > > Hi, > I am attempting to use the Ansible API to run and playbook and

[ansible-project] Re: ansible with elastic search with Jinja2 Template

2018-04-13 Thread Bishwajit Samanta
Can anyone help me in my problem please ? On Friday, April 13, 2018 at 8:21:31 PM UTC+5:30, Bishwajit Samanta wrote: > > > > Hi, my question is :: > > > My ansible script will be running for multiple systems. But in > elasticsearch.jinja2 how can i change the

Re: [ansible-project] Re: Ansible Playbook running for longtime/indefinitely for windows 2012 R2 Ansible Playbook

2018-04-13 Thread Namasivayam C
Hi We have rebooted the Ansible server issues got fixed On Thu 12 Apr, 2018, 8:31 PM Ramanjaneyulu S, wrote: > I have the same issue while using win_packageto install applications on > remote windows servers. in the log ansible is giving status code 200 thrice > and then

[ansible-project] Re: Proper handling of host specific credential files

2018-04-13 Thread Jean Helou
in a classical case of rubber duck debbuging, I found a possible answer seconds after posting my message - name: "Install client openvpn credentials" copy: src: "{{ inventory_dir+'/host_vars/'+inventory_hostname+'/openvpn.'+ item }}" dest: "/etc/openvpn/{{ hostname }}.{{ item }}"

[ansible-project] Getting two results with custom callbacks

2018-04-13 Thread tommcf64
Hi, I am attempting to use the Ansible API to run and playbook and insert the facts into a mongodb database but I am getting two documents for each machine. I am a newbie and unfamiliar with the API. Can anyone shed my insight into why my code creates two outputs, I would greatly appreciate

[ansible-project] Using subversion via http?

2018-04-13 Thread Michael Renner
Moin, a simple playbook won't work: - name: svn checkout subversion: repo: http://svn-01.int.de/operation/foobar dest: /tmp/checkout delegate_to: localhost but it fail: TASK [svn checkout]

Re: [ansible-project] Re: List of running processes form multiple linux hosts using with_items

2018-04-13 Thread Kai Stian Olstad
On Friday, 13 April 2018 10.11.21 CEST smitconsultant2...@gmail.com wrote: > Thanks. It is creating file for each hostname but data is not in readable > format. Are you able to do favor little more, how to get the data in each > file as orignal form like as processes list show on linux machine?

Re: [ansible-project] Re: vsphere wait for vm powered off

2018-04-13 Thread Kai Stian Olstad
On Friday, 13 April 2018 09.14.36 CEST Zeljko Dokman wrote: > Do you know is it possible to list all undocumented parameters of a module > and its states? I don't think there are any undocumented parameters so in that regard the module documentation is very good. But the output they generate is

Re: [ansible-project] Cannot create user [solved]

2018-04-13 Thread Werner Flamme
Werner Flamme [13.04.2018 16:30]: > Werner Flamme [13.04.2018 16:18]: >> Hi, >> >> can someone please show me what's wrong? >> >> - name: create one single user >> user: >> user: "someguy" >> password: "something secret here" >> group: "users" >> state: "present" >> >> does not

Re: [ansible-project] Re: unable to fit the piece of code in ansible

2018-04-13 Thread Bishwajit Samanta
Ansible:: 2.4 is the version i am using. On Friday, April 13, 2018 at 11:40:02 AM UTC+5:30, Biswadip Dutta wrote: > > Can you please let me know which Ansible version you are using and what > error you are getting? > > Regards, > Biswadip Dutta > > On Thu, Apr 12, 2018 at 7:16 PM, Bishwajit

[ansible-project] ansible with elastic search with Jinja2 Template

2018-04-13 Thread Bishwajit Samanta
Hi, my question is :: My ansible script will be running for multiple systems. But in elasticsearch.jinja2 how can i change the value of node.name for different systems. Jinja 2 Code::- --- # -- Cluster

Re: [ansible-project] Cannot create user

2018-04-13 Thread Werner Flamme
Werner Flamme [13.04.2018 16:18]: > Hi, > > can someone please show me what's wrong? > > - name: create one single user > user: > user: "someguy" > password: "something secret here" > group: "users" > state: "present" > > does not create a user, but invokes usermod instead of

[ansible-project] Cannot create user

2018-04-13 Thread Werner Flamme
Hi, can someone please show me what's wrong? - name: create one single user user: user: "someguy" password: "something secret here" group: "users" state: "present" does not create a user, but invokes usermod instead of useradd. Of course, I get a message telling me that the

[ansible-project] Variables with quotes

2018-04-13 Thread Shaun Lim
Hi all, I'm new to Ansible and am trying to use some variables with quotes. The command I'm trying to run is as follows: rabbitmqctl set_permissions -p /vhost username ".*" ".*" ".*" To do this, I'm trying to use the command module. If I include the command exactly as above, the command runs

[ansible-project] Re: Ansible : get running config from aruba switches

2018-04-13 Thread Martial CHAVIGNY
Log in ansible : 2018-04-13 15:26:16,799 p=4956 u=mchavigny | ansible 2.5.0 (stable-2.5 955ef020ef) last updated 2018/04/12 16:44:14 (GMT +200) config file = /opt/ansible/ansible.cfg configured module search path = [u'/opt/ansible/library'] ansible python module location =

[ansible-project] Re: Ansible : get running config from aruba switches

2018-04-13 Thread Martial CHAVIGNY
Log in /var/log/ansible : 2018-04-13 15:22:22,108 p=2296 u=mchavigny | ansible 2.5.0 (stable-2.5 > 955ef020ef) last updated 2018/04/12 16:44:14 (GMT +200) > config file = /opt/ansible/ansible.cfg > configured module search path = [u'/opt/ansible/library'] > ansible python module location

[ansible-project] Jinja Format CSV and HTML From Yaml

2018-04-13 Thread Magnus Torstein
Within a play, one of the tasks is to generate a yaml file (using the ansible-inventory command to take a "snapshot" of a subset of the current inventory). From that yaml file, I want to do two things - 1) Create a CSV file with values both from the yaml file and from other vars generated

[ansible-project] Ansible : get running config from aruba switches

2018-04-13 Thread Martial CHAVIGNY
Hello, I'm new user of ansible and for the first projet, I would to get current config of aruba (2930F) switches (for backup). I read these documentations : https://docs.ansible.com/ansible/devel/network/getting_started/first_playbook.html

Re: [ansible-project] Ternary filter vs conditional expressions

2018-04-13 Thread Rastislav Barlik
Thanks Brian, If people find the filter useful then that's fair enough. Everybody has a difference preference. I probably suffer from Python's "There should be one -- and preferably only one -- obvious way to do it." On Thu, Apr 12, 2018 at 9:25 PM, Brian Coca wrote: > Other

Re: [ansible-project] How to sort ansible output

2018-04-13 Thread Biswadip Dutta
Oh okay. I think I misunderstood your query. What I was suggesting is that you can write another script to sort the output based on your needs. I don't think Ansible has such functionality. If there's one then I will also like to know. Regards, Biswadip Dutta On Fri, Apr 13, 2018 at 12:30 PM,

[ansible-project] Re: List of running processes form multiple linux hosts using with_items

2018-04-13 Thread smitconsultant2017
HI Bishwajit Samanta Thanks. It is creating file for each hostname but data is not in readable format. Are you able to do favor little more, how to get the data in each file as orignal form like as processes list show on linux machine? I was initially thinking to get output from all hosts in

[ansible-project] Re: HP ILO set from ansible (no OS installed)

2018-04-13 Thread Dave H
It's a python library. Create a new virtualenv, activate it, install ansible and python-hpilo and you should be good to run your playbook virtualenv venv . venv/bin/activate pip install ansible python-hpilo ansible-playbook -i "localhost," -c local playbook.yml On Wednesday, 11 April 2018

Re: [ansible-project] Re: vsphere wait for vm powered off

2018-04-13 Thread Zeljko Dokman
Hi, thank you for your replay Do you know is it possible to list all undocumented parameters of a module and its states? Regards On Thursday, April 12, 2018 at 5:09:05 PM UTC+2, Kai Stian Olstad wrote: > > On 12.04.2018 14:11, Zeljko Dokman wrote: > > Hi, > > thank you for the info. > >

Re: [ansible-project] How to sort ansible output

2018-04-13 Thread The Wanderer
I know, but how? On Fri, Apr 13, 2018 at 11:49 AM, Biswadip Dutta wrote: > I'd suggest you do the sorting part later. I mean after you get the > Ansible results and then sort it. > > Regards, > Biswadip Dutta > > On Fri, Apr 13, 2018 at 1:12 AM, The Wanderer

Re: [ansible-project] Trying to create a new user and password for server login . SSH permission denied error.

2018-04-13 Thread Biswadip Dutta
This might be helpful for you Regards, Biswadip Dutta On Fri, Apr 13, 2018 at 2:38 AM, POOJA VENKATESH < poojavenkateshre...@gmail.com> wrote: > Hi, > > > I am trying to create a new user and password

Re: [ansible-project] How to sort ansible output

2018-04-13 Thread Biswadip Dutta
I'd suggest you do the sorting part later. I mean after you get the Ansible results and then sort it. Regards, Biswadip Dutta On Fri, Apr 13, 2018 at 1:12 AM, The Wanderer wrote: > Hi all, > > I have a couple of servers that are managed via ansible. On all of them, I

Re: [ansible-project] Re: unable to fit the piece of code in ansible

2018-04-13 Thread Biswadip Dutta
Can you please let me know which Ansible version you are using and what error you are getting? Regards, Biswadip Dutta On Thu, Apr 12, 2018 at 7:16 PM, Bishwajit Samanta < bishwajitsamanta1...@gmail.com> wrote: > Thanks Karl, for your reply. Problem statement ::- > > My job is to find out the