[ansible-project] Ansible custom module_utils in Ansible 2.1 & 2.2

2018-04-17 Thread Raja Shekar
Hi, I am working on Juniper.junos role. We are trying to correct our module_utils import style to include ansiballz framework. Currently, for our role we support Ansible >= 2.1. I understand that there was no custom module_utils support in Ansible 2.1, 2.2 . I need help with a workaround that

[ansible-project] Dynamic inventory json format question

2018-04-17 Thread fseudiba
Hello, in the past i used this inventory entries. *inventory.ini format:* [DATABASE1] hostname1.com [DATABASE2] hostname47.de *dynamic inventory json format:* { "DATABASE1" : { "hosts" : [ "hostname1.com ] }, "DATABASE2" : { "hosts" : [ "hostname47.de ] } } This setup wors fine. For int

[ansible-project] Re: error query sqlcmd

2018-04-17 Thread Christovam Paynes Silva
If you remove all the indentation (spaces, new lines), it works. If you remove a portion of the indentation, errors occur on other lines, such as "Msg": "Msg 102, Level 15, State 1, Server SRVBD2, Line 22 \ nIncorrect syntax near 'CODPOA'." Is there a way to leave the query indented? -- You re

[ansible-project] Re: error query sqlcmd

2018-04-17 Thread Christovam Paynes Silva
If you remove all the indentation (spaces, new lines), it works. If you remove a portion of the indentation, errors occur on other lines, such as "Msg": "Msg 102, Level 15, State 1, Server SRVBD2, Line 22 \ nIncorrect syntax near 'CODPOA'." Is there a way to leave the query indented? Em terça-f

[ansible-project] error query sqlcmd

2018-04-17 Thread Christovam Paynes Silva
Hi, okay? I'm new to ansible, so understand my rookie mistakes, rsrsrs. I'm having an error interpreting my query. From what I realized the problem is in the comma, when you get into it the Ansible gives the error below. After adjusting this, I want to work with Jinja2 in the query. What do I

Re: [ansible-project] Re: Ansible role with a reboot fails

2018-04-17 Thread Karl Auer
Not quite exactly - there was no pause task in the OP's version. The linked webpage says that the pause is needed to prevent the existing control connection being used. Regards, K. On Wed, Apr 18, 2018 at 6:28 AM, John Harmon wrote: > Sorry, ignore my last post. I can see that is exactly

[ansible-project] end_play with verbocity level?

2018-04-17 Thread John Harmon
Is there any way (maybe not with meta:) to end a play with a verbosity level? I don't think the following does exist, but expresses well what I am looking for. ie. meta: end_play verbosity: 2 -- You received this message because you are subscribed to the Google Groups "Ansible Project" g

Re: [ansible-project] Ansible role with a reboot fails

2018-04-17 Thread Kai Stian Olstad
On 17.04.2018 20:47, ZillaYT wrote: I tried the ideas from ansible-reboot-and-wait.yml exmaple , and others with That's over 4 years old, in this profession that is a lifetime. similar approach, to no avail. So my tasks look like # Thi

[ansible-project] Re: Failed logic with when statement

2018-04-17 Thread John Harmon
OK, Here are my working results should anybody else come looking and find this: *Play:* - name: Set timezone variable for non-UTC servers (Overriding UTC as default ) set_fact: ntp_timezone: America/Denver when: ansible_hostname|lower is not search ("agl|ascp|ebs|dmtr|vtx") *Result with

[ansible-project] Re: Failed logic with when statement

2018-04-17 Thread John Harmon
With it as the only option it does work so now I can see my flawed logic. ok: [ansible-rhel7] => { "ntp_timezone": "UTC" } TASK [ntp : Set timezone variable for non-UTC servers (Overriding UTC as default)]

[ansible-project] Re: Failed logic with when statement

2018-04-17 Thread John Harmon
I was wrong... I changed the order and it made no difference. I also have a similar test in another playbook that has always worked just fine so still looking for info from anybody that can help me. Reordered: ask path: /etc/ansible/roles/ntp/tasks/main.yml:27 ok: [ansible-rhel7] => { "

[ansible-project] Re: Failed logic with when statement

2018-04-17 Thread John Harmon
Ah, I think I see my problem. it works, but then gets checked against vtx and gets set.. I will have to try something else On Tuesday, April 17, 2018 at 2:21:35 PM UTC-6, John Harmon wrote: > > I have a variable 'ntp_timezone' set to UTC by default. I am trying to > override it in ce

[ansible-project] Re: Ansible role with a reboot fails

2018-04-17 Thread John Harmon
Sorry, ignore my last post. I can see that is exactly what you did On Tuesday, April 17, 2018 at 12:47:13 PM UTC-6, ZillaYT wrote: > > I've trying to write an Ansible role that upgrades Github. The command to > upgrade the server "ghe-upgrade github-2.13.1.pkg" for example, reboots the > ser

[ansible-project] Re: Ansible role with a reboot fails

2018-04-17 Thread John Harmon
What about this?: https://gist.github.com/infernix/a968f23c4f4e1d6723e4 On Tuesday, April 17, 2018 at 12:47:13 PM UTC-6, ZillaYT wrote: > > I've trying to write an Ansible role that upgrades Github. The command to > upgrade the server "ghe-upgrade github-2.13.1.pkg" for example, reboots the > se

[ansible-project] Failed logic with when statement

2018-04-17 Thread John Harmon
I have a variable 'ntp_timezone' set to UTC by default. I am trying to override it in certain situation, but this ALWAYS overrides it. I think something with my logic is wrong and could use another pair of eyes: *NOTE: ansible-rhel7 has a current hostname of ansible-rhel7ebs* - debug: var:

[ansible-project] Ansible role with a reboot fails

2018-04-17 Thread ZillaYT
I've trying to write an Ansible role that upgrades Github. The command to upgrade the server "ghe-upgrade github-2.13.1.pkg" for example, reboots the server, and when that happens, I get, the following connection because my ssh connection drops of course. TASK [github : Upgrade github1.company.

[ansible-project] Re: Ansible 2.5 is not accepting dynamic hosts variable

2018-04-17 Thread Daniel Palmer
Thanks for the reply. I found the issue and it is a bug in 2.5.0 and was reported here: https://github.com/ansible/ansible/issues/37984 The fix is also linked in the bug report at: https://github.com/ansible/ansible/pull/38000. I pulled the fixed file and my install of 2.5.0 is now working as

[ansible-project] Re: How to achieve sudo su - root and run all command in ansible

2018-04-17 Thread Utkarsh Sharma
Team, I am also facing the same issue. it works using the raw module but not in the playbook On Friday, August 4, 2017 at 4:57:28 PM UTC+5:30, Ganesh Batwal wrote: > > Hi All, > We are not able to switch the ansible playbook connection to root id. eg. > "sudo su -" and then execute the privileg

Re: [ansible-project] How to add multiple ssh keys from Github to a single deploy-style user?

2018-04-17 Thread Eric Feldhusen
My apologies, I will do that next time. Your suggestion worked perfect, thank you, I appreciate it. Eric Feldhusen > On Apr 17, 2018, at 12:03 AM, Brian Coca wrote: > > @Eric, normally you should include the error you get, from the email > it looks like an indentation issue, also key takes a s

[ansible-project] Getting time out error for eos_modules such as eos_command

2018-04-17 Thread Shubham Gampawar
Hi there, I am working on eos_ switches but when I am trying to get device running configuration, instead of the device running-config I am getting following error. I there any open bug in 2.5 for Eos modules. fatal: [192.68.122.115]: FAILED! => {"msg": "timed out"} Similarly, I am trying w

[ansible-project] The current released version of Ansible 2.5

2018-04-17 Thread gracy layla
The current released version of Ansible (2.5) a new major release of Ansible approximately every two months. The core application evolves somewhat conservatively, valuing simplicity in language design and setup. However, the community around new modules and plugins being developed and contribut

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

2018-04-17 Thread Sosys
Hi Dave, thanks! On Fri, Apr 13, 2018 at 8:00 AM, Dave H wrote: > 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-pl

[ansible-project] Re: register a variable created from other variables?

2018-04-17 Thread Karl Auer
Sorry - I've done it again; figured out a solution to my own problem AFTER posting a question. Anyway, the answer is the set_facts: task. This lets you build a variable from other variables. In the role that creates security groups, the last task is a set_fact: task that builds a list of the s

Re: [ansible-project] include not working

2018-04-17 Thread Tcpip
Hello, Thanks for your help I will check the reference. but the strange thing is I did playbooks the same way for server and I only have issue with this modules. thanks On Tuesday, April 17, 2018 at 5:20:36 AM UTC-3, Biswadip Dutta wrote: > > I understand the problem now. You are trying to

[ansible-project] Re: Ansible 2.5 is not accepting dynamic hosts variable

2018-04-17 Thread 'J Hawkesworth' via Ansible Project
I suggest making 'dbhosts' a group name in your inventory, then you can have hosts: dbhosts in your playbook, and its settled that what happens in that playbook will only happen on hosts in the group 'dbhosts' If you still need to set hosts dynamically, consider defaulting, like this hosts: "{

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

2018-04-17 Thread 'J Hawkesworth' via Ansible Project
Please share your playbook so others can understand what ansible is attempting to do. On Monday, April 16, 2018 at 7:12:28 PM UTC+1, Ramanjaneyulu S wrote: > > Thanks for replying. Unfortunately, rebooting did not worked for me. > > On Friday, 13 April 2018 12:47:52 UTC-4, Namasivayam C wrote: >>

Re: [ansible-project] return more than process id in ansible when i use ps in shell module! why?

2018-04-17 Thread Biswadip Dutta
Can you please elaborate about the issue in the mail body rather than the subject? That way someone might be able to help you. :) Regards, Biswadip Dutta On Tue, Apr 17, 2018 at 12:02 PM, Ghasem keshavarz haddad < ghasemsys...@gmail.com> wrote: > please help me :( > > -- > You received this mess

Re: [ansible-project] include not working

2018-04-17 Thread Biswadip Dutta
I understand the problem now. You are trying to include a playbook under the tasks level which is not allowed. A file with only tasks are allowed to be included under tasks. See here . Also, conditi

[ansible-project] Re: register a variable created from other variables?

2018-04-17 Thread Karl Auer
Further to this: I have no problem collecting the various groups into a list using ec2_group_facts. What I can't figure out how to do is get the group IDs from that list of group facts into a single variable that can be used in the ec2 module, which takes a list of group IDs in its "group_id" a