Re: [ansible-project] Re: ansible block not running as expected

2017-02-15 Thread John Dhom
That is correct. We ran into this last week as well. Found the bug here... https://github.com/ansible/ansible/issues/20736 Best, /jhd On Wednesday, February 15, 2017 at 4:00:42 AM UTC-6, Kai Stian Olstad wrote: > > On 15.02.2017 10:28, Adrian Paraschiv wrote: > > Because I said it's a role and

[ansible-project] Re: How to specify a virtual network in a different resource group when creating a new Azure VM?

2017-02-15 Thread shanmuga Mahalingam
I tried with full URI and no luck. virtual_network_name: /subscriptions//resourceGroups//providers/Microsoft.Network/virtualNetworks/ansible_test Anyone help on this pls ? On Tuesday, 14 February 2017 18:20:28 UTC, Bamar Diagne wrote: > > Hi, > > I am facing the same issue, did you manage to

Re: [ansible-project] Could ansile access remote hosts by serial console over LAN

2017-02-15 Thread rong zhao
Yes, you said totally right, it is exactly my problem. I have tried your suggestion, someone already logged on that same console. but ansible still reports Authentication or permission failure. now, I want to study ansible's source code, try to rewrite the code after initial connection. it sho

Re: [ansible-project] Variable president - default and variable in playbook

2017-02-15 Thread Ben Wright
Hi Kai Thanks for your response, however this is about variables rather than files being present, this is the directory listing: [tibcosvc@x rv-8.4.4]$ ls assemblies product_rv_8.4.4_FeatureConfig.xml TIBCOUniversalInstaller-lnx-x86.bin TIB_rv_8.4.4_docinfo.html licensesREADME.

[ansible-project] Replace multiple lines in a file at different locations

2017-02-15 Thread Suresh Grandhi
I am looking to replace or delete redundant lines in a file at different line numbers. For example, a file has the following content In this case, I want to removeand replace with . Is there a possibility to do this in Ansible? -- You received this message because you are subsc

[ansible-project] Re: How to use Ansible playbook loops to create multiple specific VMware guests on multiple free ESXi hosts using vsphere_guest module.

2017-02-15 Thread Alex Lien
Hi Kai, Thank You so much for your help. The loop works with your suggestions except it seems to run a duplicate task and create a duplicate guest. This is with a test of 2 ESX hosts. Is there a way to work around it? This is what I have in my inventory: [esxi] esxi1 esxi4 # ansible-playb

[ansible-project] RedHat Subscription Manager enable/disable repos

2017-02-15 Thread Zack Windoloski
After registering to a subscription using the redhat_subscription module, I would then like to enable and disable some repos. This task would be done manually using "subscription-manager repos --enable=myrepo" Would using the yum_repository module work to do this? Or is there another solution be

Re: [ansible-project] ansible winrm : the specified credentials were rejected by the server

2017-02-15 Thread Trond Hindenes
Pretty sure thats not a password issue, I think the error text is different. Is the user a member of administrators? -- 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 em

[ansible-project] Telnet module for ansible

2017-02-15 Thread Madhusudhanan Santhanam
Is there any telnet module available for Ansible? I want to telnet to server and execute some command for a particular task. Any body please help? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop recei

Re: [ansible-project] ios_config: match confusion

2017-02-15 Thread Peter Sprygada
match=line * Simple line matching against the running config with respect to context (parents). If the line is in the config, then nothing will be done. If the line isn't in the config, it will be added match=none * Ignore the running config all together and push the config lines into the devi

[ansible-project] Re: Can I provide .pyo files as module_path library

2017-02-15 Thread Matt Clay
Since python bytecode can be easily converted back to python source, there isn't any security there. That aside, and I don't recommend this, you could create a python stub loader which loaded embedded python bytecode. Here's a quick proof of concept (again, I don't recommend this): #!/usr/bin/

[ansible-project] Re: Can I provide .pyo files as module_path library

2017-02-15 Thread tkuratomi
Ansible is not designed to handle this case. There's too many things that become impossible. I can think of a work around, though. The workaround is to make your modules into a binary modue. Something like cx_freeze will create a single file executable with all of the things necessary to exe

[ansible-project] Re: Can I provide .pyo files as module_path library

2017-02-15 Thread Poojitha A
Hi Matt, Could be the case however, we are running all the files locally. It should be using the same compiler that we used to build .pyo files. On Wednesday, February 15, 2017 at 12:27:03 PM UTC-8, Matt Clay wrote: > > Poojithaa, > > You're probably encountering the error here: > https://g

Re: [ansible-project] Point Ansible at alternate ssh config file

2017-02-15 Thread Jeff Richards
Hey Matt, Tried it both ways, makes no difference. With verbosity cranked up, I can see that it's reading the default .ssh/config file. But interestingly, although the debug does show: "Using /etc/ansible/ansible.cfg as config file" and that contains: ssh_args = -C -F /home/user01/.ssh/collate

Re: [ansible-project] Point Ansible at alternate ssh config file

2017-02-15 Thread Matt Martz
Jeff, If memory serves me correctly, you have to use a full path to the config, and cannot use ~ This is due to the ssh command not being executed via a shell, so shell expansions do not happen. I have a similar configuration in my ansible.cfg and it works without issue. On Wed, Feb 15, 2017 at

[ansible-project] Re: Can I provide .pyo files as module_path library

2017-02-15 Thread Matt Clay
Poojithaa, You're probably encountering the error here: https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/module_common.py#L512 Due to possible version differences between the python version used to compile the module and the python version on the remote system which will exec

[ansible-project] Point Ansible at alternate ssh config file

2017-02-15 Thread Jeff Richards
I'm trying to have Ansible use an alternate ssh config file (i.e. not ~/.ssh/config). My understanding was that you achieve this via adding a -F option in ssh_args in /etc/ansible/ansible.cfg. So my ssh_args now looks like this: [ssh_connection] ssh_args = -C -F ~/.ssh/collated-configs -o Contr

[ansible-project] Ansible installation without internet

2017-02-15 Thread Abhinav Sanakkayala
Hi All, I am trying to install Ansible on my Ubuntu16.04 version, the path that I can think of is to first install the Python Jinja2 package and then set the source for the Ansible installation file. I have googled it and didn't find any good useful resources. Can someone please suggest a tuto

Re: [ansible-project] Pass dynamic JSON/YAML inventory to ansible CLI

2017-02-15 Thread Matt Martz
I hit enter too early, my other recommendation was an inventory script, that wouldn't have to have anything hard coded, and could pull from the same database that your "REST server" utilizes. For documentation on dynamic inventories see: http://docs.ansible.com/ansible/dev_guide/developing_invent

Re: [ansible-project] Pass dynamic JSON/YAML inventory to ansible CLI

2017-02-15 Thread Matt Martz
You are going to need an actual file. There really isn't a way to just pass an inventory blob into ansible, that doesn't exist as a file. I've done it with the ansible python API, but it was a bit complex, and potentially very fragile as the API was not designed for this. On Wed, Feb 15, 2017 at

Re: [ansible-project] Variable president - default and variable in playbook

2017-02-15 Thread Kai Stian Olstad
On 13. feb. 2017 22:28, Ben Wright wrote: When I get this error below, but one can clearly see the variable is defined in the message above, please what am I missing? TASK [tibco-install1 : Copy the silent file into place with the appropriate configuration] *** failed: [ansiclie50] (item={

Re: [ansible-project] Possible bug in iptables module

2017-02-15 Thread Juan Pablo Genovese
Right! Ok, so I just filed an issue in the Ansible repo: https://github.com/ansible/ansible/issues/21467 Thanks for the feedback, Nehal! On Wednesday, February 15, 2017 at 10:02:55 AM UTC-3, Nehal J Wani wrote: > > Seems like a bug to me. > > Technically, the conntrack match supersedes - and s

[ansible-project] Pass dynamic JSON/YAML inventory to ansible CLI

2017-02-15 Thread W Dec
Hi All, while trying, and so far not very successfully, to work with the (overly verbose) Ansible 2 programmatic API, I came to think of another possible solution to my problem, but am looking for tips on how to put it into action. The problem: I have a python REST server which accepts host reg

[ansible-project] How to run an ansible container that reports connection refused?

2017-02-15 Thread Chethan S
I was trying to use this jenkins-container role. Since I was facing issues with regard to 8080 port (bind address already in use, connection refused etc.; ultimately not working), I made a copy of the role locally and tried running the

Re: [ansible-project] Ansible 2.2.0.0 - module win_file & check mode

2017-02-15 Thread Dag Wieers
On Fri, 2 Dec 2016, fabrice.pe...@socrambanque.fr wrote: I have just discovered that the *win_file* module does not support *check_mode*. Is it a regression? If not, are there any developments in progress for this module to support check mode? We are working hard to improve the Windows suppo

Re: [ansible-project] ansible winrm : the specified credentials were rejected by the server

2017-02-15 Thread Dag Wieers
On Tue, 14 Feb 2017, Hmdi Bz wrote: when I execute : $ ansible windowsTest -i inv.ini -m win_ping I get this error: 192.168.1.2 |Unreachable! => { "changed": false, "msg": "basic: the specified credentials were rejected by the server", "unreachable": true } Could you run this with -

Re: [ansible-project] Possible bug in iptables module

2017-02-15 Thread Nehal J Wani
Seems like a bug to me. Technically, the conntrack match supersedes - and so obsoletes - the state match. But practically the state match is not obsoleted in any way. The ansible iptables module is doing: /sbin/iptables -t filter -A INPUT -m conntrack -j ACCEPT -m state --state ESTABLISHED,RELAT

Re: [ansible-project] Could ansile access remote hosts by serial console over LAN

2017-02-15 Thread Dag Wieers
On Tue, 14 Feb 2017, rong zhao wrote: My remote hosts' management port is serial console over LAN. When connect by ssh manually, I use ops account connect to remote hosts, and then it become the Linux console, I just run ssh command. Now, I use ansible -m ping to test reachable, it report

Re: [ansible-project] win_firewall_rule.ps1 to support multiple values for remoteip and icmp protocol

2017-02-15 Thread Dag Wieers
On Tue, 14 Feb 2017, Mario S. wrote: New to Ansible here... I can't seem to make multiple values work for the remoteip variable. For instance, I want to allow multiple IP subnets to work through a firewall rule. And also noticed the ICMPv4 protocol isn't supported properly. Please advise, thanks

Re: [ansible-project] store the output of math operator

2017-02-15 Thread Nehal J Wani
Invoking the shell module is not necessary. One can use jinja2. An example: $ cat a.yaml - hosts: localhost tasks: - set_fact: A="5" - set_fact: B="6" - set_fact: C="{{ A|int - B|int }}" - debug: var=C $ ansible-playbook -v a.yaml No config file found; using defaults [WARNING]

[ansible-project] win_firewall_rule.ps1 to support multiple values for remoteip and icmp protocol

2017-02-15 Thread Mario S.
New to Ansible here... I can't seem to make multiple values work for the remoteip variable. For instance, I want to allow multiple IP subnets to work through a firewall rule. And also noticed the ICMPv4 protocol isn't supported properly. Please advise, thanks. -- You received this message becaus

[ansible-project] buidling egg for ansible modules

2017-02-15 Thread Poojitha A
Hi Guys, I have a requirement, to build .pyo for our ansible modules and distribute as egg. However, while running ansible, its not able to detect the module. Module not found is thrown. Can someone please comment, if we can pass .pyo files as module_path and will it work? Thanks Poo --

[ansible-project] Can I provide .pyo files as module_path library

2017-02-15 Thread Poojitha A
Hi Guys. currently we are shipping our code as .pyo to ensure a minimal security to our python code base. I wanted to know if passing the module_path='library_path' where the library path has .pyo files instead of .py files work, since I was getting an error saying module not found. Can some

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

2017-02-15 Thread Madhusudhanan Santhanam
you can also use "assert" and the execution stops right there and it will not execute any tasks further On Tuesday, February 14, 2017 at 8:43:30 AM UTC-8, bablu wrote: > > > If condition fails it should not go for the next step and exit from there > only. > > In following situation, when: C

[ansible-project] Possible bug in iptables module

2017-02-15 Thread Juan Pablo Genovese
Hello everybody! I'm having problems with the iptables module trying to execute this task: - iptables: chain: INPUT match: conntrack ctstate: ESTABLISHED,RELATED jump: ACCEPT This leads to this error: TASK [iptables] *

[ansible-project] ios_config: match confusion

2017-02-15 Thread Adam Wilkins
I'm a little confused on the various match clauses in the 'ios_config' module. I understand IOS very well. I'm trying to find use cases for the different options here. Does anyone have any example of when each would be used? Here are the options: - line - strict - exact

Re: [ansible-project] Variable in JSON

2017-02-15 Thread Nehal J Wani
Something like this should work: [wani@linux tmp ]$ cat a.yaml - hosts: localhost tasks: - command: 'echo {\"key\": \"value\"}' register: my_output - debug: msg: "{{ my_output.stdout | from_json }}" On, run, it will show: TASK [debug] *

[ansible-project] Re: ansible winrm : the specified credentials were rejected by the server

2017-02-15 Thread 'J Hawkesworth' via Ansible Project
"the specified credentials were rejected by the server" can often mean the password doesn't match what's expected for the user name. Are you using a domain login? If so you'll need to set up the kerberos support. If not check the windows event log to see which user it reckons you are logging

Re: [ansible-project] Re: ansible block not running as expected

2017-02-15 Thread Kai Stian Olstad
On 15.02.2017 10:28, Adrian Paraschiv wrote: Because I said it's a role and you put them as tasks ;) Sorry about that, I didn't think it would matter, but it does. Testet the tasks in a role and it stopped as you say. Testet Ansible 2.1.4.0 and 2.2.0.0 and there it works as expected, so this

Re: [ansible-project] Re: Module fetch -- checksum error

2017-02-15 Thread Jacek Cała
Hi Markus, No, sorry. I haven't tried to sort it out as I was able to reduce the size of the files I transfer. I guess, it's something the ansible team should take care of. Cheers, Jacek 2017-02-14 15:46 GMT+00:00 Markus Huber : > Jacek, could you figure this issue out? Seems I experience

[ansible-project] Re: ansible block not running as expected

2017-02-15 Thread Adrian Paraschiv
Because I said it's a role and you put them as tasks ;) On Wednesday, February 15, 2017 at 8:51:37 AM UTC+2, Adrian Paraschiv wrote: > > I have ansible 2.2.1.0 and I have this role: > > - block: > - shell: echo 1 > - shell: fail > - shell: echo 2 > rescue: > - shell: echo 3 > a

Re: [ansible-project] ansible block not running as expected

2017-02-15 Thread Kai Stian Olstad
On 15.02.2017 07:51, Adrian Paraschiv wrote: I have ansible 2.2.1.0 and I have this role: - block: - shell: echo 1 - shell: fail - shell: echo 2 rescue: - shell: echo 3 always: - shell: echo 4 - name: running something after the block shell: echo 5 If I run this role