[ansible-project] Re: Can't use register module (error).

2014-04-06 Thread David Álvarez
Hello again, I found the problem, only has indentation. Thanks. On Fri, Apr 4, 2014 at 1:01 PM, David Álvarez wrote: > Hello community, > > I'm learning this tool, and it's great =). > > My first problem is when I'm testing register module, Ansible show me a > error: > > Error: Syntax Error wh

[ansible-project] Can't use register module (error).

2014-04-06 Thread David Álvarez
Hello community, I'm learning this tool, and it's great =). My first problem is when I'm testing register module, Ansible show me a error: Error: Syntax Error while loading YAML script, test_monitor.yml Note: The error may actually appear before this position: line 8, column 1 - name: Output co

[ansible-project] Playbook not idempotent because operation is not, any way to workaround?

2014-04-06 Thread Sean Bigdatafun
I am experimenting a playbook and one task failed during its execution - my playbook - - name: yum install epel packages yum: name=http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm state=present The above task failed for some

[ansible-project] simple thing that looks difficult: cooking command line for nmap

2014-04-06 Thread txemi Martínez
I am starting with ansible and sometimes I find things that I would be able to program in python, bash or java but I do not know hot to handle in ansible playbooks. I want some remote machine to make an nmap on all local networks. This is the command I want: nmap -T4 -A -F -oX /tmp/${filename}

Re: [ansible-project] Any way to make a task serial (or set mutex so only 1 thread run it at a time)?

2014-04-06 Thread Khaled Janania
The documentation doesn't really answer the question though. Does that mean there's no way to define one task as serial? In other words, serial only applies for all tasks? On Thursday, January 23, 2014 8:06:38 PM UTC-5, Michael DeHaan wrote: > > That's a pretty old post. > > You should read up

[ansible-project] Specific variable "disappears" in 1.5.4 ?

2014-04-06 Thread rick
In my main playbooks I define a global variable named "dns_type", used in multiple roles. It's simply defined like this: vars: dns_type: "CNAME" This worked fine up to 1.5.3. In 1.5.4, this variable turns up empty when I try to use it in a role. If I rename it to "dnstype" or "dns_foo", it

[ansible-project] "Correct" way to install EPEL rpms?

2014-04-06 Thread Sean Bigdatafun
TASK: [common | yum install epel packages] failed: [ceph-osd1] => {"changed": true, "item": "", "rc": 1, "results": ["Loaded plugins: fastestmirror, security\nDetermining fastest mirrors\nCould not retrieve mirrorlist http://mirrorlist.centos.org/?releas

[ansible-project] Help with Idempotent lineinfile regex

2014-04-06 Thread Antonio Marin
Hello, I'm trying to create a lineinfile task to append a word in a line, when it's not present, like the following: # The line should start with AllowGroups # Follows an unknown length sequence of "\s\w+" # It's possible to find groupN within the previous sequence, in which case the task shoul

Re: [ansible-project] Specific variable "disappears" in 1.5.4 ?

2014-04-06 Thread James Cammarata
I'm not quite able to reproduce that on 1.5.4, could you share a small playbook/role that reproduces the issue for you? On Fri, Apr 4, 2014 at 12:01 PM, wrote: > In my main playbooks I define a global variable named "dns_type", used in > multiple roles. It's simply defined like this: > > vars:

Re: [ansible-project] simple thing that looks difficult: cooking command line for nmap

2014-04-06 Thread James Cammarata
There are a couple of options you could use here. First, you could deploy a custom fact that would give you the CIDR value. Second, you could write a custom jinja2 filter that would accept a netmask (for example, ansible_eth0.ipv4.netmask) and convert that to a CIDR value. On Fri, Apr 4, 2014 at

Re: [ansible-project] simple thing that looks difficult: cooking command line for nmap

2014-04-06 Thread Antonio Marin
You can also create the mentioned script an invoke it as local_action: before your remote nmap task. On Apr 6, 2014 4:06 PM, "James Cammarata" wrote: > There are a couple of options you could use here. First, you could deploy > a custom fact that would give you the CIDR value. Second, you could w

Re: [ansible-project] Any way to make a task serial (or set mutex so only 1 thread run it at a time)?

2014-04-06 Thread Paul Durivage
Correct, a task does not allow the keyword serial to be defined on it. There's no need to define an entirely new playbook, but you will have to declare a new play. On Fri, Apr 4, 2014 at 12:39 PM, Khaled Janania wrote: > The documentation doesn't really answer the question though. Does that >

Re: [ansible-project] "Correct" way to install EPEL rpms?

2014-04-06 Thread Paul Durivage
It says it could't resolve mirrorlist.centos.org, so you have a DNS problem -- *at least* a DNS problem. Because this is CentOS, I'd verify that the primary public interface (probably eth0) is enabled at boot and out from under network-manager control, particularly if you're running it as a server

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

2014-04-06 Thread Paul Durivage
A better, more reliable approach would be to create a template sshd_config file (or just a regular, non-templated file) that is placed on nodes via the copy or templatemodule. -- Forwarded message

Re: [ansible-project] Playbook not idempotent because operation is not, any way to workaround?

2014-04-06 Thread Dick Davies
In this case it sounds like yum has had an issue and got itself in a mess, it's not really something Ansible can do much about as it delegates to yum to handle this. If it requires user intervention to solve, that's where ad-hoc commands come in. ansible all -a "sudo yum get_your_act_together"

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

2014-04-06 Thread Tony Marin
It's not an option as the current file has previously templated with some common configuration. It's a role who has to add the group to the line if the host includes it. Br On 06/04/14 17:24, Paul Durivage wrote: A better, more reliable approach would be to create a template sshd_config file

[ansible-project] Notifying handler only once

2014-04-06 Thread Jacob Weber
Is there a way to have multiple plays call a "notify" handler, but have the handler run only once, at the end of all plays? For example, say I have site.yml: - include webservers.yml - include database.yml And in both webservers.yml and database.yml, I have a role that calls: notify: update lo

[ansible-project] Variable Register: key

2014-04-06 Thread ralovely
Hi list. I tried, unsuccessfully, to have a register key set to a variable name: -name: Some other task [...] vars: register_name: a_specific_name - name: The task [...] register: "{{ register_name }}" I imagine the key is not evaluated, can someone confirm this ? Thanks. raphae