[ansible-project] Re: Why playbook is not taking updated IP from the inventory on the fly

2017-12-20 Thread bablu
/{{certname}}' sudo: true On Wednesday, December 20, 2017 at 11:22:53 PM UTC+5:30, John Foley wrote: > > You probably need to show us child2.yml > > On Wednesday, December 20, 2017 at 8:05:30 AM UTC-5, bablu wrote: >> >> I have a situation where 1) updating IP

[ansible-project] Why playbook is not taking updated IP from the inventory on the fly

2017-12-20 Thread bablu
I have a situation where 1) updating IP in inventory through following shell and 2) using that IP it will perform some operation. However, child2.yml is not taking updated IP in inventory and still takes old IP. Moreover, once job is finished its showing updated IP in the inventory. How can

[ansible-project] AWS ELB IP grep and update the inventory for the respective domain

2017-12-18 Thread bablu
I am trying to grep the IP available on the AWS ELB (nodes attached to it) and then doing some operation on it. Now, the issue is how can I on the fly update the ansible inventory of the new available IP, so that next operation will read the IP from the inventory and will further execute the

[ansible-project] Abort executing playbook if condition not match

2017-02-14 Thread bablu
If condition fails it should not go for the next step and exit from there only. In following situation, when: C != test_valit should exit from here only instead of going to the next step. How can i achieve this. - name: Set the output of the this state set_fact:

[ansible-project] store the output of math operator

2017-02-14 Thread bablu
- name: Set the output of the this state set_fact: A="{{image_avl.stdout}}" -- this is coming from the previous registered output tags: avl1 - name: Define our static value for the desired image number set_fact: B={{retain}} -- this is coming

[ansible-project] Re: Output Failed even if command gets executed successfully

2017-02-06 Thread bablu
Tried -e its giving the same output as with the -a Any example how to use failed_when in ad-hoc command. e.g i was trying below. How can i use failed_when here. /usr/bin/ansible node1 -a "grep 'value1' /tmp/test.log" On Monday, February 6, 2017 at 1:57:52 PM UTC+5:30, b

[ansible-project] Output Failed even if command gets executed successfully

2017-02-06 Thread bablu
How to ignore failed command or in case the result set has no output. I need the output should be success if it won't find anything relevant mentioned in the condition. /usr/bin/ansible node1 -a "grep 'value1' /tmp/test.log"Actually there in no value1 exists in test.log. However, i am

Re: [ansible-project] WHEN CONDITION

2017-01-30 Thread bablu
I did create the small task. However, for defining variable (num, numami) in the same task is not working. e.g tasks: - name: Condition statement shell: date_string=`date +%d%b%G`; num=3; numami=5; when: $numami > $num echo Hi; On Monday, January 30, 2017 at

[ansible-project] WHEN CONDITION

2017-01-30 Thread bablu
I want to use the following condition in ansible playbook. Scenario is as follows. If arg1 > 5 follow some steps else endif; IF ELSE is not possible in ansible. However, how can i achive with the WHEN condition. -- You received this message because

Re: [ansible-project] Command not working on remote host through shell module or playbook

2016-09-22 Thread bablu
Can some one help here. On Wednesday, September 21, 2016 at 10:14:16 PM UTC+5:30, bablu wrote: > > > That's working. > > But I guess here i have to hard code the command. Is there any way where i > can pass any command at the run time to execute on the remote host.

Re: [ansible-project] Command not working on remote host through shell module or playbook

2016-09-21 Thread bablu
That's working. But I guess here i have to hard code the command. Is there any way where i can pass any command at the run time to execute on the remote host. I saw the raw module and below are the behavior i got. working: /usr/bin/ansible test -m raw -a netstat -tanpu | /bin/awk '{print

Re: [ansible-project] pipeline (|) not working with the -e option

2016-09-16 Thread bablu
Tried with the shell module. It's working for the following scenario. However, not working for cluster where more than one server define in the inventory. working: ansible-playbook /etc/ansible/command_run.yml -e "ip=192.168.4.10" -e 'command="netstat -an | grep 8080"' Not working:

[ansible-project] Re: multiple when condition not working in playbook

2016-01-18 Thread bablu
solved. On Sunday, January 17, 2016 at 2:25:53 AM UTC+5:30, bablu wrote: > > Hi, > > Trying to write playbook with when conditional statement. > > However, it always choose last command (/home/user//bin/) to > execute even though condition matches with another domainna

[ansible-project] multiple when condition not working in playbook

2016-01-16 Thread bablu
Hi, Trying to write playbook with when conditional statement. However, it always choose last command (/home/user//bin/) to execute even though condition matches with another domainname. playbook.yml # command execution Ansible Playbooks - hosts: "{{domainname}}" remote_user: