Re: [ansible-project] Force re-read of dynamic inventory script?

2014-11-17 Thread Tomasz Kontusz
It should be possible to write something like that as an action plugin. The only problem I see would be: what to do with group_vars? Michael Peters napisał: >You could try abstracting out the logic into a separate script that >both your inventory and your provisioning playbook could call to >det

Re: [ansible-project] next version?

2014-11-17 Thread Brian Coca
Yves, The current devel branch should become 1.8 this month. -- 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...@goo

[ansible-project] next version?

2014-11-17 Thread Yves Dorfsman
What will the next version of ansible be? 1.8? Asking to be able to add go documentation (add in version x). Thanks. -- Yves. http://yves.zioup.com gpg: 4096R/32B0F416 -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from th

Re: [ansible-project] Force re-read of dynamic inventory script?

2014-11-17 Thread Michael Peters
You could try abstracting out the logic into a separate script that both your inventory and your provisioning playbook could call to determine which groups to put it in. I agree that it's a bit of a pain. I'd really like to have this be possible as well since it would really simplify some workflows

Re: [ansible-project] Force re-read of dynamic inventory script?

2014-11-17 Thread Josh Smift
JBS> This email is intended for the person(s) to whom it is addressed and JBS> may contain information that is PRIVILEGED or CONFIDENTIAL. KEJ> (sigh). Really??? Really?? Surely nobody uses that legalese rubbish KEJ> noise anymore? Surely not. I can't explain where that text came from. Probably n

Re: [ansible-project] Force re-read of dynamic inventory script?

2014-11-17 Thread Josh Smift
MP> No, but you can add the machine to the necessary groups when you use MP> add_host after its created. Yeah, I can mostly do this; the tricky thing is that there are some derived groups that the host gets added to based on logic in the dynamic inventory script. I could in theory duplicate that l

[ansible-project] Looping over JSON output from Arista

2014-11-17 Thread Leo Izbicki
I'm playing with Ansible+Arista and I'm able to receive JSON back about the arista device. As an example, I am looking at interface status. While I am able to receive and display information about a single value/pair from the array, how can I loop to receive information on every item in the arra

Re: [ansible-project] Run a task only if a variable is defined

2014-11-17 Thread rektide
On Mon, Nov 17, 2014 at 10:29:07AM -0800, Simón Muñoz wrote: > Hi all, > > I'm trying to run a task only if a variable is defined (for example, I have > some groups where it's defined and some others where it's not). I got to > this (adding when: nginx_sites), that seems to work, but just asking

Re: [ansible-project] Force re-read of dynamic inventory script?

2014-11-17 Thread Karl E. Jorgensen
Hi On Mon, Nov 17, 2014 at 04:57:21PM -0500, Josh Smift wrote: > I feel like I've seen questions like this on the list before, but I'm > having a hard time finding one now; apologies if this is old ground. > > I've got a playbook that provisions a new Rackspace Cloud host, and then > includes a r

[ansible-project] Re: deploying with ansible

2014-11-17 Thread Michael DeHaan
Thanks! As for tests, definitely not - integration tests submitted with modules are great to have. On Mon, Nov 17, 2014 at 4:38 PM, Ramon de la Fuente wrote: > All clear. It was a bit presumptuous to make a guide but I felt the amount > of explanation needed for the module’s concepts where ou

Re: [ansible-project] Force re-read of dynamic inventory script?

2014-11-17 Thread Michael Peters
No, but you can add the machine to the necessary groups when you use add_host after its created. On Mon, Nov 17, 2014 at 4:57 PM, Josh Smift wrote: > I feel like I've seen questions like this on the list before, but I'm > having a hard time finding one now; apologies if this is old ground. > > I'

[ansible-project] Force re-read of dynamic inventory script?

2014-11-17 Thread Josh Smift
I feel like I've seen questions like this on the list before, but I'm having a hard time finding one now; apologies if this is old ground. I've got a playbook that provisions a new Rackspace Cloud host, and then includes a role specific to that type of host. In that role, there are some templates

Re: [ansible-project] modprobe_module, when setting state=present, where is it saved for adding the module at next boot ?

2014-11-17 Thread Stefan Eriksson
Hi thanks for the reply, yes indeed if this is true then it seems pretty pointless, you shouldnt be expected to run ansible instantly after a reboot right? I'll have to use copy and copy a rc.modules file instead. Den måndagen den 17:e november 2014 kl. 21:44:20 UTC+1 skrev Michael DeHaan: > > T

[ansible-project] Re: deploying with ansible

2014-11-17 Thread Ramon de la Fuente
All clear. It was a bit presumptuous to make a guide but I felt the amount of explanation needed for the module’s concepts where out of place in the module itself (not being actual parameters or examples). I’ll reformat and remove the guide. Would the tests also fall under the strange precedent

Re: [ansible-project] Ansible and continuous integration

2014-11-17 Thread Michael DeHaan
Long answer: Yes, probably between 1/4 and 2/3 of this list are doing these sort of things. These may be good starting points: http://docs.ansible.com/test_strategies.html It looks like my Continuous Deployment (different - it's a next level thing from CI) meetup talk isn't online - but in gene

Re: [ansible-project] template error

2014-11-17 Thread Michael DeHaan
Sounds like there's a bug that should be filed - Can you please share the full ansible-playbook output from the above so we can see it in context though? That message *may* be coming from Docker. On Tue, Nov 11, 2014 at 4:58 PM, simonq wrote: > I get* template error while templating string:

Re: [ansible-project] Re: Using group module; "Failed to find required executable groupadd"

2014-11-17 Thread Michael DeHaan
Yes, -c local will force every host in your playbook to run locally. It's good for a simple playbook targetting localhost, but you shouldn't do it in general with playbooks targetting your whole infra. Glad you figured it out! On Wed, Nov 12, 2014 at 1:55 PM, Joshua Burke wrote: > Hello All,

Re: [ansible-project] howto use multiple environments with multiple groups?

2014-11-17 Thread Michael DeHaan
This is a common misconception. All groups that a host are in apply to the host during a run. This is because groups may imply physical location, purpose, hardware type, and more, while you may only be selecting them by say, purpose. On Wed, Nov 12, 2014 at 11:20 AM, Tristan van Bokkem < trist

Re: [ansible-project] Ansible Galaxy filter roles by platform

2014-11-17 Thread Michael DeHaan
I agree this would be useful. We have a list of features to add to Galaxy in the future - though currently we're prioritizing development on the main project instead. Look for some upgrades in the coming months. On Thu, Nov 13, 2014 at 1:03 AM, Will Thames wrote: > Would it be possible to ad

Re: [ansible-project] YAML quoting problem

2014-11-17 Thread mtovey
I naturally tried using backslash to escape the quotes since that is pretty much the standard in scripting, but that just resulted in the backslash getting embedded into the result: lineinfile: dest=/etc/mail/sendmail.mc state=present regexp='SMART_HOST' line="define(\`SMART_HOST\', \`

Re: [ansible-project] EC2 module: state=present always returns 'wait for instances running timeout'

2014-11-17 Thread Dave Stern
Is there any way to get more debugging than `ansible-playbook -` provides? I'd like to know if it's a network issue, ssh, or something else and the instance is terminated before I can test it. On Monday, November 17, 2014 3:29:34 PM UTC-5, Michael DeHaan wrote: > > Not that I'm aware of. > >

Re: [ansible-project] Provision with Ansible from inside Docker

2014-11-17 Thread Michael DeHaan
Thanks for sharing! Related articles for those interested: http://www.ansible.com/blog/official-ansible-content-on-docker-hub http://ansible.com/docker On Thu, Nov 13, 2014 at 2:25 AM, Victor Lin wrote: > Hey guys, > > I am using Ansible and Docker in a very interesting way, I think it would

Re: [ansible-project] Re: Use included circles and expressions in 'with_items' and 'when' statement

2014-11-17 Thread Michael DeHaan
Generally ansible frowns upon usages that are too "code-like" and tries to find some other ways to solve them that are easier to read. Can we talk about your underlying use case that you are trying to model, to suggest an alternative, easier approach? On Thu, Nov 13, 2014 at 5:28 AM, Александр

Re: [ansible-project] Allocating a private IP for an EC2 instance fails

2014-11-17 Thread Michael DeHaan
Can you please share what version of Ansible, the output of your ansible playbook, and how it fails? Thanks! On Thu, Nov 13, 2014 at 5:59 AM, Dan Vaida wrote: > Hello all, > > I am creating a VPC with two subnets, a security group and trying to use > those for launching an EC2 with a private

Re: [ansible-project] how to filter an item list - with_items filter using RegEx ?

2014-11-17 Thread Michael DeHaan
If you are attempting to talk to only certain instances, usage of the host group specifier "hosts:" is the way to do it. To talk to all instances ending in that pattern - hosts: *_k The docs also show how to combine patterns and negate them. (The group_by module can also be used to create group

Re: [ansible-project] failed_when - multiple conditions

2014-11-17 Thread Michael DeHaan
Multiple checks looks like: failed_when: color == 'blue' or number == 5 Note that if you are telling when not to fail, you will need to negate your condition. Ansible denotes lists of conditions as "ORs" so: failed_when: - color == 'blue' - number == 5 Is equivalent syntax. On Thu, No

Re: [ansible-project] Re: Defining Actions to be run in the event of Failure for a Host

2014-11-17 Thread Michael DeHaan
Hi all, As discussed previously on this list, the idea of blocks will be coming to a future release of Ansible. The 'v2/' subtree refactoring is intended to enable such capabilities as try/except type blocks. Until then, the "when" feature, along with ignore_errors, etc, is available. On Fri,

Re: [ansible-project] where to manage common inventory properties

2014-11-17 Thread Michael DeHaan
I like using group_vars and host_vars for these things, though it should be noted it's a good idea to keep your production and dev inventory in different files, to avoid the chance of doing "-i inventory.ini" against the all group and managing them simultaneously. On Fri, Nov 14, 2014 at 4:18 AM

Re: [ansible-project] 1.8 release date

2014-11-17 Thread Michael DeHaan
"(once a month or so this summer)" Not the case. Major releases typically come about every 2-3 months, on average. Occasionally we have had to include dot releases to roll up some major fixes, but are not currently under that sort of scenario. Our current plan is to release sometime this month.

Re: [ansible-project] Suggestions for organization of small project

2014-11-17 Thread Michael DeHaan
Please do not cross-post. On Thu, Nov 13, 2014 at 12:44 PM, wrote: > Hi, this is going to be a cross post to both ansible and salt user groups. > I've spent the last few months going through the docs for both projects and > I know both fairly well. In both cases, the major issue I've stumbled >

Re: [ansible-project] Ansible Vault tries to Decode Irrelevant Files

2014-11-17 Thread Michael DeHaan
Ansible doesn't know what variables you are going to use in a template up front, so any group or host variable in the configuration will be loaded. You may wish to move your secured files to something like (toplevel) production.yml and do a ansible-playbook site.yml -e @production.yml and reduce

Re: [ansible-project] Re: gp2 volumes with ec2_vol

2014-11-17 Thread Michael DeHaan
Pull requests to enhance docs would be welcome - we're staging a hackfest to provide some better tutorials soon, but to some extent what keys are valid is a function of which Boto libraries you have. So mostly it's showing examples On Fri, Nov 14, 2014 at 6:09 PM, Yves Dorfsman wrote: > > New i

Re: [ansible-project] Important BugFix for ControlPersist on RHEL/CentOS 6.6

2014-11-17 Thread Michael DeHaan
Much rejoicing! On Fri, Nov 14, 2014 at 7:19 PM, Strahinja Kustudić wrote: > Red Hat has finally fixed the bug with ControlPersist on RHEL 6.6 which > causes Ansible to fail to connect on first try and some other strange > behavior. So if you are using RHEL/CentOS 6.6 as your management host,

Re: [ansible-project] django_manage

2014-11-17 Thread Michael DeHaan
Can you please explain more about your question? Thanks! On Sat, Nov 15, 2014 at 4:06 PM, 'Diogene Laerce' via Ansible Project < ansible-project@googlegroups.com> wrote: > Hi, > > It seems that syncdb --all is an open ticket for now. Is there a way > to do this with the present code ? > > Than

Re: [ansible-project] Running ansible from jenkins execute shell

2014-11-17 Thread Michael DeHaan
I'm not sure I'm following, can you clarify exactly what your issue is? The start of this thread was about how to pass variables. On Sat, Nov 15, 2014 at 5:23 PM, Toshio Kuratomi wrote: > What does your execute shell look like with Damir's workaround? Were > you also able to see the values o

Re: [ansible-project] How to use Ansible to log in a machine just for creating a home directory

2014-11-17 Thread Michael DeHaan
The user module has a flag to create the homedir. In any case, manually executing SSH with ansible is weird, and not something I'd want to see in most playbooks, Toshio here I think was proposing this for a debugging case, but don't do this :) You could of course simply execute the whoami with th

Re: [ansible-project] executable custom fact

2014-11-17 Thread Michael DeHaan
INI files are presently supported for local facts and are parsed with Python's ConfigParser. On Sun, Nov 16, 2014 at 12:09 PM, Toshio Kuratomi wrote: > Michael can correct me if I'm wrong but I believe we're moving more > and more to json for communicating between modules and ansible core. >

[ansible-project] Re: deploying with ansible

2014-11-17 Thread Michael DeHaan
Thanks for this! My first thought is try to clean up the examples section so there's no "..." ... make something real world in there, and seperate it out by use case. I would not like to see a seperate guide for this module as it sets a bit of a strange precedent, so it would be better to just sh

Re: [ansible-project] YAML quoting problem

2014-11-17 Thread Michael DeHaan
A good trick with the lineinfile module is almost always to use the template module if you can :) The problem here is if you start something with a quote, it assumes that quote is not part of the string and then will end the quote. Thus you might find it easier to just escape quotes with \" or \'

Re: [ansible-project] modprobe_module, when setting state=present, where is it saved for adding the module at next boot ?

2014-11-17 Thread Michael DeHaan
The modprobe module is part of ansible-modules-extras, which means it's a bit newer or less fleshed out than some modules. This doesn't actually save anything but just runs the modprobe commands. So you would want to use this system and also drop something in modprobe.d. This should probably be

Re: [ansible-project] Ansible + Jenkins

2014-11-17 Thread Michael DeHaan
An alternative, which you may like, is to install Ansible Tower, and then use ansible-tower-cli in your shell step. It makes integration with Jenkins a one liner. It will get you nicer output, particularly for a larger number of hosts, than Jenkins, and also some nice ways to edit inventory and i

Re: [ansible-project] stat path meta character and register best practice

2014-11-17 Thread Michael DeHaan
The stat module cannot take fileglobs, and must check a specific asset. What you have with the test is probably reasonable. On Fri, Nov 14, 2014 at 3:12 PM, faust wrote: > Hi, > is it possible to use the stat module with meta characters: > - stat: path=/etc/rc2.d/S*init_script.sh > register

Re: [ansible-project] Ansible --connection=local

2014-11-17 Thread Michael DeHaan
What's the output of "ansible --version" ? On Sat, Nov 15, 2014 at 1:31 AM, Steve Porter wrote: > Having a bit of an issues with a Packer/Ansible/Vagrant build pipeline. I > have been using Ansible for a while and can happily provision my dev VMs > via Ansible. > > I have hooked Packer in the

Re: [ansible-project] Ansible on Freebsd with pkgng

2014-11-17 Thread Michael DeHaan
If it makes sense, I'd be quite open to whatever it takes to make 'latest' work here. It is, I will say, not a primary OS for us -- but it's one we're definitely committed to enabling development on. On Sun, Nov 16, 2014 at 1:42 PM, Marcus Jaschen wrote: > On 12.11.14 22:11, Laurentius Purba

Re: [ansible-project] Interactive commands

2014-11-17 Thread Michael DeHaan
Basically this isn't going to end well. The 'raw' module is useful for sending to devices that look like Unix shells, but some things are too weird to work this way. The right way to go with Cisco is going to be to get modules speaking to OnePK or NXOS APIs - similar to what has happened with Jun

Re: [ansible-project] EC2 module: state=present always returns 'wait for instances running timeout'

2014-11-17 Thread Michael DeHaan
Not that I'm aware of. Anyone else seeing similar problems? On Mon, Nov 17, 2014 at 3:17 PM, Dave Stern wrote: > We've had a task to create EC2 instances running with no changes for > weeks. Suddenly sometime after Thu Nov 13 04:11:43 UTC 2014, the module > would timeout on all requests to cr

Re: [ansible-project] Multiple inventory sources

2014-11-17 Thread Michael DeHaan
I don't think as inventory directories are an existing thing. That being said, any alternative way of managing inventory you want can be built using an inventory script. On Fri, Nov 14, 2014 at 4:00 PM, Thomas Quinot wrote: > Redirecting from -devel as advised. > > On Fri, Nov 14, 2014 at 6:1

[ansible-project] EC2 module: state=present always returns 'wait for instances running timeout'

2014-11-17 Thread Dave Stern
We've had a task to create EC2 instances running with no changes for weeks. Suddenly sometime after Thu Nov 13 04:11:43 UTC 2014, the module would timeout on all requests to create new instances. This happens on both Mac OS X and on Ubuntu. I've updated to the latest ansible, boto, awscli, etc.

Re: [ansible-project] Run a task only if a variable is defined

2014-11-17 Thread Michael DeHaan
You can do this: when: foo is defined On Mon, Nov 17, 2014 at 1:29 PM, Simón Muñoz wrote: > Hi all, > > I'm trying to run a task only if a variable is defined (for example, I > have some groups where it's defined and some others where it's not). I got > to this (adding when: nginx_sites), th

[ansible-project] Re: Need guidance with multi-level role variables

2014-11-17 Thread Willard Dennis
This is what I was looking for! Thanks! - Will On Monday, November 17, 2014 5:31:22 AM UTC-5, Tore Olsen wrote: > > Hi Willard, > > Keeping information in one place, is there a reason why you cannot change > it_users to be dictionaries? > > it_users: > - { name: bill, uid: 501, passwd: hash, h

[ansible-project] Run a task only if a variable is defined

2014-11-17 Thread Simón Muñoz
Hi all, I'm trying to run a task only if a variable is defined (for example, I have some groups where it's defined and some others where it's not). I got to this (adding when: nginx_sites), that seems to work, but just asking in case there is a better way. - name: Enabling nginx sites accordi

Re: [ansible-project] How to simulate user first login.

2014-11-17 Thread Tomasz Kontusz
Wouldn't running `su - USER -c true` suffice? Andrew Latham napisał: >For directory (LDAP, etc..) based authentication you can create the >home directory and copy the skel over to it. Validating permissions of >course. > >On Mon, Nov 17, 2014 at 7:26 AM, Greg Andrews >wrote: >> What about creati

[ansible-project] Multiple inventory sources

2014-11-17 Thread Thomas Quinot
Redirecting from -devel as advised. On Fri, Nov 14, 2014 at 6:19 AM, Thomas Quinot wrote: > As far as I understand the current state of source code, ansible_hosts > can be: > * the path to a dynamic inventory program > * the path to a static inventory file > * the path to an inventory dire

[ansible-project] Interactive commands

2014-11-17 Thread Thomas Quinot
Redirecting from -devel as advised... On Thu, Nov 13, 2014 at 2:27 PM, Thomas Quinot wrote: > I am considering managing some network equipment (switches) with the > 'raw' module. This requires sending commands to the switch in an > interactive session (command streamed before receiving the switc

Re: [ansible-project] Ansible + Jenkins

2014-11-17 Thread Manuel Jesús Recena Soto
Hello Alex, As Torsten said you, you can use "Shell buildstep" and invoke your playbook (Ansible). At ClinkerHQ (Hosted CI service based on Jenkins) you can available Ansible Playbook. Disclaimer: I work at ClinkerHQ. Regards, On 15 November 2014 09:47, Torsten Reinhard wrote: > Hi, > > why do

[ansible-project] Ansible --connection=local

2014-11-17 Thread Steve Porter
Having a bit of an issues with a Packer/Ansible/Vagrant build pipeline. I have been using Ansible for a while and can happily provision my dev VMs via Ansible. I have hooked Packer in the the pipeline and now with the same Ansible scripts in local mode I am getting failures on conditional check

[ansible-project] stat path meta character and register best practice

2014-11-17 Thread faust
Hi, is it possible to use the stat module with meta characters: - stat: path=/etc/rc2.d/S*init_script.sh register: i - debug: msg="Path is a simlink" when: i.stat.islnk Or what is the elegant way of doing the following (without breaking the very useful 'ansible-playbook --check' feature): -

Re: [ansible-project] Ansible on Freebsd with pkgng

2014-11-17 Thread Marcus Jaschen
On 12.11.14 22:11, Laurentius Purba wrote: > Hello all, > > I have question regarding pkgng for FreeBSD. > > The idea is I was trying to update php on one of our development > servers. The current php version installed is 5.4.28, while we have on > the port (/usr/ports/lang/php5) is 5.4.34. > >

Re: [ansible-project] How to simulate user first login.

2014-11-17 Thread Andrew Latham
For directory (LDAP, etc..) based authentication you can create the home directory and copy the skel over to it. Validating permissions of course. On Mon, Nov 17, 2014 at 7:26 AM, Greg Andrews wrote: > What about creating the user's home directory when you create the user's > account? Will that

[ansible-project] Re: Ansible + Jenkins

2014-11-17 Thread J Hawkesworth
You can use 'Publish over SSH' module to call a remote system running ansible. Configure your ansible host in Jenkins -> Manage Jenkins -> Configure System Then you can add a post build action called 'Send Build artifacts over ssh'. Select your ansible host and then in the Transfers section, spe

Re: [ansible-project] How to simulate user first login.

2014-11-17 Thread Greg Andrews
What about creating the user's home directory when you create the user's account? Will that not work? It would eliminate the need to perform the extra step of logging in as the user and then logging back out again. On Fri, Nov 14, 2014 at 8:28 AM, wrote: > My virtual machine has a setting that

Re: [ansible-project] groupname as variable?

2014-11-17 Thread Brian Coca
ok, but you are just defining the master node in one host, you probably want group_vars: [idc1_node:vars] cluster_master=host1 [idc1_node] host1 host2 host3 -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe fro

[ansible-project] Re: Need guidance with multi-level role variables

2014-11-17 Thread Tore Olsen
Hi Willard, Keeping information in one place, is there a reason why you cannot change it_users to be dictionaries? it_users: - { name: bill, uid: 501, passwd: hash, home: /home/bill } - { name: fred, uid: 501, ... } - { name: sam, ... } Now you can access these items in the user module or

Re: [ansible-project] SSH connections to EC2 hang sporadically

2014-11-17 Thread Tore Olsen
Hi Wawrzek, Thanks for your response. I believe my problem may have been caused by SSH connections being silently broken by NAT. I just added "ServerAliveInterval 50" to my ~/.ssh/config file and will see how it works out. Regular SSH connections would sometimes fail with a broken pipe, but of

[ansible-project] modprobe_module, when setting state=present, where is it saved for adding the module at next boot ?

2014-11-17 Thread Stefan Eriksson
Hi Its unclear where the modprobe module save the settings, I cant find a list of modules to load att boot in /etc/modprobe.d/ There's also no info about this in the module website. for example kernel_blacklist says: blacklist_file,use this blacklist file instead of /etc/modprobe.d/blacklist-an

Re: [ansible-project] SSH connections to EC2 hang sporadically

2014-11-17 Thread Wawrzek Niewodniczanski
I'm checking output of your commands on the phone in the bus so I could miss something, but it looks like ssh is actually fine. Have you try to debug on remote host? Have you compare ansible with normal ssh? Cherers, Wawrzek On 11 Nov 2014 12:54, "Tore Olsen" wrote: > Hello, > > I'm having prob

Re: [ansible-project] How to simulate user first login.

2014-11-17 Thread Wawrzek Niewodniczanski
Hi, Not tested idea from a bus I'm going to work right now : try login into existing account and then try to sudo to new account. Cheers, Wawrzek On 14 Nov 2014 17:31, wrote: > My virtual machine has a setting that when the first time a user logs in, > it creates a home directory for the user a