Re: [ansible-project] Re: unarchive module: creates does not work

2014-12-10 Thread Toshio Kuratomi
Yeah, that would be a bug. Probably best to open a bug report on github so we can look into it and not forget. -Toshio On Dec 10, 2014 8:38 AM, wrote: > Thanks for the suggestion. But to my knowledge I don't have any other > checkouts or packages installed. I even ran `sudo apt-get purge ansibl

Re: [ansible-project] using multiple dynamic inventory scripts at once

2014-12-10 Thread Brian Coca
this is dependent on implementation of the inventory scripts, they can return all host information with --list, if they do not ansible has to call them per host also. On Wed, Dec 10, 2014 at 6:27 PM, Florin Andrei wrote: > Okay, I placed both inventory scripts in ~/ansible/inventory and it works.

[ansible-project] inconsistant when accessing fact attributes

2014-12-10 Thread Steve Kieu
Hi Team, When I first create a docker container which is centos6 based. Run ansible setup and the fact return for "ansible_selinux" is a boolean. After a while not sure what has been done if runs setup again - the value now is a dict. "ansible_selinux": { "status": "disabl

Re: [ansible-project] Ansible hosts configuration using private key and sudo user

2014-12-10 Thread Adithya Khamithkar
Thanks Mirko, But I want to login with my user name which needs a private key and execute sudo. I am not sure how do i define this on the hosts file could you please help me with this. Thanks, On Wednesday, December 10, 2014 6:35:04 PM UTC+5:30, Mirko Friedenhagen wrote: > > Hello, > > the ans

Re: [ansible-project] using multiple dynamic inventory scripts at once

2014-12-10 Thread Florin Andrei
Okay, I placed both inventory scripts in ~/ansible/inventory and it works. The command opens an ssh connection to each host on both clouds. But, again, spying the process tree list while ansible is running, I've noticed something odd. (BTW, all runs are done after clearing the caches for both i

Re: [ansible-project] using multiple dynamic inventory scripts at once

2014-12-10 Thread Matt Martz
Ansible supports inventory directories. If you place both ec2.py and digital_ocean.py in a directory called "inventory", you could then use: ansible -i ~/ansible/inventory -u my-special-user -f 20 -s \* -m shell -a 'ps' You could then also call each inventory script separately if you needed. O

Re: [ansible-project] Ansible multiple SSH logins

2014-12-10 Thread Matt Martz
I imagine what you are in need of is ControlPath, ControlMaster, ControlPersist. Those should be the default if you are using the 'ssh' transport. Using the 'paramiko' transport will not invoke those options. What OS and OpenSSH client version do you have on the control machine? You should addi

[ansible-project] using multiple dynamic inventory scripts at once

2014-12-10 Thread Florin Andrei
New to Ansible, just testing it. For now, I'm using dynamic inventory scrips, and I'm trying to run simple commands on all hosts, via ansible. I've setup ec2.py and digital_ocean.py in ~/ansible/, and both scripts work just fine. Provisioned with the correct credentials, if I run either script

[ansible-project] Re: HowTo: Add string to an existing quoted string in file using lineinfile

2014-12-10 Thread Mischa ter Smitten
You can use updatedb -e. You can see it in action over here . -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop rec

Re: [ansible-project] rax_scaling_group fails to create scaling group

2014-12-10 Thread Matt Martz
The issue is due to the values for the loadbalancer ID and loadbalancer port needing to be integer values. In your case, when referencing variables, they are being passed in as strings. I've made an update to the module and created a pull request that I will merge soon: https://github.com/ansibl

Re: [ansible-project] Unexpected "Item is undefined"

2014-12-10 Thread Serge van Ginderachter
On 10 December 2014 at 21:41, Capi Etheriel wrote: > Hi folks > > I got kind of stuck with > https://gist.github.com/barraponto/a14c264a7755c8371ade > ​kast line(13) in the task file, the indent of with_items is wrong: with_items: aws_vpc_subnets ​ ​Indent should be the same as the na

[ansible-project] Unexpected "Item is undefined"

2014-12-10 Thread Capi Etheriel
Hi folks I got kind of stuck with https://gist.github.com/barraponto/a14c264a7755c8371ade It's in a role as you can see. I've gisted the only files I edited in it. The problem is it says item is not defined: fatal: [localhost] => One or more undefined variables: 'item' is undefined I'm running

[ansible-project] rax_scaling_group fails to create scaling group

2014-12-10 Thread David Goodall
Hi, Following the example here http://docs.ansible.com/rax_scaling_group_module.html#examples fails with the message pasted at the end. Versions: ansible 1.8.2 pyrax-1.9.3 Playbook: tasks: - name: Load Balancer create request rax_clb: credentials: ~/.rax.creds name: LB Test

[ansible-project] Re: Passing register variable to a role called by playbook?

2014-12-10 Thread jimmy
Quick correction on this. I pasted the wrong data where it says "name: allocate a new elastic IP without associating it to anything" The play actually looks like this: - name: Associate a new Elastic IP to instance ec2_eip: region=us-east-1 in_vpc=yes "instance_id={{ item }}" wit

[ansible-project] Passing register variable to a role called by playbook?

2014-12-10 Thread jimmy
I am launching one-off ec2 instance for development purposes and in the main playbook I am launching an EC2 instance then assigning an elastic IP. Once all of that is done I am configuring the server via a role. I am able to capture the elastic IP via register but how do I call it from the role?

[ansible-project] Re: Directory always marked as changed

2014-12-10 Thread Mirko Friedenhagen
This is the output when run with -: TASK: [jenkins | Ensure jenkins .m2 directory does exist.] ESTABLISH CONNECTION FOR USER: mirko REMOTE_MODULE file group=jenkins state=directory path=/var/lib/jenkins/.m2/ owner=jenkins EXEC ssh -C -vvv -o ControlMaster=auto -o Con

[ansible-project] Directory always marked as changed

2014-12-10 Thread Mirko Friedenhagen
Hello, I have the following in a role definition for jenkins: - name: Ensure jenkins .vnc directory does exist. file: path: /var/lib/jenkins/.vnc/ state: directory owner: jenkins group: jenkins mode: 0750 Whenever I run the playbook, this directory creation is always marked

Re: [ansible-project] sysctl.conf

2014-12-10 Thread Toshio Kuratomi
Yeah, I just noticed that backup actually does exist on a lot of the file-like modules. I just hadn't noticed them before. So yeah, adding a backup parameter that does the same thing for sysctl seems like a good idea. Could you open a pull request if you can code it or an issue if you can't so t

Re: [ansible-project] Extends variables in yaml

2014-12-10 Thread Brian Coca
ansible is not a programming language, variables are really pretty static, they can be overwritten but not really modified. If you want to create a new list that has the contents of 2 other lists, look at the set theory filters: with_items: packages|union(extra_packages) that should give you wha

Re: [ansible-project] Extends variables in yaml

2014-12-10 Thread Mirko Friedenhagen
What about: Extending a list? In Python-Syntax group_vars/all.yml: packages = ["a", "b"] host_vars/host1.yml: packages.extend(["c", "d"]) Endresult for packages for host1: ["a", ""b", "c", "d"] Is this possible in yaml? Regards Mirko -- http://illegalstateexception.blogspot.com/ https://gith

Re: [ansible-project] Gather facts fails regardless if conditional is met for roles

2014-12-10 Thread phil toohill
This is a great tip! Seems to be working as expected now, Thank you On Wednesday, December 10, 2014 9:43:19 AM UTC-6, Matt Martz wrote: > > So roles are evaluated after the top level portions of the play. > > I would do something such as using add_host to add deleted servers to an > in memory gr

Re: [ansible-project] Re: unarchive module: creates does not work

2014-12-10 Thread bry111
Pardon the reply to myself but I've stumbled upon a lead. If I use YAML module parameters, like - unarchive: src: 'file.zip' dest: '/foo' creates: '/foo/bar' then the creates check never works, as described previously (the unarchive itself still works but it doesn't check for file e

Re: [ansible-project] Re: unarchive module: creates does not work

2014-12-10 Thread bry111
Thanks for the suggestion. But to my knowledge I don't have any other checkouts or packages installed. I even ran `sudo apt-get purge ansible`, and before I reinstalled I - verified that `find /usr/ -name '*ansible*'` output nothing - deleted /etc/ansible on the control machine - delete

[ansible-project] User playbook questions/issues

2014-12-10 Thread nfavor
I love ansible and I think I just need help getting around a few things. 1. If I specify GCOS or shell attributes and the account is not present. It will fail the first time it's ran, but will be apply the GCOS and/or shell the second time it's ran. (RHEL6.6) Is it normal to behave this way? I'

Re: [ansible-project] sysctl.conf

2014-12-10 Thread Mzp45
I was thinking an implementation along the lines of the "lineinfile" module where you can edit a file and create a backup at the same time. For the sysctl module if you have to edit a sysctl.conf file then a backup seems like a good failsafe. On Tuesday, December 9, 2014 7:08:46 PM UTC-5, tkur

Re: [ansible-project] Extends variables in yaml

2014-12-10 Thread Toshio Kuratomi
Could you give an example of what you want to achieve?I think that would make your question clearer. Thanks, Toshio On Dec 9, 2014 5:20 AM, "Micael Malta" wrote: > I have a question: How to extends variables: > > In group_vars/all, i have a variable config and i want in > host_vars/my_server to

Re: [ansible-project] Gather facts fails regardless if conditional is met for roles

2014-12-10 Thread Matt Martz
So roles are evaluated after the top level portions of the play. I would do something such as using add_host to add deleted servers to an in memory group that you could use for exclusion later. Such as something like: - hosts: local gather_facts: False tasks: - name: Create or delete ser

Re: [ansible-project] How to join list in Yml

2014-12-10 Thread Toshio Kuratomi
Not sure I understand the question. {{ list|join(",")}} will join a list using jinja2 which is available in playbooks. But you already wrote that so you know that already... Could you clarify? -Toshio On Dec 9, 2014 5:20 AM, "Micael Malta" wrote: > i have to get dynamic variables in config: >

[ansible-project] Gather facts fails regardless if conditional is met for roles

2014-12-10 Thread phil toohill
# Issue Type: Bug Report # Ansible Version: 1.8.2 # Environment: OSX 10.8.5 # Summary: Fact gathering fails when cloud module deletes server and roles play is called with a when conditional. # Steps To Reproduce: Assuming utilization of a cloud module such as 'rax', you ca

Re: [ansible-project] Role Dependency Not Being Executed

2014-12-10 Thread Jamal B
Yeah, I realized that I could try it shortly after firing off this email. Thanks On Tuesday, December 9, 2014 6:25:16 PM UTC-5, tkuratomi wrote: > > It should, yes. I just tested in your sample repo -- removing the > dependencies for compA and compB and then adding a new role for > app-common:

Re: [ansible-project] Ansible hosts configuration using private key and sudo user

2014-12-10 Thread Mirko Friedenhagen
Hello, the ansible_ssh_user is the one you use for logging in via SSH, not the one you switch to when sudoing Regards Mirko -- Sent from my mobile On Dec 9, 2014 10:49 PM, "Adithya Khamithkar" wrote: > Hi I have written a playbook for Ansible to install a few application. I > am having trouble

[ansible-project] Vagrant Ansible Provisioner failing to ssh to guest machine

2014-12-10 Thread Mehul Ved
I am working on setting up Ansible provisioning with Vagrant. Here's what the relevant configuration looks like http://pastebin.com/Tr6DPsY2 And here's the output http://pastebin.com/bDgWPHmY I am not sure why is it failing when private key file is given in the command line, if I give ansible_ssh_p