[ansible-project] Re: How to persist variables/facts in ansible?

2015-09-04 Thread Takeshi Yaegashi
Hello, You can use hostvars[hostname] to get facts set by other hosts. play_hosts array is also useful. The following playbook collects root's SSH public keys from all hosts, then distributes keys back to all hosts. --- - hosts: all sudo: yes gather_facts: no vars: pubkeys: |

Re: [ansible-project] Use Custom Modules with Many Playbooks

2015-09-04 Thread Brian Coca
Put them in a common role and make the plays that need them include this role. -- 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-proje

Re: [ansible-project] How do I handle different machines needing different user accounts?

2015-09-04 Thread Brian Coca
i would write the users and their info in 1 file users.py: allusers; username: uid: 123 fullname: username2: uid: 321 and then for each host just list the users that have access, either in host_vars/hostname.yml: myusers: - username - u

[ansible-project] Better way to specify path to binary?

2015-09-04 Thread James Lucas
Hello: I've been using the 'pkgutil' extras module to install packages on some Solaris machines. Roles I've been working with that use the module will fail if '/opt/csw/bin' is not in the servers' PATH environment variable. It's easy enough to work around by doing something like this in roles th

Re: [ansible-project] Re: Ansible 2.0 os_server 404 image not found

2015-09-04 Thread Robyn Bergeron
On Fri, Sep 4, 2015 at 1:26 PM, V Benincosa wrote: > Thanks a bunch Monty for looking into that. Using the clouds.yaml file > didn't work for me. Same error with 404. I instead hacked shade to make > it work. > > in def get_session_endpoint in the shade __init__ I added a sub to get rid > of t

[ansible-project] Use Custom Modules with Many Playbooks

2015-09-04 Thread Evan Cowden
We're exploring a somewhat different use case for Ansible and I'm trying to figure out if there's an existing feature for module management that I'm missing. Our use case would require several custom modules being used by many people in many different environments. Is there a good way to share

[ansible-project] How do I handle different machines needing different user accounts?

2015-09-04 Thread T N
Hi, Can't find an answer to this. The Ansible documents talk about "How do I handle different machines needing different user accounts or ports to log in with?", and other things, but I can't see how to address what we're trying to do from the information and zillions of searches I've done o

Re: [ansible-project] Host filter / patterns

2015-09-04 Thread esco real
Maybe I overlooked something.. But wouldn't that be the same as "staging:production:&app"? esco -- 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

[ansible-project] Ansible 1.9.4 rc1 is now available for testing

2015-09-04 Thread James Cammarata
Hi all, we've just tagged the rc1 release for 1.9.4. Unfortunately a bug was identified in the yum module after the release of 1.9.3, which impacts enough users that we'll be doing this release sooner rather than later. To test from source, simply clone the git repository (if you haven't already)

Re: [ansible-project] [ansible-devel] Re: Ansible 2.0.0 alpha is ready for testing!

2015-09-04 Thread James Cammarata
Yes, we decided to stick with the block/rescue/always syntax so as not to confuse things, and it does make things a bit easier internally to python to not use reserved keywords for variable names. James Cammarata Director, Ansible Core Engineering github: jimi-c On Sun, Aug 30, 2015 at 7:57 AM, A

[ansible-project] Ansible 2.0 alpha2 is ready for testing!

2015-09-04 Thread James Cammarata
Hi all, Ansible 2.0 alpha2 is available for download and testing. Please see the original announcement for 2.0-alpha1 for background on this upcoming release: https://groups.google.com/forum/#!topic/ansible-announce/3e1pohu1XlQ How do you get it? -

Re: [ansible-project] Re: Ansible 2.0 os_server 404 image not found

2015-09-04 Thread V Benincosa
Thanks a bunch Monty for looking into that. Using the clouds.yaml file didn't work for me. Same error with 404. I instead hacked shade to make it work. in def get_session_endpoint in the shade __init__ I added a sub to get rid of the v1: if service_key == 'image': endpoint = re.su

[ansible-project] Question about how template lookups work

2015-09-04 Thread Luis Medina
Hi everyone, Apologies for the long post. I'm trying to run a playbook that does a lookup on a template to populate a variable. This variable is then passed into a role that the playbook is using. The results that I'm getting, however, were not quite what I thought they would be. For context, I

Re: [ansible-project] Re: Ansible 2.0 os_server 404 image not found

2015-09-04 Thread Monty Taylor
Sorry for your troubles. The problem is almost certianly in the v1/v2 version detection. I think we can do better for you here. However, in the mean time - would you mind trying something to test a hypothesis? Make a ~/.config/openstack/clouds.yaml with: clouds: metacloud: auth: use

Re: [ansible-project] Re: List of Ansible default variables

2015-09-04 Thread James Morgan
Yep that does indeed sound like what I need. Will give it a shot Many thanks -- 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...@goog

Re: [ansible-project] Re: List of Ansible default variables

2015-09-04 Thread Brian Coca
You seem to want the play_hosts variable (current active hosts in current play). On Fri, Sep 4, 2015 at 12:44 PM, James Morgan wrote: > Ok thanks, > > I think I will need to pass it through from the playbook, the issue is that > on a flat deployment where every group has the same host, when I use

[ansible-project] Failling to create ec2 root volume with indicated size on spinning up instnce

2015-09-04 Thread Joseph Djomeda
Hello All, I have been struggling with the past 3 hours trying to figure out why my ubuntu ec2 instances are not been created with the specified volume size. I have been following the documentation http://d ocs.ansible.com/ansible/ec2_module.html

Re: [ansible-project] Re: List of Ansible default variables

2015-09-04 Thread James Morgan
Ok thanks, I think I will need to pass it through from the playbook, the issue is that on a flat deployment where every group has the same host, when I use group_names I get all possible groups, not the one currently being handled. This meant that I ended up with a duplicate list of about 12 h

Re: [ansible-project] Host filter / patterns

2015-09-04 Thread Bouke
i see.. so the only way to solve it is by creating a new group like "stage_or_production" and then filter by "app:&stage_or_production"? my suggestion for implementing logical groups: hosts: - app:&stage - app:&production meaning (app AND stage) OR (app AND production) On Friday, August 21

Re: [ansible-project] Re: Ansible 2.0 os_server 404 image not found

2015-09-04 Thread V Benincosa
I've done some more debugging on this and it looks like shade is putting an extra v1 in the URL so it looks like: http://some.client.metacloud.net:9292/v1/v1/images/detail?limit=20 I ended up changing the glanceclient/v1/images.py by removing all the v1s. This solved the ansible problem, but

Re: [ansible-project] Re: List of Ansible default variables

2015-09-04 Thread Brian Coca
current_host = inventory_hostname current_group = no singular, we always flatten to host, you can check the current host's groups in "group_names" list of the current host current_user = lookup('env', 'USER') ? current_task = nothing represents the current task .. since you are in the current task

[ansible-project] Re: win_updates not working

2015-09-04 Thread Peter Mounce
Hi - I've not seen what you're experiencing, but I've only used this against Windows 2012r2 servers. Perhaps PSWindowsUpdate behaves differently there? Alternatively, it may be that the surface area for my windows update exposure is smaller than yours - each month I trigger a build of an AWS AM

[ansible-project] Re: List of Ansible default variables

2015-09-04 Thread James Morgan
Sorry to bring this up again. Was there an answer for - current group? I appreciate that I can find the groups that are set for a host but I need to know what the current group that is being acted on. The group is defined in the playbook but I need to loop over the hosts for that group in a tem

[ansible-project] Re: win_updates not working

2015-09-04 Thread Dimitri Yioulos
Many thanks. I'll set up the logPath parameter, and post my findings early next week. I'm hopeful about the module's use. I, like many others, work in a heterogeneous (Win/Linux) environment, so having Ansible work well with both OSs would be a great thing. Dimitri On Wednesday, September 2

[ansible-project] Re: win_updates not working

2015-09-04 Thread Trond Hindenes
I think the problem relates to the PsWindowsUpdate module that Ansible uses. I haven't played much with it, but it may have some bugs. According to the code in the ansible module, it should never reboot without warning, but instead report back to Ansible wether a reboot is required or not (and

[ansible-project] Re: win_updates not working

2015-09-04 Thread Dimitri Yioulos
Trond, Thanks so much for your post. Let me start by posting some info: Ansible host: CentOS 6.x Ansible ver.: 1.9.1 Windows servers: 2008 R2 PSWindowsUpdate: previously installed. Oddly, I found that I had to re-register PSWindowsUpdate with Powershell (it's possible I forgot this s

Re: [ansible-project] expect module does not work with multiple prompts

2015-09-04 Thread Edgars
Thanks a lot Matt, it worked. I was confused a bit because I saw that p/expect actually found the match (both of them), so I did not think that it could be regex issue Thanks again Edgars piektdiena, 2015. gada 4. septembris 14:01:06 UTC+2, Matt Martz rakstīja: > > I believe the problem is th

Re: [ansible-project] expect module does not work with multiple prompts

2015-09-04 Thread Matt Martz
I believe the problem is that pexpect treats all matches as regex. You have specified '#?' which means the # is optional, effectively making the regex an empty string. An empty string matches anything, so pexpect will send the response for '#?' for everything. You probably want: responses:

[ansible-project] expect module does not work with multiple prompts

2015-09-04 Thread Edgars
Hi I have this task: tasks: - expect: command: /path/to/bash/script.sh responses: '#? ': '5' "[y/N]": 'y' expect module correctly responds to first prompt, but not to second. It responds to second prompt with '5' when it should respond with 'y'. When I