[ansible-project] Ansible vsphere_guest: "pysphere module required" - but it's installed

2016-10-28 Thread Jeff Richards
Hi, I'm trying to kick off a VMware deployment, using the vsphere_guest module, but it's failing with "pysphere module required". So pip confirms it's installed: $ pip list | grep sphere pysphere (0.1.7) And I can access the module: $ python -c "import pysphere" $ echo $? 0 I have vsphere_gues

[ansible-project] Re: Change user while executing ansible script.

2016-10-28 Thread Nitin Mathur
Can you please provide an example or reference?? On Friday, October 28, 2016 at 1:16:19 PM UTC-7, Alexander H. Laughlin wrote: > > If you store the password in a vaulted file I believe you can use su as > the become method and accomplish this result. > > On Friday, October 28, 2016 at 12:45:24 P

[ansible-project] Re: Tower: setup.sh fails trying to find yum on Ubuntu

2016-10-28 Thread Alexander H. Laughlin
Ubuntu requires some special attention . The answer isn't to install yum on your poor Ubuntu machine, but instead to make sure the install script i

[ansible-project] Re: Change user while executing ansible script.

2016-10-28 Thread Alexander H. Laughlin
If you store the password in a vaulted file I believe you can use su as the become method and accomplish this result. On Friday, October 28, 2016 at 12:45:24 PM UTC-7, Nitin Mathur wrote: > > Hi, > > I am trying to figure out, if the below scenario is possible and if so, > how I can achieve it.

Re: [ansible-project] passing parameters to roles

2016-10-28 Thread Kai Stian Olstad
On 28. okt. 2016 20:53, Neil Watson wrote: My intention is to pass it to the role not redefine it. What do you suggest? You have a few options. You don't need to pass them to the role, variables is global so you can use them directly in the role, image.one.state and image.one.path. Instead o

[ansible-project] Change user while executing ansible script.

2016-10-28 Thread Nitin Mathur
Hi, I am trying to figure out, if the below scenario is possible and if so, how I can achieve it. My target machine and ansible host is the same machine. There are 2 users, user-1(non-sudo privilege), user-2 (sudo privilege). Both user-1 and user-2 have passwords. I am logged in to my Ansible

Re: [ansible-project] passing parameters to roles

2016-10-28 Thread Neil Watson
My intention is to pass it to the role not redefine it. What do you suggest? On Friday, October 28, 2016 at 2:44:32 PM UTC-4, Kai Stian Olstad wrote: > > On 28. okt. 2016 18:56, Neil Watson wrote: > > Greetings, > > > > I'm trying to pass a data structure to a role, but it's not working out. >

Re: [ansible-project] passing parameters to roles

2016-10-28 Thread Kai Stian Olstad
On 28. okt. 2016 18:56, Neil Watson wrote: Greetings, I'm trying to pass a data structure to a role, but it's not working out. What have I done wrong? main.yml: --- - hosts: localhost vars: image: one: state: present path: /usr/src roles: - { role: test, image:

Re: [ansible-project] Re: Getting hostvars from an intersection of groups

2016-10-28 Thread Dan Rough
Thanks Josh. That's useful to know about. I have one of the situations that the README describes - I have some kit at Rackspace, and some on a dedicated server elsewhere. At the moment, I store all the inventory files in a directory, inventories. When I run a playbook I provide the directory as

Re: [ansible-project] Re: Getting hostvars from an intersection of groups

2016-10-28 Thread Dan Rough
Hi, Immediately after sending this mail I got an answer to this question from another source - a user called sivel on the #ansible IRC channel. I thought that I would put the answer here in case others hit a similar problem. I had one of the [0] in the wrong place, which meant that I was lookin

Re: [ansible-project] Re: Getting hostvars from an intersection of groups

2016-10-28 Thread Josh Smift
If you want to solve this a very different way, ansible-quartermaster has a "metagroups" feature that allows you to create groups of hosts in inventory based on various criteria, like the value of a variable; so you can do things like get a prod-web group for the hosts that are in both prod and web

Re: [ansible-project] Re: Getting hostvars from an intersection of groups

2016-10-28 Thread Dan Rough
Mehul / Karen, Did you ever get anywhere with this? I have just arrived at the same problem and am looking for a solution too. When I run: ansible prod -i ./inventories/rax.py -c local -m debug -a var="{{ hostvars[groups['prod']|intersect(groups['monitoring_servers'])][0].rax_addresses['intern

[ansible-project] Re: Kerberos Delegation Issues

2016-10-28 Thread Matt Davis
You mentioned you were using ansible 2.1.0 and that you'd switched to group_vars- that version has an inventory bug where any ansible_winrm_X connection vars are ignored if they live in group_vars. Either upgrade to at least 2.1.1, or move them back. Also, try doing a raw: klist on the Windows

Re: [ansible-project] Juniper Network Automation using Ansible Tower Network Credentials

2016-10-28 Thread Peter Sprygada
You are using the Juniper modules distributed from Galaxy which are not compatible with Tower today. The only modules that work with Tower credentials are the Junos modules in core. On Fri, Oct 28, 2016 at 1:00 PM, Lance Le Roux wrote: > I am trying to use the network credentials in Ansible Tow

[ansible-project] Re: Kerberos Delegation Issues

2016-10-28 Thread Surred
Apologies for the delayed response... I've been looking for ways to work around this issue, but I hit a roadblock so I really need to figure this out. Below are the logs from the server hosting the network share. Apparently the login was successful, but it was as an anonymous user using NTLM. I

[ansible-project] Juniper Network Automation using Ansible Tower Network Credentials

2016-10-28 Thread Lance Le Roux
I am trying to use the network credentials in Ansible Tower however it doesn't seem to work. I am using variable ANSIBLE_NET_USERNAME and ANSIBLE_NET_PASSWORD however they don't exist when I run my template. playbook.yaml --- - name: Get Device Facts hosts: all roles: - Juniper.junos c

[ansible-project] passing parameters to roles

2016-10-28 Thread Neil Watson
Greetings, I'm trying to pass a data structure to a role, but it's not working out. What have I done wrong? main.yml: --- - hosts: localhost vars: image: one: state: present path: /usr/src roles: - { role: test, image: "{{ image.one }}" } roles/test/task

Re: [ansible-project] How-to Variable in Variable

2016-10-28 Thread Kai Stian Olstad
On 28. okt. 2016 11:26, bonheur.s...@gmail.com wrote: Hi everyone I'm new to Ansible and I'm trying to automate the generation of Cisco router configuration files. For the same config template, I will have several hardware models and I'd like to keep the code simple. #main.yml (roles tasks) -

Re: [ansible-project] How can I debug my inventory? I need something like: ansible-playbook -i staging/ --list-vars

2016-10-28 Thread Kai Stian Olstad
On 28. okt. 2016 11:15, Stéphane Klein wrote: I try to refactor my inventory files, how can I test / debug / check my inventory? I need something like: ansible-playbook -i staging/ --list-vars Maybe "ansible -i staging/ -m debug -a var=vars" In var= you can use vars, hostvars, groups, group_n

[ansible-project] Re: Passing a list in a list to loop

2016-10-28 Thread Neil Watson
Turns out published_ports can take a string too, so use: published_ports: 53:53,53:53/udp instead of published_ports: - 53:53 - 53:53/udp On Friday, October 28, 2016 at 9:40:04 AM UTC-4, Neil Watson wrote: > > Greetings, > > Below is an example of a playbook to manager some docker contain

[ansible-project] Re: Ansible cron module creates jobs for the wrong user

2016-10-28 Thread Nick Santamaria
I have run into a similar issue. System info below: host: OS X Sierra target: Ubuntu 16.04 $ ansible --version ansible 2.1.2.0 The following task results in a cron entry for the *root* user, not the *ubuntu *user. --- - hosts: all become: yes become_method: sudo tasks: - name: Examp

[ansible-project] Passing a list in a list to loop

2016-10-28 Thread Neil Watson
Greetings, Below is an example of a playbook to manager some docker containers. I've built a data structure that my tasks can loop over. The trouble is that one task attribute, published_ports requires a whole list, but when I pass is a list it only gets one element. How can I fix this? var

[ansible-project] Re: Tower: setup.sh fails trying to find yum on Ubuntu

2016-10-28 Thread Ivan Kirkpatrick
Same problem here for me. Even installed yum on a fresh install of Ubuntu 14.04.5 and verified yum version was 3.4.3. -- 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

[ansible-project] How-to Variable in Variable

2016-10-28 Thread bonheur . sorn
Hi everyone I'm new to Ansible and I'm trying to automate the generation of Cisco router configuration files. For the same config template, I will have several hardware models and I'd like to keep the code simple. #main.yml (roles tasks) --- - name: Generate configuration files template: sr

[ansible-project] How can I debug my inventory? I need something like: ansible-playbook -i staging/ --list-vars

2016-10-28 Thread Stéphane Klein
Hi, I try to refactor my inventory files, how can I test / debug / check my inventory? I need something like: ansible-playbook -i staging/ --list-vars Best regards, Stéphane -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe f

Re: [ansible-project] roles configuring other roles?

2016-10-28 Thread Dick Davies
I have the exact same issue with my nagios generation experiment ( here if anyones interested - https://github.com/rasputnik/ansible-autonagios/issues/2 I use a sub-template per group to assemble a single .cfg per host, see the bottom of https://github.com/rasputnik/ansible-autonagios/blob/mast

[ansible-project] Re: Copying whole directory from amazon S3 using ansible

2016-10-28 Thread Sirk Johannsen
You can do this in 2 steps: 1. *s3: * * bucket: "{{bucket_name}}"* * prefix: "{{path_to_download}}" * * s3_url: "{{amazon_s3_url}}* * mode: list* *register: s3list* 2. *s3:* * bucket: "{{bucket_name}}"* * object: "{{ item }}" * * s3_url: "{{amazon_s3_url}}* * dest: "{{ destination

[ansible-project] How to get ansible sequence number of running

2016-10-28 Thread harold T
Here is run.yml and rozofs.yml, I want to get the sequence number of each running. there is 4 IP address, 90,91,92,93, I want to know where I can get 1,2,3,4 from each running. I am use "echo " to put each IP address, I want to the sequence number too. $ run.yml hosts: "{{ store }}"

[ansible-project] Re: Ansible module ec2_ami_copy

2016-10-28 Thread Cvijan Uros
Hi John, Thank you for reply. 1) yes, it is all lower case, you will see in the playbook itself. 2) ansible-playbook --version ansible-playbook 2.2.0.0 config file = /etc/ansible/ansible.cfg configured module search path = Default w/o overrides This is installed on separate server for te

Re: [ansible-project] AWS AMIs and Launch configuration UserData

2016-10-28 Thread James
Hi Stephen Thanks for the info. So in your case, do you install dependencies on an AMI and then run Ansible locally to setup environment specific variables etc, or do you run the whole build on startup via the Launch config? I'm trying to get away from having builds per environment, as current