Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Oğuz Yarımtepe
Instead of using expect, setting the ansible_ssh_pass is another solution. Instead of running ansible-playbook inside a script, i can directly use it and it may get the ssh password from group_vars variable. I couldn't make it, thats what i am trying to do now. On Thu, Jun 22, 2017 at 8:13 AM,

Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Madhu
There is a default time out value for expect. That's why its timing out. To disable the timeout, we are setting as -1. I don't think its ansible issue. On Wed, Jun 21, 2017 at 10:09 PM, Oğuz Yarımtepe wrote: > The lookup method sounds more Ansible way. timeout -1 solved

Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Oğuz Yarımtepe
The lookup method sounds more Ansible way. timeout -1 solved the issue by the way. But i would like to solve the lookup problem also. On Thu, Jun 22, 2017 at 4:59 AM, Madhu wrote: > Hi, > >I think it's timing out because of the spawn. Use 'set timeout -1' > before the

Re: [ansible-project] set_fact adding unicode "[u' in front of new variable (2.3.1.0)

2017-06-21 Thread Alex White
Brian, thank you! Additional information provided by the IRC chan: Complex types get stringified using python's default representation. the [ is for start of list, and each string has u'...' denoting that it's a unicode string instead of set_fact: instance_id="expression", use set_fact:

Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Madhu
Hi, I think it's timing out because of the spawn. Use 'set timeout -1' before the spawn command. That should solve the issue. Thanks, Madhu Sent from my iPhone > On Jun 21, 2017, at 3:21 PM, Oğuz Yarımtepe wrote: > > Great tip. > > Here is my folder structure:

[ansible-project] pexpect module installation errors on Ubuntu

2017-06-21 Thread Murthy Vipparthy
Thank you for looking @ issues I am trying to install pexpect module using easy_install script in Ubuntu Servers and following are errors we have been observing after search found following bug can cause issues, Does this bug fixed or any work around for my installation.. Bug observed

Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Oğuz Yarımtepe
Great tip. Here is my folder structure: group_vars/all some_playbook/playbook.yml inventory_file $ ansible-playbook -i inventory_file some_playbook/playbook.yml --become-user root --become-method sudo --become # cat group_vars/all --- ansible_ssh_pass: "{{lookup('pipe',

Re: [ansible-project] Using inventory variables from external inventory script to specify which other variables to use (like hiera)

2017-06-21 Thread Dick Davies
I don't think there's a One True Way, it really boils down to the team you're working with and what makes sense for them given the mix of environments they're managing. Some people use one inventory for ALL their servers, if you need cross-site plays that might be necessary. If you're lucky

[ansible-project] Re: How to distribute python? Without affecting what is installed.

2017-06-21 Thread John G
Look at this site for Solaris. It installed python 2.6 and dependences to /opt/csw/. https://www.opencsw.org/manual/for-administrators/index.html For CentOS 5 we are looking at python26 from EPEL repository. https://fedoraproject.org/wiki/EPEL

Re: [ansible-project] Was my post eaten?

2017-06-21 Thread Brian Coca
there was long list and big part of the team is at the London Fest -- Brian Coca -- 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] Approved software list

2017-06-21 Thread barbara volkman
Hello, I am looking to get ansible on an approved software list within the us federal government. Is there a pic that can help identify an existing customer that I can reference? Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Ansible

[ansible-project] Anyone have experiences with using lots of groups and group_vars files?

2017-06-21 Thread William Saxton
New user here trying to figure out the best way to convert our current server provisioning system to Ansible. Our system uses approx. 5 different attributes to provision each server and we have about 1,000 servers. I'm wondering whether we could get by by using Ansible's built-in mechanism

Re: [ansible-project] Using inventory variables from external inventory script to specify which other variables to use (like hiera)

2017-06-21 Thread William Saxton
Yeah, I'm currently playing around with exactly these things. I guess I'm looking for some best-practice guidance for how to handle this situation. I see a couple of ways people are handling these kinds of things...but none seem to be very elegant. I'm trying to talk my team into using

[ansible-project] set_fact adding unicode "[u' in front of new variable (2.3.1.0)

2017-06-21 Thread Alex White
I just recently updated to 2.3.1.0. I've used set_fact before the upgrade to set my AWS instance ID to a variable "coreaid". - name: Save instance ID to coreaid set_fact: coreaid: "{{ ec2_asg.instances }}" - debug: msg="the id= {{ coreaid }}" - name: Set the instance public IP to a

[ansible-project] Re: Trying to use selectattr to filter where attribute is not an empty list

2017-06-21 Thread mconlon
I just had this exact problem. Hopefully this is helpful to anyone else who comes across this thread. An empty list is falsey, so mylist|selectattr('list') should get what you're looking for, and mylist|rejectattr('list') would return elements that have an empty list. On Tuesday, July 5,

[ansible-project] Re: block/rescue is not rescuing ?

2017-06-21 Thread Bill L.
Nevermind, I found my own error for rescue just put command: ansible-playbook ###.yml Not sure what I was thinking. On Monday, March 20, 2017 at 6:43:36 AM UTC-5, Mike C wrote: > > Hi all, > > im having trouble with the block/rescue functionality. > > Here is my code: > > ``` > - block: >

[ansible-project] calling a play from a block

2017-06-21 Thread Bill L.
Does anyone know if there is a way to call a play from the rescue part of a block? I have tried the include: statement but that does not seem to work. --- - name: Error Catching hosts: localhost gather_facts: false connection: local tasks: - block: - debug: msg='i execute

[ansible-project] Ansible with programs that get installed into %userprofile%/AppData?

2017-06-21 Thread Bob Tanner
Anyone have recommendations (and/or example playbooks) that install programs that get installed into %userprofile%/AppData? I'm trying to install Slack with Ansible and win_chocolatey but I can only get Slack to install as the ansible_user. -- You received this message because you are

Re: [ansible-project] include uid with ansible entries in messages log

2017-06-21 Thread Dick Davies
Just checked; if you're SSHing in as a non-root user (vagrant here) and running the plays via become: then you'll see the sudo messages in /var/log/secure (on CentOS6; YMMV for other distros) and the task messages in /var/log/messages. (the playbook just checks the mysqld service is running,

Re: [ansible-project] include uid with ansible entries in messages log

2017-06-21 Thread Dick Davies
Sudoing to run Ansible on the control machine won't show up in the target server logs. If ansible sudos on the targets (i.e. you have become: yes in the plays) that should show up. On 21 June 2017 at 15:56, Steve Zimmerman wrote: > Hello, > I have an audit/security

Re: [ansible-project] Using inventory variables from external inventory script to specify which other variables to use (like hiera)

2017-06-21 Thread Dick Davies
I played around with 'flat file' variables and a dynamic inventory a while back; group variables seemed to override the inventory level ones. YMMV, check the precedence levels for vars for the version of Ansible you're running. On 20 June 2017 at 22:39, William Saxton wrote: >

Re: [ansible-project] Securing ansible - best practice?

2017-06-21 Thread Dick Davies
There's a few options. You can do a 'pre-seed' ssh key (added via Kickstart on in the VMware template; on AWS you'd add this as the instance is created). Ansible can use that to get in initially once the server is up and create more users/groups as desired. Another option would be a central key

Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Brian Coca
use a lookup? Brian Coca -- 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

Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Oğuz Yarımtepe
The password is being gathered by a curl command so it is dynamic. Is there a way to set ssh_pass variable dynamic? Like something to get from an environment variable? On Wed, Jun 21, 2017 at 8:23 PM, Brian Coca wrote: > You can set the ansible_ssh_pass variable, preferably

Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Brian Coca
You can set the ansible_ssh_pass variable, preferably in inventory. -- Brian Coca -- 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

Re: [ansible-project] Re: Facing Ansible bug & how to use the most recent Ansible branch with fixed code ?

2017-06-21 Thread Brian Coca
But in your error you were using (detached from v2.3.1.0-1)? -- Brian Coca -- 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

Re: [ansible-project] s3 module can create a bucket, but cannot list bucket contents

2017-06-21 Thread Michael Bushey
Thank you Kai, that is exactly what I was doing wrong. Have a great day! On Wednesday, June 21, 2017 at 5:37:04 AM UTC-7, Kai Stian Olstad wrote: > > On 21.06.2017 02:44, Michael Bushey wrote: > > - name: AWS Bucket get last SQL dunp > > hosts: localhost > > gather_facts: no > >

[ansible-project] Re: Synchronize via sudo -- no tty present and no askpass program specified

2017-06-21 Thread Guo Nosun
在 2015年10月5日星期一 UTC+8下午11:59:55,johhue写道: > > This will not work for us. We have to give the password as part of our > security rules. > > > > On Sunday, October 4, 2015 at 6:01:04 AM UTC-7, johhue wrote: >> >> Hello, I have seen many similar topics but want to make sure my issue is >> the

[ansible-project] include uid with ansible entries in messages log

2017-06-21 Thread Steve Zimmerman
Hello, I have an audit/security request to include the user id in the messages log for commands issued against a linux server. To illustrate, the commands are issued with as sudo: # sudo ansible --- results in /var/log/messages: Jun 19 00:01:13 usildng-ps-03 ansible-command: Invoked with

[ansible-project] Re: Will it work - async + poll + with_items + include ?

2017-06-21 Thread Aman Vidura
Hi Mumshad Mannambeth, Any update on this issue? Were you able to resolve it? Thanks! Aman. On Monday, September 19, 2016 at 8:46:59 AM UTC+8, Mumshad Mannambeth wrote: > > Hi, > > I am trying to run a long running task asynchronously and monitor results > at the end. (My target are not

[ansible-project] Ansible WinRM Connection 'Connection reset by peer' only when Windows Role ADFS/WAP is Installed and Post Configuration Finished

2017-06-21 Thread David Baumann
Hi i got a realy akward Problem with Ansible(devel) Got Multiple Servers and all works fine with WinRM and Kerberos on Ansible Side until i Install/Configure follow Windows Roles on hosts - Active Directory Federation Service - WebapplicationProxy All Servers are based on the Same VM

[ansible-project] Securing ansible - best practice?

2017-06-21 Thread Chris Jefferies
Hello. I'm looking around for a best practice tutorial or document that describes how to configure our ansible server to deploy our applications to about 20 servers at a time. We call this group of servers a track. We have a growing number of tracks. So I got Ansible installed but now I

[ansible-project] issue with Cisco ios-config

2017-06-21 Thread Thai Nguyen
Hi, I am trying to load a pretty long access-list to a Catalyst 3850 using Ansible ios-config module with the src option. - name: copy to the acl to target switches ios_template: src:a_test_acl.txt However it only works with the list with less than 378 entries. I can confirm that

[ansible-project] Re: Synchronize via sudo -- no tty present and no askpass program specified

2017-06-21 Thread Guo Nosun
Any Ideas, I met the same issue -- 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

[ansible-project] expected sudo prompt

2017-06-21 Thread reapsowrepeat
Hi, I hit a snag using "become/sudo". I can become/sudo to the root user if the prompt that is returned is as expected (I think). For example, here is the default prompt. *[sudo] password for testuser:* I think Ansible expects some variation of the prompt above to which it sends the

[ansible-project] Play the playbook unprivileged user

2017-06-21 Thread m . hippy . c
Hello! I need to play the playbook unprivileged user. The user is not allowed to use bin/sh and usr/bin/python. How to solve this? Help me please! -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

[ansible-project] ansible docker_service - how to specify user to run container

2017-06-21 Thread Mark Chassy
setup client installed with ansible 2.3.1.0 python version = 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] host: RHEL 7 installed with docker version 17.05.0-ce, build 89658be docker-compose version 1.13.0, build 1719ceb base image:

[ansible-project] taking more than 10 minutes to launch GCE from ansible

2017-06-21 Thread sakesh veerapaneni
Hi, it's taking more than 10 minutes to launch GCE instance with ansible, wiith existing custom image. What will be the problem? -- 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

[ansible-project] vmware_guest module

2017-06-21 Thread Martin Schiøtz
Hi I have testet the Ansible vmware_guest module against vCenter and ESXi 6.5 free trail version. Creating new vm guests based on templates works like a charm using vmware_guest module. As I understand vmware_guest uses the pyVmomi API: https://github.com/vmware/pyvmomi My question is which

[ansible-project] Re: Win_Service not working in handler?

2017-06-21 Thread David Baumann
is "Configure zabbix-agent" reporting a change ? Am Mittwoch, 21. Juni 2017 16:35:05 UTC+2 schrieb Onallion: > > Hi, > > I am running a playbook with a task that calls a handler like so: > - name: "Configure zabbix-agent" > win_template: > src: zabbix_agentd.conf.j2 > dest: C:\Program

[ansible-project] Using inventory variables from external inventory script to specify which other variables to use (like hiera)

2017-06-21 Thread William Saxton
Our current configuration management system stores hostnames and attributes for each of our systems, including things like "project" and "site". I'd like to use these attributes when determining which values to provision a system with using ansible, just like Puppet does with hiera. Right now

[ansible-project] Was my post eaten?

2017-06-21 Thread William Saxton
I posted a rather long post yesterday and it seems to have not yet been approved. Others have. Is there a reason for this? I would really hate to have to re-write it again... -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

[ansible-project] Re: Error in creating instance (Inner Exception: create() takes at least 4 arguments (9 given))

2017-06-21 Thread Charles Walker
I m having a similar issue on my side with ansible failling to create an instance based on a "shared" image. Same error message: "Inner Exception: Invalid imageRef provided." If we accept the image it will works fine but it is extra works for us and we are not facing the issue when we deploy

[ansible-project] Ansible 2.3.0 Connecting to Cisco IOS router

2017-06-21 Thread Patrick Matheny
I'm very new to Ansible. I have a small lab running and I'm trying to evaluate the use of Ansible for making network changes. I have a workstations running CentOS Linux release 7.3.1611 and Ansible 2.3.0 as a fresh install. I'm using a cisco 819 router running Cisco IOS Software, C800

[ansible-project] Have Ansible remote API?

2017-06-21 Thread Владислав Мещеряков
Hello. I have ansible server and a few target machines. I want to run ansible playbooks from target machine instead ansible server. Is there way to resolve my wish? Regards, Vlad. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

[ansible-project] Run playbook unprivileged user

2017-06-21 Thread m . hippy . c
Hello! I need to play the playbook unprivileged user. The user is not allowed to use bin / sh and usr / bin / python. How to solve this? Help me please! -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Oğuz Yarımtepe
So what do you suggest? Any other method to enter password at a bash script? On Wed, Jun 21, 2017 at 4:46 PM, Brian Coca wrote: > Ansible has tty detection which controls it's prompt behaviour, that > might be affecting your playbook. > > > -- > Brian Coca > > -- >

Re: [ansible-project] How can load an inventory file via a task within a playbook

2017-06-21 Thread ishan jain
Hi, This has to do how we are managing inventory as per project requirements. We have some quite elaborate structure and it is now tried and tested. What i am doing now is automating routines stuff with Ansible and this cannot result in changing the existing structure. I gotta find ways with

Re: [ansible-project] How can load an inventory file via a task within a playbook

2017-06-21 Thread Dick Davies
Why wouldn't you have a single repo in that case? You can have multiple inventory folders under the playbooks e.g. .├── roles < - common roles │ ├── bar │ └── foo ├── site.yml <- common playbooks ├── dev <- dev inventory │ ├── group_vars │ │ └── all │ └── hosts ├── prod <-

[ansible-project] Win_Service not working in handler?

2017-06-21 Thread Onallion
Hi, I am running a playbook with a task that calls a handler like so: - name: "Configure zabbix-agent" win_template: src: zabbix_agentd.conf.j2 dest: C:\Program Files\Zabbix Agent\zabbix_agentd.conf newline_sequence: '\n' trim_blocks: no notify: restart zabbix-agent The

Re: [ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Brian Coca
Ansible has tty detection which controls it's prompt behaviour, that might be affecting your playbook. -- Brian Coca -- 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,

Re: [ansible-project] Gathering facts in roles: Is it done multiple times?

2017-06-21 Thread Brian Coca
As Phillippe states, this is a PLAY level keyword (true by default), also the 'gathering' setting in ansible.cfg can change the behaviour. http://docs.ansible.com/ansible/intro_configuration.html#gathering So it does not matter how many files nor roles are included, just the number of Plays and

[ansible-project] Re: referencing the instance id of an EC2 resource just created

2017-06-21 Thread Bill L.
Hmm. That seems rather complex. Do you happen to know what the prescribed method of doing this is? Does Ansible recommend using add_hosts http://docs.ansible.com/ansible/add_host_module.html> module? On Tuesday, June 20, 2017 at 8:21:59 PM UTC-5, Michael Bushey wrote: > > I don't think this

Re: [ansible-project] Gathering facts in roles: Is it done multiple times?

2017-06-21 Thread Philippe Eveque
fact gathering is a play level directive (see http://docs.ansible.com/ansible/playbooks_keywords.html#play) from the doc: *gather_facts:* A boolean that controls if the play will automatically run the ‘setup’ task to gather facts for the hosts and one can run the setup module at anytime

[ansible-project] using ansible with spawn is preventing the inventory process

2017-06-21 Thread Oğuz Yarımtepe
Hi, I am using ansible-playbook at a script and passing password to t. Below is how i used it: run.sh #!/bin/bash ... /bin/expect <<- DONE spawn ansible-playbook -i $1 $2 -u $Username -k --become-user root --become-method sudo --become expect "SSH password: " send

Re: [ansible-project] s3 module can create a bucket, but cannot list bucket contents

2017-06-21 Thread Kai Stian Olstad
On 21.06.2017 02:44, Michael Bushey wrote: - name: AWS Bucket get last SQL dunp hosts: localhost gather_facts: no connection: local vars: bucket: myuniquebucketname tasks: - name: AWS get bucket list s3: bucket: "{{ bucket }}" mode: list register:

Re: [ansible-project] Gathering facts in roles: Is it done multiple times?

2017-06-21 Thread Frank Thommen
On 06/21/2017 11:01 AM, jean-y...@lenhof.eu.org wrote: Hi Frank, 21 juin 2017 10:29 "Frank Thommen" a écrit: Hi, from ansible's documentation I don't understand how ansible handles fact gathering when using roles: Are a host's facts gathered at each single

[ansible-project] Re: Facing Ansible bug & how to use the most recent Ansible branch with fixed code ?

2017-06-21 Thread P
# ansible --version ansible 2.4.0 (devel d79315e19e) last updated 2017/06/21 08:47:41 (GMT +000) config file = /root/ansible/ansible.cfg configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location =

Re: [ansible-project] Facing Ansible bug & how to use the most recent Ansible branch with fixed code ?

2017-06-21 Thread Brian Coca
All changes go through `devel`. -- Brian Coca -- 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

Re: [ansible-project] Gathering facts in roles: Is it done multiple times?

2017-06-21 Thread jean-yves
Hi Frank, 21 juin 2017 10:29 "Frank Thommen" a écrit: > Hi, > > from ansible's documentation I don't understand how ansible handles fact > gathering when using > roles: Are a host's facts gathered at each single playbook run? Or at each > "role" run? Or only >

[ansible-project] Facing Ansible bug & how to use the most recent Ansible branch with fixed code ?

2017-06-21 Thread P
Hi all, I am trying to use Ansible vmware_guest module to clone template to VM but having the following issue: fatal: [localhost -> localhost]: FAILED! => { "changed": true, "failed": true, "invocation": { "module_args": { "annotation": null,

[ansible-project] Gathering facts in roles: Is it done multiple times?

2017-06-21 Thread Frank Thommen
Hi, from ansible's documentation I don't understand how ansible handles fact gathering when using roles: Are a host's facts gathered at each single playbook run? Or at each "role" run? Or only once? In most cases one would want to gather facts only once in the beginning, but is this the