Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Brian Coca
in this case the version of python on ansible machine should not matter, the module executes on the target machine. The version of ansible might matter as many changes were made to hostname module, I'm using 2.0/devel from git. -- Brian Coca -- You received this message because you are subscrib

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
What version Ansible are you using? I only have the AWS instance (no other installs) I provisioned today that's 7.1 right now, but it's the latest one to have failed. I am wondering if the version of python on my control machine would make a difference. I don't know why it would, but it's odd that

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Brian Coca
just tested on a new 7.1 vm and hostname module works w/o any issues. -- 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+unsubsc

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Brian Coca
So i checked again, i had misread the code it does not match class name but the declared distribution variable inside, this SHOULD match all versions of Centos. On Fri, Nov 13, 2015 at 4:01 PM, Joanna Delaporte wrote: > There's a class for 'Centos' at line 449, and another for 'Centos linux' at >

[ansible-project] Sudo via ansible error

2015-11-13 Thread Ovidio B.
Greetings, I've created a simple playbook that adds some packages to an ubuntu system. I'm using packer with the ansible provisioner to get things setup but I keep getting hit with the following error message in verbose mode: virtualbox-ovf: failed: [127.0.0.1] => (item=apache2,git,php5,php5-

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
There's a class for 'Centos' at line 449, and another for 'Centos linux' at line 458, if you are looking at the Hostname module. On Friday, November 13, 2015 at 5:40:43 PM UTC-6, Brian Coca wrote: > > so from the code, this should work when ansible_distribution": > "CentOS" but not when ansible_

Re: [ansible-project] ansible and dependencies

2015-11-13 Thread Brian Coca
you are using the same registered var in several tasks, the last one will overwrite the previous ones, you might want to create a diff var per task and then have a aggregated one. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" grou

[ansible-project] Re: ansible and dependencies

2015-11-13 Thread Joanna Delaporte
I'm not sure I understand what you are asking for...by design, a playbook (and therefore a role) will stop processing if any task fails. So, it is implicit that the next task won't happen unless the previous one succeeds. Also, it looks like you are trying to change the hostname...is that corre

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Brian Coca
so from the code, this should work when ansible_distribution": "CentOS" but not when ansible_distribution": "CentOS Linux" -- 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 email

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
Oh, good. You found something that makes sense as a cause for this problem! I'm still not sure why it worked for Gregswift earlier, and not me, though. Joanna On Friday, November 13, 2015 at 5:09:09 PM UTC-6, Brian Coca wrote: > > he... 'CentOS Linux' != 'CentOSLinux' > > we might just need to

Re: [ansible-project] msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
Hi Greg, Did it work for you this morning? I just tried with the same version of ansible control machine and host target and it still failed for me. On Friday, November 13, 2015 at 12:48:07 AM UTC-6, Greg Swift wrote: > > So I have no idea why the ostname module would be behaving like that. >

Re: [ansible-project] Get email alert if async task runs for more than XX mins/hours?

2015-11-13 Thread Brian Coca
you can set a subsequent task to poll for it and have that use until/retry up to that limit, then register a result, next task can conditionally mail depending on that result -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Brian Coca
he... 'CentOS Linux' != 'CentOSLinux' we might just need to strip spaces in the detection. -- 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 ans

[ansible-project] ansible and dependencies

2015-11-13 Thread Stuart Cracraft
Hi - trying to ensure I can make tasks dependent on prior task successes in roles inside playbooks. So far it doesn't happen. I'm using a combination of register/when. What is the method within a series of tasks in a role's tasks/main.yml to make one dependent upon the prior one's running as su

[ansible-project] git clone is pointing to a local repo when is should point to an external

2015-11-13 Thread Joel Bremson
> > Enter code here... > - name: Git Clone > # Clone the local repo. Getting to github is tricky. > git: repo=https://github.com/jbremson/SG_ASP.git dest="{{ scheduler_code > }}" version="rq" force=yes > - file: path="{{ scheduler_code }}" owner="{{ scheduler_user }}" > recurse=yes > # What

[ansible-project] Ansible 2.0 Beta 3 is available for testing

2015-11-13 Thread James Cammarata
Happy Friday the 13th all, we're happy to announce the third beta of 2.0 is available for testing! This will hopefully be the final beta before we do our first release candidate for 2.0, so please help us test things out! This beta includes some tweaks to help performance when operating with very

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
TASK: [ansible-ipaserver | Hard set the hostname] * failed: [2] => {"failed": true} msg: hostname module cannot be used on platform Linux (Centos linux) failed: [5] => {"failed": true} msg: hostname module cannot be used on platform Linux (Centos linux) failed

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
And the new AWS host also failed. TASK: [ansible-ipaserver | Hard set the hostname] * failed: [216.125.253.72] => {"failed": true} msg: hostname module cannot be used on platform Linux (Centos linux) failed: [52.10.173.105] => {"failed": true} msg: hostname module can

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
I was wrong about CentOS 7.1 not being available...it is now the CentOS version you can get on AWS, as of fairly recently. I am about to test it now. On Friday, November 13, 2015 at 3:18:40 PM UTC-6, Joanna Delaporte wrote: > > Interestingly, my ubuntu laptop also responds with just "Linux" to t

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
Interestingly, my ubuntu laptop also responds with just "Linux" to the platform.system() call. Unfortunately, it appears that I cannot get CentOS 7.1 yet on AWS...I think Gregswift mentioned that worked for him today. I could test it next week at work with a physical install to identify the is

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
HI Brian, Thanks! Both hosts had the same responses. Here's the result: >>> print(platform.system()) Linux >>> print(platform.linux_distribution()) ('CentOS Linux', '7.0.1406', 'Core') >>> print(platform.dist()) ('centos', '7.0.1406', 'Core') So, if the module is first looking at platform.syste

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Brian Coca
the 'magic' gets done in the load_platform_subclass, which matches the platform name to a class of the same name + Hostname, which then sets the strategy class, which actually implements the way of updating hostname. to figure out platform name it uses platform.system() built in from python. can y

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
Actually, it happens both on a local install of CentOS 7.0.1406 and AWS's CentOS7.0.1406. hostnamectl works fine on my AWS host. On Friday, November 13, 2015 at 1:08:20 PM UTC-6, Greg Swift wrote: > > Joanna found that it has something to do with the AWS CentOS7 install. I'm > assuming based o

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
Yes, I can tell that's how it's supposed to work. However, it's like my hosts don't even get past the distribution match, wherever that happens in the code...they get dumped straight into the UnimplementedStrategy class for error handling. If the code were recognizing CentOS, it would be using

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Greg Swift
Hrm.. Hadnt seen her recreation on nonaws email. Now I'm stumped again. Hostnamectl is provided directly by systemd. On Fri, Nov 13, 2015, 13:08 Greg Swift wrote: > Joanna found that it has something to do with the AWS CentOS7 install. I'm > assuming based on her PR that it doesnt seem to have

[ansible-project] Vault and ansible_become_pass

2015-11-13 Thread Tiziano Di Gennaro
Hi all, i really need to create an inventory file with ansible_become_pass but instead to have it in clear text i want to put it inside ansible vault, and i need to do it for 400 server. Do you think it's possible and how ? -- You received this message because you are subscribed to the Google G

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Greg Swift
Joanna found that it has something to do with the AWS CentOS7 install. I'm assuming based on her PR that it doesnt seem to have hostnamectl available, which seems weird? https :// github.c

Re: [ansible-project] Re: ETA on Ansible 2.0 ?

2015-11-13 Thread Toshio Kuratomi
We should have beta3 sometime soon. We're working through some performance issues that we think are too big to ship 2.0 with (some performance fixes won't go in until 2.1 but there's a few that we want to be sure we take care of in time for 2.0). Once those are out of the way we should be startin

Re: [ansible-project] Re: Connecting to existing ec2 instances

2015-11-13 Thread Brian Coca
ah, that is totally different question, tower keeps it's credentials in it's own store. Also for tower questions go to support.ansible.com supp...@ansible.com -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe fr

[ansible-project] Re: Manage Unix Users Over Multiple Evironments with Ansible

2015-11-13 Thread Joanna Delaporte
Does the following work? when: "inventory_hostname in item.*value*.access_to" I have used dicts a little for users, and that is how I reference details for users. Joanna On Friday, November 13, 2015 at 12:02:25 PM UTC-6, Ralph Bolton wrote: > > Hi, > > I'm trying to manage a small number of

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Brian Coca
the module checks the platform and version to determine which approach it uses, for centos if the version is >= 7 it will use systemd, for other versions it uses hostname + file editing. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Proje

[ansible-project] Manage Unix Users Over Multiple Evironments with Ansible

2015-11-13 Thread Ralph Bolton
Hi, I'm trying to manage a small number of Unix users on a smallish estate of servers (~100 servers). My users are either devs, sysadmins or support, and need different access to different boxes. I've got a nice way to give them differing levels of sudo access, but now want to figure out how to

Re: [ansible-project] Re: ETA on Ansible 2.0 ?

2015-11-13 Thread James Smith
Any update on this? I see that Beta 2 is out.. We're running 1.9.4 but the digitalocean v2 API isn't supported any more, so wondering how long we'd have to wait for stable ansible 2.. On Tuesday, 8 September 2015 14:28:24 UTC+1, Brian Coca wrote: > > We already started with the alpha releases,

Re: [ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Ivan S. Freitas
I would bet the module is trying to set the hostname using the features of the old Centos' init system, then fails since it has transitioned to systemd. Can you set the hostname manually with a 'command' action calling hostnamectl? You could also try the modules from the 2.0-rc releases or git to s

[ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
I updated to Ansible 1.9.4, and I still have the same issue on both target hosts. On Wednesday, November 11, 2015 at 2:44:02 PM UTC-6, Joanna Delaporte wrote: > > Hello everyone, > > I am getting the following error while attempting to run a Galaxy role > that was published for EL 7. My target h

[ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
Okay, I just repeated the error on a recently-built CentOS 7.0.1406 machine that is on my physical network, not an AWS machine. "ansible_distribution": "CentOS", "ansible_distribution_major_version": "7", "ansible_distribution_release": "Core", "ansible_distribution_v

Re: [ansible-project] Iterate over complex dicitonary structure in j2 tempalte

2015-11-13 Thread Matt Martz
The jinja2 templates documentation contains multiple examples of looping over dictionaries: http://jinja.pocoo.org/docs/dev/templates/#for Using '.iteritems()', or '.items()' as well as using the '|dictsort' filter On Fri, Nov 13, 2015 at 9:49 AM, Hristo Stoyanov wrote: > I saw those, but they

Re: [ansible-project] using a variable as a group name when executing a task ?

2015-11-13 Thread Alejandro Comisario
My problem is that i cant use a variable for the "- host: " part to realize what servers to run on. On Friday, November 13, 2015 at 1:12:41 PM UTC-3, Uwe Sauter wrote: > > I'm not sure I understand which variable troubles you. Is it > "monitor_group" or "monitor-cloud" or "monitor_cloud"? Is the

Re: [ansible-project] using a variable as a group name when executing a task ?

2015-11-13 Thread Uwe Sauter
I'm not sure I understand which variable troubles you. Is it "monitor_group" or "monitor-cloud" or "monitor_cloud"? Is there a typo (underscore / dash)? Am 13.11.2015 um 17:09 schrieb Alejandro Comisario: > Thank for the response, sorry that i didnt clarify this. > The monitor_cloud variable is

Re: [ansible-project] Solaris and pfexec, not working?

2015-11-13 Thread Brian Coca
does ping work w/o pfexec? On Fri, Nov 13, 2015 at 1:12 AM, Thomas Willert wrote: > Hi Brian, > thanks for the 'pfexec' hints. I tried both changing my Ansible 1.9 files > and also tried using Ansible 2.0.0 0.4.beta2. The error messages I now get > are similiar although not quiet identical. They

Re: [ansible-project] using a variable as a group name when executing a task ?

2015-11-13 Thread Alejandro Comisario
Thank for the response, sorry that i didnt clarify this. The monitor_cloud variable is in the [all:vars] section of the inventory. On Friday, November 13, 2015 at 12:58:44 PM UTC-3, Uwe Sauter wrote: > > What about: > > - vars: > monitor_group: "glance" > - hosts: "{{ monitor_group }}" > r

[ansible-project] using a variable as a group name when executing a task ?

2015-11-13 Thread Alejandro Comisario
Hi all ! is there any way of achieving the following ? ( i've tried this ones and i get "*no hosts matched*" ) monitor_group = "glance" - hosts: "{{ monitor_group }}" roles: - { role: icinga2-check-commands, tags: ['monitor-cloud'] } OR monitor_group = glance - hosts: "{{ monitor_group }

Re: [ansible-project] using a variable as a group name when executing a task ?

2015-11-13 Thread Uwe Sauter
What about: - vars: monitor_group: "glance" - hosts: "{{ monitor_group }}" roles: - { role: icinga2-check-commands, tags: ['monitor-cloud'] } I'm not saying that this'll work as I am trying to figure out variables myself. But you could give it a try. Am 13.11.2015 um 16:53 schrieb

[ansible-project] Re: Variable name includes a variable

2015-11-13 Thread mtovey
I knew it would be simple if I just asked! That worked perfectly! Thanks! -Mark On Thursday, November 12, 2015 at 3:39:38 PM UTC-8, mto...@go2uti.com wrote: > > > This is something I have been struggling with for a while: a variable > whose name includes a variable. For instance,

Re: [ansible-project] Iterate over complex dicitonary structure in j2 tempalte

2015-11-13 Thread Hristo Stoyanov
I saw those, but they do not apply to jinja2 templates. /Hristo Stoyanov On Nov 12, 2015 10:45 PM, "Alex Leonhardt" wrote: > Hi, > > this may help: > > https://docs.ansible.com/ansible/playbooks_loops.html#looping-over-subelements > https://docs.ansible.com/ansible/playbooks_loops.html#looping-o

[ansible-project] Get email alert if async task runs for more than XX mins/hours?

2015-11-13 Thread tinyzais
Is it possible? -- 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 group, send email to ansible-pro

Re: [ansible-project] Re: Connecting to existing ec2 instances

2015-11-13 Thread nathan chu
Joanna - thanks; I don't see any references to that variable in /etc/ansible, and the only places I see it in my playbook directory are references to the amazon key name, no files. I think the problem may be orthogonal to what I was thinking of yesterday, though. I tried running my existin

[ansible-project] Re: msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-13 Thread Joanna Delaporte
Your role is awesome. Thanks for writing it...I ran into another issue with firewalld not being installed by default on AWS. I submitted a pull request this morning to include installing and starting firewalld. The shell command hostname seemed to worked fine, but in my research about it, sup

Re: [ansible-project] Re: Connecting to existing ec2 instances

2015-11-13 Thread Joanna Delaporte
I would grep -r your ansible directory for mykeypair. Since it is a variable specified in your playbook, either you need to define that on the command line with extra-vars, or the name of the keypair is written as a variable in a file somewhere (vars file, hosts file,etc). grep -r "mykeypair" /

Re: [ansible-project] Re: Connecting to existing ec2 instances

2015-11-13 Thread nathan chu
Thanks Brian. That's some helpful debugging advice. On Thu, Nov 12, 2015 at 5:30 PM, Brian Coca wrote: > run ansible with -v and you should see the full ssh command used, > that should point at a key, if not you likely have an agent or the ssh > user/password info in inventory. > > > > -- >

Re: [ansible-project] Solaris and pfexec, not working?

2015-11-13 Thread Thomas Willert
Hi Brian, thanks for the 'pfexec' hints. I tried both changing my Ansible 1.9 files and also tried using Ansible 2.0.0 0.4.beta2. The error messages I now get are similiar although not quiet identical. They both contain "No such file or directory": Ansible 1.9.4 - [willert@ws-wille