[ansible-project] Sprints during PyCon US 2019

2019-05-01 Thread Samuel Doran
We will be hosting Ansible sprints during PyCon US 2019 in Cleveland, OH May 
6-7. Sprints are free to attend for anyone, even if you are not attending the 
conference itself. We would love to see you there if you are attending PyCon or 
are in the Cleveland area. Several Ansible Core team members will be there to 
work with you on issues or help you get started contributing to Ansible. We 
hope to see you there!

---

Respectfully,

Sam Doran

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/39808841-9057-480F-9CA3-335BB60D4936%40redhat.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Replacing the existing Jar files with new Jar files with same file name is not performing any action

2019-05-01 Thread chandrasekhar Mallishetty
Thanks for info...

On Thu, May 2, 2019 at 7:34 AM James Cassell 
wrote:

> Please stop the spam. Your message came thru the first time.  Also, please
> don't spam individual members of the list with the same question you sent
> to the list.
>
> Thanks.
>
>
> R,
> James Cassell
>
>
> On Wed, May 1, 2019, at 9:33 PM, chandrasekhar Mallishetty wrote:
> >
> >
> > On Thursday, May 2, 2019 at 1:52:26 AM UTC+5:30, chandrasekhar
> Mallishetty
> > wrote:
> > >
> > > Dear All.
> > >
> > > Need your help we are in the process of Automating the cognos
> analytics
> > > servers from Linux env with ansible code .
> > >
> > > Requirement : we have two Jar files named  local_policy.jar
> > > and US_export_policy.jar in our current installation directory
> > > ../ibm/jre/lib/security/ and we need to replace the new
> local_policy.jar
> > > and US_export_policy.jar and we are writing the code as below .
> > >
> > > Ansible code:
> > >
> > >
> > >   - name: Put Oracle drivers in cognos directory
> > > get_url: >
> > >   url={{ artifactory_url
> > >
> }}/libs-ibm-lic-local/com/oracle/ojdbc7/12.1.0.2.0/ojdbc7-12.1.0.2.0.jar
> > >   dest={{ cognos_dir }}/drivers/ojdbc7-12.1.0.2.0.jar
> > >   owner='{{ cognos_user }}'
> > >   group='{{ cognos_group }}'
> > >   mode=0755
> > > become: yes
> > >
> > >   - name: Put US export policy file in cognos directory
> > > get_url: >
> > >  url={{ artifactory_url
> > >
> }}/libs-ibm-local/com/ibm/jce/US_export_policy/2013-02-27/US_export_policy-2013-02-27.jar
> > >  dest={{ cognos_dir }}/jre/lib/security/US_export_policy.jar
> > >  owner='{{ cognos_user }}'
> > >  group='{{ cognos_group }}'
> > >  mode=0755
> > > become: yes
> > >
> > >
> > > The above code is not taking any code or copying the new policy files
> > > since the  { cognos_dir }}/jre/lib/security/ has that files and if we
> > > change the name to US_export_policy_1.jar we can see the file new file
> > > US_export_policy_1.jar
> > >
> > > we modified the above code by adding force:Yes not sure if this works
> or
> > > not
> > >
> > > name: Put local policy file in cognos directory
> > > get_url: >
> > >  url={{ artifactory_url
> > >
> }}/libs-ibm-local/com/ibm/jce/local_policy/2013-02-27/local_policy-2013-02-27.jar
> > >  dest={{ cognos_dir }}/jre/lib/security/local_policy.jar
> > >  owner='{{ cognos_user }}'
> > >  group='{{ cognos_group }}'
> > >  mode=0755
> > >  force: yes
> > > become: yes
> > >
> > > Can any one suggest an exact approch to move furture
> > >
> > > Thanks
> > > M.chandra
> > >
> > >
> > >
> > >
> > >
> >
> > --
> > 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+unsubscr...@googlegroups.com.
> > To post to this group, send email to ansible-project@googlegroups.com.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/1278b89a-c60f-4fcd-9917-87a843d420a2%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1556762687.1833972.1669113152.575BBA83%40webmail.messagingengine.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BBDj747F%3DTOUA_ntmeN_rJjqy1NieViF9kq%2B_MS_d-x4pKjiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] print free space for mount

2019-05-01 Thread Nicholas Britton
I am trying to print the free space for a mount that an application needs 
to have x free on.   Once i can do that i would look at adding actions 
based on that, but i would also like to the user running the play to know 
if there is an issue or not.   

Here is what i have so far, and i cant see to get what i would expect, any 
thoughts:

code:

---
- hosts: all

  tasks:
- debug:
msg: "Mount Point {{item.mount}} free space 
{{item.size_available/1073741824}} "
  loop: "{{ansible_mounts}}"
  when: item.mount == '/home'


output:
PLAY [all] 
**

TASK [Gathering Facts] 
**
ok: [server]

TASK [debug] 

skipping: [server] => (item={u'block_used': 3056865, u'uuid': 
u'bf9d7ab9-4be3-419d-8aed-f3b952b75957', u'size_total': 84408975360, 
u'block_total': 20607660, u'mount': u'/', u'block_available': 17550795, 
u'size_available': 71888056320, u'fstype': u'ext4', u'inode_total': 
5242880, u'inode_available': 5165347, u'device': 
u'/dev/mapper/VolGroup-lv_root', u'inode_used': 77533, u'block_size': 4096, 
u'options': u'rw'})
skipping: [server] => (item={u'block_used': 109536, u'uuid': 
u'11dcc8c1-6895-4cc5-b6f3-6d83767021ac', u'size_total': 499355648, 
u'block_total': 487652, u'mount': u'/boot', u'block_available': 378116, 
u'size_available': 387190784, u'fstype': u'ext4', u'inode_total': 128016, 
u'inode_available': 127971, u'device': u'/dev/sda1', u'inode_used': 45, 
u'block_size': 1024, u'options': u'rw'})

ok: [server] => (item={u'block_used': 3071894, u'uuid': 
u'c6c79efc-1ada-4714-9d32-80a6cd896605', u'size_total': 105558474752, 
u'block_total': 25771112, u'mount': u'/home', u'block_available': 22699218, 
u'size_available': 92975996928, u'fstype': u'ext4', u'inode_total': 
6540800, u'inode_available': 6382890, u'device': 
u'/dev/mapper/VolGroup-lv_home', u'inode_used': 157910, u'block_size': 
4096, u'options': u'rw'}) => {
"msg": "Mount Point /home free space 86.5906448364 "
}

What i really want to display and only display is : "Mount Point /home free 
space 86.5906448364 "

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/218947b2-b36c-4ba6-bff8-6e2d5230eae0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to use vars to work with to_datetime

2019-05-01 Thread dan
It's hard without the actual playbook, but I think you need to use 
'current.stdout' inserted of just 'current' in that last task.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ff4751c1-a67b-4a69-bad8-45496ad281c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Replacing the existing Jar files with new Jar files with same file name is not performing any action

2019-05-01 Thread James Cassell
Please stop the spam. Your message came thru the first time.  Also, please 
don't spam individual members of the list with the same question you sent to 
the list.

Thanks.


R,
James Cassell


On Wed, May 1, 2019, at 9:33 PM, chandrasekhar Mallishetty wrote:
> 
> 
> On Thursday, May 2, 2019 at 1:52:26 AM UTC+5:30, chandrasekhar Mallishetty 
> wrote:
> >
> > Dear All.
> >
> > Need your help we are in the process of Automating the cognos analytics 
> > servers from Linux env with ansible code .
> >
> > Requirement : we have two Jar files named  local_policy.jar 
> > and US_export_policy.jar in our current installation directory  
> > ../ibm/jre/lib/security/ and we need to replace the new local_policy.jar 
> > and US_export_policy.jar and we are writing the code as below .
> >
> > Ansible code: 
> >  
> >
> >   - name: Put Oracle drivers in cognos directory
> > get_url: >
> >   url={{ artifactory_url 
> > }}/libs-ibm-lic-local/com/oracle/ojdbc7/12.1.0.2.0/ojdbc7-12.1.0.2.0.jar
> >   dest={{ cognos_dir }}/drivers/ojdbc7-12.1.0.2.0.jar
> >   owner='{{ cognos_user }}'
> >   group='{{ cognos_group }}'
> >   mode=0755
> > become: yes
> >
> >   - name: Put US export policy file in cognos directory
> > get_url: >
> >  url={{ artifactory_url 
> > }}/libs-ibm-local/com/ibm/jce/US_export_policy/2013-02-27/US_export_policy-2013-02-27.jar
> >  dest={{ cognos_dir }}/jre/lib/security/US_export_policy.jar
> >  owner='{{ cognos_user }}'
> >  group='{{ cognos_group }}'
> >  mode=0755
> > become: yes
> >
> >
> > The above code is not taking any code or copying the new policy files  
> > since the  { cognos_dir }}/jre/lib/security/ has that files and if we 
> > change the name to US_export_policy_1.jar we can see the file new file 
> > US_export_policy_1.jar
> >
> > we modified the above code by adding force:Yes not sure if this works or 
> > not
> >
> > name: Put local policy file in cognos directory
> > get_url: >
> >  url={{ artifactory_url 
> > }}/libs-ibm-local/com/ibm/jce/local_policy/2013-02-27/local_policy-2013-02-27.jar
> >  dest={{ cognos_dir }}/jre/lib/security/local_policy.jar
> >  owner='{{ cognos_user }}'
> >  group='{{ cognos_group }}'
> >  mode=0755
> >  force: yes
> > become: yes
> >
> > Can any one suggest an exact approch to move furture 
> >
> > Thanks
> > M.chandra
> >
> >
> >
> >
> >
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/1278b89a-c60f-4fcd-9917-87a843d420a2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1556762687.1833972.1669113152.575BBA83%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Replacing the existing Jar files with new Jar files with same file name is not performing any action

2019-05-01 Thread chandrasekhar Mallishetty


On Thursday, May 2, 2019 at 1:52:26 AM UTC+5:30, chandrasekhar Mallishetty 
wrote:
>
> Dear All.
>
> Need your help we are in the process of Automating the cognos analytics 
> servers from Linux env with ansible code .
>
> Requirement : we have two Jar files named  local_policy.jar 
> and US_export_policy.jar in our current installation directory  
> ../ibm/jre/lib/security/ and we need to replace the new local_policy.jar 
> and US_export_policy.jar and we are writing the code as below .
>
> Ansible code: 
>  
>
>   - name: Put Oracle drivers in cognos directory
> get_url: >
>   url={{ artifactory_url 
> }}/libs-ibm-lic-local/com/oracle/ojdbc7/12.1.0.2.0/ojdbc7-12.1.0.2.0.jar
>   dest={{ cognos_dir }}/drivers/ojdbc7-12.1.0.2.0.jar
>   owner='{{ cognos_user }}'
>   group='{{ cognos_group }}'
>   mode=0755
> become: yes
>
>   - name: Put US export policy file in cognos directory
> get_url: >
>  url={{ artifactory_url 
> }}/libs-ibm-local/com/ibm/jce/US_export_policy/2013-02-27/US_export_policy-2013-02-27.jar
>  dest={{ cognos_dir }}/jre/lib/security/US_export_policy.jar
>  owner='{{ cognos_user }}'
>  group='{{ cognos_group }}'
>  mode=0755
> become: yes
>
>
> The above code is not taking any code or copying the new policy files  
> since the  { cognos_dir }}/jre/lib/security/ has that files and if we 
> change the name to US_export_policy_1.jar we can see the file new file 
> US_export_policy_1.jar
>
> we modified the above code by adding force:Yes not sure if this works or 
> not
>
> name: Put local policy file in cognos directory
> get_url: >
>  url={{ artifactory_url 
> }}/libs-ibm-local/com/ibm/jce/local_policy/2013-02-27/local_policy-2013-02-27.jar
>  dest={{ cognos_dir }}/jre/lib/security/local_policy.jar
>  owner='{{ cognos_user }}'
>  group='{{ cognos_group }}'
>  mode=0755
>  force: yes
> become: yes
>
> Can any one suggest an exact approch to move furture 
>
> Thanks
> M.chandra
>
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1278b89a-c60f-4fcd-9917-87a843d420a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Simple Ansible ping failing

2019-05-01 Thread markmonizhpe
I am aware that this is 5 years old but I had a similar problem that was 
caused by my ~/.ssh/config file. This post is what helped me find my 
solution.

If anyone else is having this issue, add 
ssh_args = -F /dev/null
to your /etc/ansible/ansible.cf


On Saturday, July 12, 2014 at 8:12:53 AM UTC-7, Chris Jones wrote:
>
> Matt THANKS!
>
> I thought it was Fedora as a node that was causing an issue but your 
> suggest was spot on! I had a SSH_AGENT script in the .bashrc file so I 
> removed it and it worked.
>
> Thanks
>
> On Saturday, July 12, 2014 10:09:03 AM UTC-4, Matt Martz wrote:
>>
>> Typically this is caused by having something in your .bashrc or similar 
>> that is echoing text.  See 
>> http://www.snailbook.com/faq/sftp-corruption.auto.html
>>
>>
>> On Sat, Jul 12, 2014 at 8:45 AM, Chris Jones  wrote:
>>
>>> Thanks. As I stated in the opening post, the password-less ssh is 
>>> working from the controller to the node as expected so I would expect 
>>> ansible to work. 
>>>
>>> I also included the output from - which shows ansible is trying to 
>>> work but ALWAYS returns 'FAILED => failed to transfer file to 
>>> /home/cjones/.ansible/tmp/.../(whatever module I try): Received message too 
>>> long ...'
>>>
>>> These are two virgin VMs setup with yum updates, ansible installed via 
>>> pip, python 2.7.5, centos 7 (controller) and fedora 20 (node) [note: 
>>> started the other way but had the same issues so we thought we would try 
>>> making centos 7 the controller and fedora the node]. Maybe we kill fedora 
>>> all together but I thought it would work with fedora.
>>>
>>> Ansible is currently on both VMs but I understand it does not have to be 
>>> (see previous paragraph note on why it is installed on both).
>>>
>>> Also, when I look at the .ansible/tmp/... on the node machine the tmp 
>>> directories exist from each command I run but nothing is in any directory.
>>>
>>> I'm at a lost!
>>>
>>> thanks
>>>
>>>
>>> On Saturday, July 12, 2014 9:32:15 AM UTC-4, Brian Coca wrote:

 The way ssh with keys works is that the machine you want to logon FROM 
 has to have a private key, hosts you want to log TO have to have the 
 public 
 version of that key.

 to test that it is working just use the ssh command itself, if that 
 works, ansible should work also.


 -- 
 Brian Coca
 Stultorum infinitus est numerus
 011101110010011001010110111000100111011101100111
 100101100111010100100111001101101101011101110010
 01110111
 Pedo mellon a minno

>>> -- 
>>> 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-proje...@googlegroups.com.
>>> To post to this group, send email to ansible...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/d182bdb2-17fd-4d65-9efd-7143ef4e130e%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Matt Martz
>> ma...@sivel.net
>> http://sivel.net/ 
>>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c352a720-f246-4005-af36-18e20c19e94e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to truncate oracle table with ansible code

2019-05-01 Thread James Cassell
This is a better question for the ansible-project list.

V/r,
James Cassell


On Wed, May 1, 2019, at 4:45 PM, chandrasekhar Mallishetty wrote:
> is there any example working code that how to truncate oracle database 
> table with the ansible code in jinga2 template

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab9bb049-0893-43d0-a937-5b4e35181505%40www.fastmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] how do I properly set ANSIBLE_BECOME_PASS ?

2019-05-01 Thread James Cassell
On Wed, May 1, 2019, at 4:27 PM, Guy Matz wrote:
> Thanks, but that didn't exactly help.  I'm not able to figure out what I'm
> missing . . .  any other thoughts?  Thanks again!!!
> here's the output from '--only-changed':
> 
> DEFAULT_BECOME(/Users/matz/Code/schransible/ansible.cfg) = True
> DEFAULT_VAULT_PASSWORD_FILE(/Users/matz/Code/schransible/ansible.cfg) =
> /Users/matz/.vault_pw
> HOST_KEY_CHECKING(/Users/matz/Code/schransible/ansible.cfg) = False
> 

There seems to be no environment variable for the become password.  You can 
make your own, though:
export ANSIBLE_BECOME_PASSWORD=mypassword

then in your ansible variables, set:
ansible_become_password: "{{ lookup('env', 'ANSIBLE_BECOME_PASSWORD') }}"


V/r,
James Cassell


> On Wed, May 1, 2019 at 3:06 PM James Cassell 
> wrote:
> 
> > On Wed, May 1, 2019, at 2:55 PM, Guy Matz wrote:
> > > Hello!  Sorry to be so lame.  What combination of environment vars do I
> > > need to set in order to not get prompted for a SUDO password?!
> > >
> > > I've tried setting ANSIBLE_BECOME_PASS and ANSIBLE_ASK_BECOME_PASS=False
> > > but I still get prompted . ..
> > >
> >
> > ansible-config dump --only-changed
> >
> > > Thanks,
> > > Guy
> > >
> >

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6f32a2ce-4b3c-4179-b26d-f76720ae9d6e%40www.fastmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] how do I properly set ANSIBLE_BECOME_PASS ?

2019-05-01 Thread Guy Matz
Thanks, but that didn't exactly help.  I'm not able to figure out what I'm
missing . . .  any other thoughts?  Thanks again!!!
here's the output from '--only-changed':

DEFAULT_BECOME(/Users/matz/Code/schransible/ansible.cfg) = True
DEFAULT_VAULT_PASSWORD_FILE(/Users/matz/Code/schransible/ansible.cfg) =
/Users/matz/.vault_pw
HOST_KEY_CHECKING(/Users/matz/Code/schransible/ansible.cfg) = False

On Wed, May 1, 2019 at 3:06 PM James Cassell 
wrote:

> On Wed, May 1, 2019, at 2:55 PM, Guy Matz wrote:
> > Hello!  Sorry to be so lame.  What combination of environment vars do I
> > need to set in order to not get prompted for a SUDO password?!
> >
> > I've tried setting ANSIBLE_BECOME_PASS and ANSIBLE_ASK_BECOME_PASS=False
> > but I still get prompted . ..
> >
>
> ansible-config dump --only-changed
>
> > Thanks,
> > Guy
> >
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1556737601.1685335.1669110880.74742216%40webmail.messagingengine.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CABnTgtX9q_gXwwy2KYSoMxvJWQxScME1_quz65_LTK6nHOCZ7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] how do I properly set ANSIBLE_BECOME_PASS ?

2019-05-01 Thread James Cassell
On Wed, May 1, 2019, at 2:55 PM, Guy Matz wrote:
> Hello!  Sorry to be so lame.  What combination of environment vars do I
> need to set in order to not get prompted for a SUDO password?!
> 
> I've tried setting ANSIBLE_BECOME_PASS and ANSIBLE_ASK_BECOME_PASS=False
> but I still get prompted . ..
> 

ansible-config dump --only-changed

> Thanks,
> Guy
> 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1556737601.1685335.1669110880.74742216%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] how do I properly set ANSIBLE_BECOME_PASS ?

2019-05-01 Thread Guy Matz
Hello!  Sorry to be so lame.  What combination of environment vars do I
need to set in order to not get prompted for a SUDO password?!

I've tried setting ANSIBLE_BECOME_PASS and ANSIBLE_ASK_BECOME_PASS=False
but I still get prompted . ..

Thanks,
Guy

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CABnTgtVAjsz3p2CwvzW92G9FU8kiP5cD7sNitAC8Zc5U6NYRiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Sourcing a script on a remote host to use the functions in the script

2019-05-01 Thread Sudheer S



On 30/04/19 9:26 PM, bren85 wrote:

Thanks for the quick reply,

That didn't work either, still comes up with the same error:

"module_args": {
            "_raw_params": "bash -lc 'source /root/vBNG/env.sh && ins'",
            "_uses_shell": true,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "warn": false
        }
    },
    "msg": "non-zero return code",
    "rc": 127,
    "start": "2019-04-30 16:54:34.129834",
    "stderr": "bash: ins: command not found",
    "stderr_lines": [
        "bash: ins: command not found"



I have not tested this. This if off the top of my head:

You may have to avoid using && and call it like "bash -lc 'source 
/root/vBNG/env.sh ins'".


Or put everything in a single script including the the `source` command.

-

Sudheer S

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/81647389-b587-58bd-62e2-d60d838024d4%40techchorus.net.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Copy files between two remote servers WITHOUT synchronize module

2019-05-01 Thread shivharsh . nec
Hi Glen,

You may use copy and fetch module as shown below:
In  the below playbook the files would be fetch from source machine and 
stored temporarily on the control node and then copied to the destination. 

---
 - hosts: src_apps
   tasks:
 - name: List of files to be copied
   command: "find /opt/dummyfiles/ -type f"
   register: list_files

 - name: Fetch the file from the source to control node
   run_once: yes
   fetch: src={{item}} dest=buffer/ flat=yes
   with_items: "{{ list_files.stdout_lines }}"

 - hosts: dest_apps
   tasks:
 - name: Copy the file from control node to destination
   copy: src=buffer/ dest=/opt/


OR

If you do not want to use the control node to store the files, you may use 
the command module and execute the SCP command from the source machine 
itself. Below is the playbook:
Please note, before executing the playbook you would need to enable 
password-less SSH between the two remote nodes. 
---
 - hosts: src_apps
   tasks:
 - name: List of files to be copied
   command: "find /opt/dummyfiles/ -type f"
   register: list_files

 - name: Execute SCP command
   command: scp -r {{item}} ServerB:/destination
   with_items: "{{ list_files.stdout_lines }}"


Hope this is helpful !

Best Regards,
Shivharsh

On Wednesday, 1 May 2019 06:40:26 UTC+5:30, Glen Collins wrote:
>
> Hello all!
>
>I have an issue in my environment where I cannot use the synchronize 
> module to transfer data between two remote nodes. So I need a different way 
> to do this.
>
> ServerA: Ansible Server (Tower Instance)
> ServerA1: Ansible Server (Tower Instance)
> ServerA2: Ansible Server (Tower Instance)
>
> ServerB: Data Server
>
> ServerC: User Server
>
> I want to run a playbook on ServerA and have it copy a/many file(s) from 
> ServerB to ServerC. I cannot use synchronize do to environmental issues. So 
> how can I get this done ether using copy or fetch modules. Or something 
> else like SCP from the shell or command module.
>
> I cannot find a good example of doing this other than the synchronize 
> module. I do not want to just copy the data files to the tower servers. I 
> need to keep my environment the same as it is today without changes.
>
> I'm using ansible 2.7. These are all Redhat Linux Servers.
>
> Here is a sample I tried. Really simple but...Inventory comes from tower 
> server which is why the hosts says "all"
>
> ---
> - name: Playbook1
>   hosts: all
>   gather_facts: yes
>   become: yes
>   remote_user: user1
>
>   tasks:
>
> - name: Copy file to dest server
>   fetch:
> src: "/var/tmp/file1"
> dest: "/var/tmp/"
> flat: yes
>   delegate_to: ServerB
> 
> ---
> - name: Playbook2
>   hosts: all
>   gather_facts: yes
>   become: yes
>   remote_user: user1
>
>   tasks:
>
> - name: Copy file to dest server
>   copy:
> src: "/var/tmp/file1"
> dest: "/var/tmp/"
> remote_src: yes
>   delegate_to: ServerB
>
> Any help would be appreciated.
>
> Regards,
>
> Glen
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/da738150-3379-4560-8e93-bf84568a0522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.