[ansible-project] Re: delete the older files using Ansible play book

2017-08-25 Thread bibhu
Hello Group Members, At last I am trying to code the ansible script as per my requirement but , request you to have a look into below full ansible codes ,and let me know whether it's correct or we need to modify anywhere, as I am new to ansible and currently I don't have access to test the code

Re: [ansible-project] Iterating over with_items failing within blockinfile

2017-08-25 Thread Kai Stian Olstad
On lørdag 26. august 2017 00.45.07 CEST John Harmon wrote: > - name: Removing existing DNS entries from ifcfg-* files > lineinfile: > path: "{{ net_path }}{{ item }}" > backup: yes > state: absent > regexp: '^DNS' > with_items: "{{ ifcfg_list.stdout_lines }}" > - name: Update

[ansible-project] Iterating over with_items failing within blockinfile

2017-08-25 Thread John Harmon
I have the following task/main.yml part of my playbook. Everything works fine except for the last section with the blockinfile. I assume I have some sort of a syntax issue. Enter code here...--- - name: Dependency resolution -- Install selinux bindings yum: name: libselinux-python sta

[ansible-project] Re: win_package - missing product id error

2017-08-25 Thread don_rumata
https://gist.github.com/don-rumata/f42134fd59e7c7630cbef31b05306552 вторник, 23 августа 2016 г., 19:11:55 UTC+3 пользователь Anfield написал: > > Any ideas anyone? > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this gr

Re: [ansible-project] if one package fails all other non dependent packages installation fails in ansible

2017-08-25 Thread Kai Stian Olstad
On søndag 20. august 2017 20.32.13 CEST Sameer Modak wrote: > TASK [get python-yum and python-curl] > > * ...ignoring > failed: [192.168.211.131] (item=[u'python-pycu

Re: [ansible-project] Pass Ansible variable to remote host

2017-08-25 Thread Kai Stian Olstad
On tirsdag 22. august 2017 15.13.28 CEST Mladen Stankovic wrote: > I am trying to pass a variable defined in Ansible host to a remote host, > using lookup plugin *native hashi_vault*, but play returns an error that > variable is not defined. > The same variable returns expected value on the localho

Re: [ansible-project] Conditionally running a filter in a chain

2017-08-25 Thread Kai Stian Olstad
On torsdag 24. august 2017 16.36.41 CEST Jean-Francois Bibeau wrote: > Trying to do the following, and struggling to find a way to do this. > > I build a list of strings, and want to conditionally append a string at the > end of the list, but only if the variable is defined. > > This works fine:

Re: [ansible-project] delete the older files using Ansible play book

2017-08-25 Thread bibhu
Hello Dick/Group, still I am not able to find the appropriate steps to Email having all the file list which is older than 7days I am just mentioning the requirement and steps what I wrote till now , still not sure how we can write the steps for Email the content of stdout_lines ? Please help m

Re: [ansible-project] Filtering on a Template variable

2017-08-25 Thread Anfield
That works thanks. I suppose what confused me a little was when trying to do this via command line I had to use grep.. [ansible@localhost exercises]$ ansible local -m setup -a 'filter=ansible_default_ipv4*' | grep address > -- You received this message because you are subscribed to the Googl

Re: [ansible-project] Need to chat off-forum

2017-08-25 Thread Adam Shantz
I agree, they shouldn't be in power. Alas, it's the situation I'm in, and I'm not a Director/VP. The people I refer to are system engineers. My thought is they are comfortable being the only people with root access (even though I've managed to get Ansible setup with some level of root privil

Re: [ansible-project] Need to chat off-forum

2017-08-25 Thread Karl E. Jorgensen
On Fri, 2017-08-25 at 11:08 -0700, Adam Shantz wrote: > Hi all -  > I have some difficult people in my organization that are in positions > of power that think that just because doing something manually "isn't > very hard", it shouldn't be automated.  For example, clone of VMs > from templates, set

[ansible-project] Need to chat off-forum

2017-08-25 Thread Adam Shantz
Hi all - I have some difficult people in my organization that are in positions of power that think that just because doing something manually "isn't very hard", it shouldn't be automated. For example, clone of VMs from templates, setting up sshd_config, etc. Is there anyone out there that w

Re: [ansible-project] Re: add user via adhoc

2017-08-25 Thread Kai Stian Olstad
On fredag 25. august 2017 19.43.45 CEST Tcpip wrote: > Hello Kai > > Thanks for your tips, it worked but I have one question, when I remove that > line I start having ssh issue to my network device. > > ssh unable to connect, I add back that line and it starts working. That's because most networ

Re: [ansible-project] delete the older files using Ansible play book

2017-08-25 Thread bibhu
Thank you Dick, Anyone want to add specific steps related my requirement , please add the same. On Friday, August 25, 2017 at 4:45:55 PM UTC+5:30, Dick Visser wrote: > Pseudo code: > > 1. find - to find the specific files, and register the result. > 2. http://docs.ansible.com/ansible/latest/ma

[ansible-project] Re: add user via adhoc

2017-08-25 Thread Tcpip
Hello Kai Thanks for your tips, it worked but I have one question, when I remove that line I start having ssh issue to my network device. ssh unable to connect, I add back that line and it starts working. Thanks. !!! On Thursday, August 24, 2017 at 12:09:55 AM UTC-3, Tcpip wrote: > > Hi all >

[ansible-project] How to make use of Ansible Tower Rest API

2017-08-25 Thread Shawn Singh
Hello, I'm fairly new to working with Ansible and Ansible Tower. So far I've written some playbooks and can execute them. I have taken some of the playbooks and put them in Tower and can run them from Tower. Now I'm trying to make the move to executing jobs from vRO... I don't administer the vR

Re: [ansible-project] How to get all available inventory options?

2017-08-25 Thread Kai Stian Olstad
On fredag 25. august 2017 18.10.19 CEST Justin wrote: > I've searched quick a bit, and either I don't know the right terms or it's > not been answered :-p > > How can I find all available options when setting a host in inventory? I > have some heavily loaded windows guests that take a long time t

[ansible-project] How to get all available inventory options?

2017-08-25 Thread Justin
I've searched quick a bit, and either I don't know the right terms or it's not been answered :-p How can I find all available options when setting a host in inventory? I have some heavily loaded windows guests that take a long time to respond, and I read about increasing two timeouts to give t

[ansible-project] iosxr_config - config change via template file touching multiple sections

2017-08-25 Thread Tim Nothnagel
Hi all, I have created a template file, which touches multiple sections, among others includes physical interfaces as well as other protocols like BGP. I tried to apply this via 'src:', but it seems to replace the entire config only. I tried a few other things, e.g. the use of 'match' without su

Re: [ansible-project] Parsing output

2017-08-25 Thread John Harmon
Perfect. Thank you. On Friday, August 25, 2017 at 9:18:14 AM UTC-6, Kai Stian Olstad wrote: > > On fredag 25. august 2017 17.03.21 CEST John Harmon wrote: > > I have the following output from my debug (using "find", and the debug > > output for "files") > > { > > "atime": 15035884

Re: [ansible-project] Parsing output

2017-08-25 Thread Kai Stian Olstad
On fredag 25. august 2017 17.03.21 CEST John Harmon wrote: > I have the following output from my debug (using "find", and the debug > output for "files") > { > "atime": 1503588437.3974097, > "ctime": 1503588433.7234097, > "dev": 2051, > "gid": 0, >

[ansible-project] Parsing output

2017-08-25 Thread John Harmon
I have the following output from my debug (using "find", and the debug output for "files") { "atime": 1503588437.3974097, "ctime": 1503588433.7234097, "dev": 2051, "gid": 0, "inode": 21408, "isblk": false, "ischr":

[ansible-project] Vagrant next release will fully support inventory changes introduced by Ansible 2.0

2017-08-25 Thread Gilles Cornu
Dear Ansiblers! I'm very happy to announce you that the next Vagrant release will fully support Ansible 2.x inventory variables (e.g. `ansible_host` instead of `ansible_ssh_host`) and also allow to get rid of deprecation messages around the `sudo`/`become` parameters. In order to achieve this i

Re: [ansible-project] Grep value from a dict of list of dict ...

2017-08-25 Thread Matt Martz
Actually that can be simplified, I completely forgot that the default for selectattr is to check if the value is true. So: results|selectattr('restart_needed')|list|length That doesn't even require the `equalto` test. On Fri, Aug 25, 2017 at 9:40 AM, Matt Martz wrote: > What you need to use

Re: [ansible-project] Grep value from a dict of list of dict ...

2017-08-25 Thread Matt Martz
What you need to use here is selectattr and equalto from jinja2: results|selectattr('restart_needed', 'equalto', true)|list|length If my memory is correct, `equalto` was not added until jinja2 v2.8 On Fri, Aug 25, 2017 at 7:42 AM, lovi wrote: > Hello, > > I am struggling with this kind of str

Re: [ansible-project] No logs being sent to Logstash

2017-08-25 Thread Andrew Latham
For tower questions and support please utilize https://access.redhat. com/products/ansible-tower-red-hat This mailing list is for the open source Ansible project. On Fri, Aug 25, 2017 at 8:42 AM, Ash Powell wrote: > We've recently upgraded to Ansible 2.3.2 and Tower 3.1.4 > > I wanted to get th

[ansible-project] No logs being sent to Logstash

2017-08-25 Thread Ash Powell
We've recently upgraded to Ansible 2.3.2 and Tower 3.1.4 I wanted to get the logs out of Ansible, using the logging aggregator in Tower (following this: http://docs.ansible.com/ansible-tower/latest/html/administration/logging.html) I'm not seeing any logs being sent from Ansible into Elasticse

[ansible-project] Grep value from a dict of list of dict ...

2017-08-25 Thread lovi
Hello, I am struggling with this kind of structure : { "out.results": [ { "_ansible_item_result": true, "_ansible_no_log": false, "_ansible_parsed": true, "changed": false, "exitcode": "NoChangeNeeded", "fea

Re: [ansible-project] delete the older files using Ansible play book

2017-08-25 Thread bibhu patnaik
Thank you so much Dick -- 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

Re: [ansible-project] delete the older files using Ansible play book

2017-08-25 Thread Dick Visser
Pseudo code: 1. find - to find the specific files, and register the result. 2. http://docs.ansible.com/ansible/latest/mail_module.html and attach the files from the previous task result 3. file - to remove the same set of files from 1. On Fri, 25 Aug 2017 at 09:57, bibhu wrote: > I need to

Re: [ansible-project] cloning a service for HA?

2017-08-25 Thread Kai Stian Olstad
On fredag 25. august 2017 03.28.23 CEST pixel fairy wrote: > maybe a script to randomly generate a key, archive, compress, and encrypt > the folder, fetch to local, copy to standby and decrypt there. that could > be put in a handler when run on the active node, and a check for exist on > all standb

[ansible-project] delete the older files using Ansible play book

2017-08-25 Thread bibhu
I need to write an ansible script to solve the below requirement. i am trying to write script, few steps i have written but i am having some doubt how to lsit all the files older than 7 days, once we got the list of fies we need to send those files “*.merged” to a specific mail id, below are

Re: [ansible-project] Filtering on a Template variable

2017-08-25 Thread Dick Visser
ipv4 address {{ ansible_default_ipv4.address }} On 25 August 2017 at 05:08, Anfield wrote: > How can I filter a variable in a template so that I can extract a fact > > Trying to get the default ipv4 address from a template > > template.j2 > ipv4 address ((ansible_default_ipv4 | grep address}} >