Re: [ansible-project] How can I pass a hash to a role?

2015-01-21 Thread Brian Coca
once you use shorthand mode you cannot regress to normal mode, this should work (or doing all in yaml normal): --- - hosts: webservers roles: - { role: app, role_var_1: somevalue, role_var_2: someothervalue, canidothis: { ENV_VAR_1: /some/path, ENV_VAR_1: /some/other/path}

[ansible-project] How can I pass a hash to a role?

2015-01-21 Thread Collin Allen
Hi folks, I'm running a playbook that makes use of a few custom roles, and one of them would benefit from being able to receive a YAML hash containing an arbitrary number of items (think: passing in a set of environment variables that should be set while running an executable). However, I'm fai

Re: [ansible-project] Re: EC2: collect list of private-ip from on group, use it in a second group

2015-01-21 Thread James Martin
Sorry, was a bit confused by your comment "What should I use in production instead of the first debug?" If you mean, not to use "debug" in your first task because it's too verbose, you don't have to. But using it is not going to harm anything even on production. If you want to do it in a less

Re: [ansible-project] Re: EC2: collect list of private-ip from on group, use it in a second group

2015-01-21 Thread Brian Coca
look at set_fact On Wed, Jan 21, 2015 at 4:26 PM, James Martin wrote: > Sorry, I'm not sure of a way to suppress that, outside of using a custom > filter. > > - James > > > On Wednesday, January 21, 2015 at 3:37:09 AM UTC-5, Tzach Livyatan wrote: >> >> Thanks James >> Works like a charm. register

Re: [ansible-project] Re: Ansible on gentoo linux, with both systemd and openrc installed

2015-01-21 Thread Brian Coca
the relevant changes are in the service module -- 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

[ansible-project] Re: EC2: collect list of private-ip from on group, use it in a second group

2015-01-21 Thread James Martin
Sorry, I'm not sure of a way to suppress that, outside of using a custom filter. - James On Wednesday, January 21, 2015 at 3:37:09 AM UTC-5, Tzach Livyatan wrote: > > Thanks James > Works like a charm. register is what I was looking for. > > What should I use in production instead of the first

[ansible-project] Re: Ansible on gentoo linux, with both systemd and openrc installed

2015-01-21 Thread Stefan Weichinger
yep, works: # ansible -i inventories/oops_nodes.yml -l hiro.local -m service -a "name=chronyd state=started" all hiro.local | success >> { "changed": false, "name": "chronyd", "state": "started" } curious for the diffs now ;-) -- You received this message because you are subscri

Re: [ansible-project] Ansible on gentoo linux, with both systemd and openrc installed

2015-01-21 Thread Stefan Weichinger
oops, groups runs TOFU? Am Mittwoch, 21. Januar 2015 21:40:34 UTC+1 schrieb Brian Coca: > > sorry, ansible's devel branch ... not gentoo devel. > > On Wed, Jan 21, 2015 at 3:39 PM, Brian Coca > wrote: > > check with gentoo devel, fixes to system detection were added as more > > and more distro

Re: [ansible-project] Ansible on gentoo linux, with both systemd and openrc installed

2015-01-21 Thread Brian Coca
sorry, ansible's devel branch ... not gentoo devel. On Wed, Jan 21, 2015 at 3:39 PM, Brian Coca wrote: > check with gentoo devel, fixes to system detection were added as more > and more distros run in 'mixed mode'. > > > > -- > Brian Coca -- Brian Coca -- You received this message because y

Re: [ansible-project] Ansible on gentoo linux, with both systemd and openrc installed

2015-01-21 Thread Brian Coca
check with gentoo devel, fixes to system detection were added as more and more distros run in 'mixed mode'. -- 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, se

[ansible-project] Ansible on gentoo linux, with both systemd and openrc installed

2015-01-21 Thread Stefan Weichinger
This is my first posting here, so pls be kind ;-) I learn my first steps with ansible for some weeks now and get some issues with the service-module. As some of you may know, on gentoo linux it is rather common these days to have both systemd and openrc installed at the same time. systemd as a

[ansible-project] Re: Ansible SSH as one user and Sudo as another

2015-01-21 Thread Stuart Budd
Thank you for the full reply Toshio I don't understand the comments regarding example 2 and can not get it to work. I will answer a separate question reference example 2 as I did for example 1 Thank you. On Thursday, 15 January 2015 16:53:04 UTC, Stuart Budd wrote: > > I am having trouble with

Re: [ansible-project] Different SSH keys for each host.

2015-01-21 Thread Dan Vaida
I don't believe it's possible to have that per host, via Ansible. But you could set it up in your ssh config. There were a few other threads in this mailing list about this topic. One would be: https://groups.google.com/d/msg/ansible-project/8p3XWlo83ho/Q1SflaZ9dyAJ On Wednesday, 21 January 201

Re: [ansible-project] Re: Standard user account used for initiating builds / rollouts using Ansible

2015-01-21 Thread Stuart Budd
Thanks for the reply Brian On Wednesday, 21 January 2015 14:08:56 UTC, Brian Coca wrote: > > The account usage is normally a constraint of your security > requirements, using a common account might be tidy but obscures > auditability. It is much easier to manage a single user's permissions >

[ansible-project] Re: How does Ansible know what account to use for the SSH connection and sudo

2015-01-21 Thread Stuart Budd
Got it. Thank you tkuratomi for the very informative answer. Cheers On Wednesday, 21 January 2015 16:25:06 UTC, Stuart Budd wrote: > > I do not understand how this example works for user *foo* > > If I have not stated the user account to use for the ssh connection within > the command line usi

[ansible-project] Docker Module. Defining Ports

2015-01-21 Thread Chip Selden
Hi, I'm trying to start Docker using the core module provided by Ansible and I'm running into issues defining ports forwarding. It is currently defined as: ports: "4:8185,40001:22,40002:61000" When the playbook runs, only port 22 gets exposed correctly. According to the output of docker

Re: [ansible-project] How does Ansible know what account to use for the SSH connection and sudo

2015-01-21 Thread Toshio Kuratomi
On Wed, Jan 21, 2015 at 8:25 AM, Stuart Budd wrote: > I do not understand how this example works for user foo > > If I have not stated the user account to use for the ssh connection within > the command line using:ansible_ssh_user=foo > or the Ansible host file:/etc/ansible/hosts > > I

Re: [ansible-project] Nore more landscape-common: nearly 30% speed increase with stock Ubuntu servers

2015-01-21 Thread Brian Coca
part of my 'base ubuntu bootstrapping' was removing the following: - landscape-client - landscape-common - whoopsie -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and st

[ansible-project] Re: How to use conditions in Playbook itself

2015-01-21 Thread Suraj
I think with this I am still setting every configuration related to one service in single var file so this way I am maintaining state of the service at one place and every common thing for all the services will be written in single playbook. On Wednesday, January 21, 2015 at 10:35:28 PM UTC+5:3

[ansible-project] Nore more landscape-common: nearly 30% speed increase with stock Ubuntu servers

2015-01-21 Thread Willem de Groot
My colleague Gertjan found out that purging landscape-common on Ubuntu Precise servers decreases our playbook execution time from 3m5s to 2m10s. Quite a win. I've put together a quick blog about it: https://www.byte.nl/blog/ansible-ubuntu-30-percent-speed-increase/ Cheers Willem -- You receiv

[ansible-project] Re: How to use conditions in Playbook itself

2015-01-21 Thread Jonathan Davila
Seems to be sort of an anti-pattern to do it this way. Referencing: https://groups.google.com/forum/#!msg/ansible-project/CPAE8_0YXMg/Az3Etfz7mP8J It sounds like a similar issue at the end. On Wednesday, January 21, 2015 at 11:48:55 AM UTC-5, Suraj wrote: > > Hi Folks, > > I am trying to cr

Re: [ansible-project] Re: Ansible SSH as one user and Sudo as another

2015-01-21 Thread Toshio Kuratomi
On Wed, Jan 21, 2015 at 8:05 AM, Stuart Budd wrote: > I still do not understand this. > > > Example 1: > > Ansible Local Server Remote server > local-01 remote-01 > --- > Local us

[ansible-project] How to use conditions in Playbook itself

2015-01-21 Thread Suraj
Hi Folks, I am trying to create single playbook for every service we have. So here we need to deploy multiple roles on different service instance. What I want is that, I want to just define variable in different group vars files and depending upon that variable, playbook should run the roles lik

Re: [ansible-project] Ansible trying to use "initctl" with CentOS 7

2015-01-21 Thread RJ Nowling
Thanks, Brian! Problem seems to be solved in the devel branch. On Wednesday, January 21, 2015 at 9:41:46 AM UTC-5, Brian Coca wrote: > > can you try using current devel, many fixes on detection were made there. > > > -- > Brian Coca > -- You received this message because you are subscribed t

[ansible-project] How does Ansible know what account to use for the SSH connection and sudo

2015-01-21 Thread Stuart Budd
I do not understand how this example works for user *foo* If I have not stated the user account to use for the ssh connection within the command line using:*ansible_ssh_user=foo* or the Ansible host file: * /etc/ansible/hosts* Is the current user account used as the ssh connection to a

[ansible-project] Dynamic inventory and group vars

2015-01-21 Thread Niko Felger
Hi, I've been using ansible for half a year and have been really happy with it so far, so first of all: thanks for all the great work on this project! We're moving from static to dynamic inventory, but I'm having trouble with loading group_vars and haven't been able to find out from the docs ho

[ansible-project] Re: Ansible SSH as one user and Sudo as another

2015-01-21 Thread Stuart Budd
I still do not understand this. Example 1: Ansible Local Server Remote server *local-01* remote-01 --- Local user *foo*--> ssh -->Remote user *foo* I do not unders

Re: [ansible-project] postgres_user usage

2015-01-21 Thread Brian Coca
ah, yes, i use 9.3 and 9.4 -- 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 gro

Re: [ansible-project] postgres_user usage

2015-01-21 Thread Jakub Veverka
Thanks for info, its my bad probably, because postgres 9.0 doesn't have REPLICATION role ... On Wednesday, January 21, 2015 at 4:07:18 PM UTC+1, Brian Coca wrote: > > i have very similar setup, except the role_attr_flags="'REPLICATION > LOGIN" and it works correctly. > > > > -- > Brian Coca

Re: [ansible-project] postgres_user usage

2015-01-21 Thread Brian Coca
i have very similar setup, except the role_attr_flags="'REPLICATION LOGIN" and it works correctly. -- 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 em

Re: [ansible-project] support passing new variables directly to the template module, but not only

2015-01-21 Thread Brian Coca
Not sure why you don't just set the vars at play level, they would be directly accessible by the template. -- 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

Re: [ansible-project] More information about host in the heading

2015-01-21 Thread Brian Coca
output is controlled by callback plugins, you can easily customize this be adding your own. http://docs.ansible.com/developing_plugins.html#callbacks -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this gro

[ansible-project] postgres_user usage

2015-01-21 Thread Jakub Veverka
Hi, I am trying to create replication user with following task: - name: Create replication db user postgresql_user: name: 'replication' encrypted: yes role_attr_flags: REPLICATION password: "{{ python_hash_test.stdout }}" sudo_user: "{{ postgresql_user_name }}" when: postgr

Re: [ansible-project] Re: Using Ansible on Ubuntu to stop+rm+run docker containers; getting an ssh error regarding docker socket

2015-01-21 Thread Brian Coca
Since there are not many reports of this problem, I don't think it is a general bug, specially since the involved technologies are in widespread use. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this gro

Re: [ansible-project] source input from a file (exp: package names and versions from an excel or a csv)

2015-01-21 Thread Brian Coca
you could use lookup('file', ...) and/or lookup('csvfile',) either directly or using with_ -- 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] Ansible trying to use "initctl" with CentOS 7

2015-01-21 Thread Brian Coca
can you try using current devel, many fixes on detection were made there. -- 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+uns

Re: [ansible-project] AWS_SECRET_KEY I need to rstrip('/r') on ubuntu or I get an error

2015-01-21 Thread Kesten Broughton
Hi Brian, Actually, no windows machine involved. I just go to the AWS manage keys and download the credentials.csv. Then copied and pased into an aws.ini file. I was using an ubuntu 14.04 machine. I'll see if i can reproduce on my mac. k On Friday, January 16, 2015 at 8:35:57 AM UTC-6, Brian Coc

Re: [ansible-project] Ansible sometimes encountered error 'SSH encountered an unknown error during the connection. '

2015-01-21 Thread Brian Coca
wait_for can check if a port is open, the ping module actually uses the ssh connection, it can be used with do/until to make sure the machine is up. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this gro

Re: [ansible-project] Re: Standard user account used for initiating builds / rollouts using Ansible

2015-01-21 Thread Brian Coca
The account usage is normally a constraint of your security requirements, using a common account might be tidy but obscures auditability. It is much easier to manage a single user's permissions than multiple users, shared passwords or sudo w/o a password can also be an issue. A case can be made f

[ansible-project] source input from a file (exp: package names and versions from an excel or a csv)

2015-01-21 Thread Sagayaraj A
I'm looking for a way to input names of packages (around 100+ packages - actually it's dynamic) and allow ansible to run a playbook against these packages (update or install etc). I can't seem to find anyway except by adding all the filenames into the playbook everytime using variables. Is ther

[ansible-project] Re: Using Ansible on Ubuntu to stop+rm+run docker containers; getting an ssh error regarding docker socket

2015-01-21 Thread Lim Soon Sim
I'm getting the same error as well but can't work out what the problem is. I'm running my playbook against an Ubuntu server on AWS and docker has been installed and in the path. So not sure why ansible thinks it can't find it. hope we get soe clarification on whether this is a bug with the modu

[ansible-project] Re: Run a single role in playbook

2015-01-21 Thread Pål Nilsen
You could always create a separate file with something like: - hosts: all roles: - role1 - role2 ansible-playbook -i hosts the_file_above.yml --limit host1,host2 It gets cumbersome to edit that file or create new ones all the time though, but I don't know of a better way. I always ta

Re: [ansible-project] support passing new variables directly to the template module, but not only

2015-01-21 Thread Evgeny Goldin
Hi, Were there any decisions taken since then? I also vote for being able to send variables when generating a template. Other solutions (parametrized roles or extra "set_fact" calls) look like heavy workarounds to a simple problem. - template: src: ... dest: ... vars: servi

[ansible-project] More information about host in the heading

2015-01-21 Thread Pål Nilsen
When running tasks Ansible will print the hostname it connected to as the heading. E.g. GATHERING FACTS *** ok: [ec2-eu-west-1.compute.amazonaws.com] If I use a static inventory file this will be the name in my hosts file, but

[ansible-project] Ansible trying to use "initctl" with CentOS 7

2015-01-21 Thread RJ Nowling
Hi all, I'm using Ansible with CentOS 7 images in Vagrant. I have the following task: - name: restart iptables action: service name=iptables state=restarted when: is_centos When it is run on the images, I get: failed: [slave0] => {"failed": true, "parsed": false} SUDO-SUCCESS-vukmjpqjkip

[ansible-project] Ansible sometimes encountered error 'SSH encountered an unknown error during the connection. '

2015-01-21 Thread 于杨
I am pretty sure the private key and user are correct for ansible script because we only occasionally see this error. So I suspect the network connection can not be reached sometimes or SSH service is not started on remote server. So before ansible playbook ran, I want to call ping module to ma

[ansible-project] Re: Help with Idempotent lineinfile regex

2015-01-21 Thread Magnus boden
Hello, After a lot of fiddling around I found a way to do it, I was also after a way to handle AllowGroups in sshd_config also that it shouldn't remove other groups in the line just make sure to add the new ones. The first one registers the current AllowGroups in a variable which is used by th

Re: [ansible-project] bug in lvg module?

2015-01-21 Thread Giovanni Tirloni
On Tue, 20 Jan 2015 04:06 -0800, Mark Maas wrote: > Hi List, > I’m trying to create an lvg using the lvg ansible module like so: > - name: Maak een vg-tc lvg: vg=vg.osddata.raven pvs=/dev/xvdb,/dev/xvdc state=present > > But I’m getting this error back: > failed: [10.220.225.96] => {"err": " D

Re: [ansible-project] Different SSH keys for each host.

2015-01-21 Thread junkmailtrapenator
Also is there a way to do the same thing with host_key_checking? I'd like to turn that off but only for a certain set of hosts (eg. dev hosts generated on the fly). On Tuesday, January 20, 2015 at 4:38:41 PM UTC-5, Matt Martz wrote: > > Via inventory you can set 'ansible_ssh_private_key_file' pe

[ansible-project] Re: Standard user account used for initiating builds / rollouts using Ansible

2015-01-21 Thread Stuart Budd
p.s. Nice product. On Wednesday, 21 January 2015 12:55:44 UTC, Stuart Budd wrote: > > Hi > > I have a general question please with regards to what account I should use > as the * standard * user for initiating Ansible deployments / rollouts. > > I know that the use of the term * standard * could

[ansible-project] Standard user account used for initiating builds / rollouts using Ansible

2015-01-21 Thread Stuart Budd
Hi I have a general question please with regards to what account I should use as the * standard * user for initiating Ansible deployments / rollouts. I know that the use of the term * standard * could be a little tricky, but in general, when starting a new environment at a new site what account

Re: [ansible-project] Re: Run a single role in playbook

2015-01-21 Thread Andrew Craft
yep but have to go through and do it for each role and each playbook i want to that, would be nice if there was something like an implicit tag for each role. On 21 January 2015 at 12:37, wrote: > You can tag your role just > like anything else. Doing

Re: [ansible-project] Different SSH keys for each host.

2015-01-21 Thread junkmailtrapenator
Thanks! Apparently I missed that when I was reading that list. On Tuesday, January 20, 2015 at 4:38:41 PM UTC-5, Matt Martz wrote: > > Via inventory you can set 'ansible_ssh_private_key_file' per host. See > http://docs.ansible.com/intro_inventory.html#list-of-behavioral-inventory-parameters >

[ansible-project] Re: Run a single role in playbook

2015-01-21 Thread junkmailtrapenator
You can tag your role just like anything else. Doing so effectively runs the role as if every task inside the role has the tag. roles: - role: myCoolRole, tags: tagsAreCool On Wednesday, January 21, 2015 at 6:03:34 AM UTC-5, Andrew Craft w

[ansible-project] Run a single role in playbook

2015-01-21 Thread Andrew Craft
In the same way that you can use tags to target specific tasks in a large playbook, is it possible to filter by roles? Tags are useful but often find i am tagging all tasks in a role with same tag so i can run just those, would be nice if I could use roles in a similar way to filter as tags? th

[ansible-project] Re: EC2: collect list of private-ip from on group, use it in a second group

2015-01-21 Thread Tzach Livyatan
Thanks James Works like a charm. register is what I was looking for. What should I use in production instead of the first debug? I need the data, not the output to the screen. On Tuesday, January 20, 2015 at 5:47:12 PM UTC+2, James Martin wrote: > > Here's a quick sample playbook that should do