Thanks James! Will give this a shot and add the example
--
Iain Wright
This email message is confidential, intended only for the recipient(s)
named above and may contain information that is privileged, exempt from
disclosure under applicable law. If you are not the intended recipient, do
not dis
Hi all
I have a play like this:
---
- hosts: group
sudo: True
gather_facts: no
tasks:
- name: actually fetch files
fetch: src={{ item }} dest=/ansible/deployment/files/backup/group/
with_fileglob: /etc/yum.repos.d/*
Which seems to run successfully:
$ ansible-playbook fetc
Depending on the file, sometimes they support an include statement (e.g.,
sudoers, apparmor, mysql, apache, ...) that you could assert lineinfile for
then use template or file on the include file as appropriate.
--michael
On Jun 18, 2014 3:14 PM, "Michael Baydoun" wrote:
> I need to add 10 lines
The technique I usually use for making a role work cross-distro is to do
two things:
*For variables*: Include a variables file named {{ ansible_os_family }}.yml
(then stick 'Debian.yml' and 'RedHat.yml', etc. into the role's vars folder.
*For tasks*: Add "when: ansible_os_family == 'Distributio
How about this solution?
In `defaults/main.yml`:
java_distribution_packages:
Debian: [ 'openjdk-7', 'java-stuff' ]
RefHat: [ 'java-runtime-7', 'other-stuff' ]
And then, in `tasks/main.yml`:
- {{ ansible_pkg_mgr }}: name={{ item }} state=latest
witn_items: java_distribu
Thanks for the confirmation. Filed as
https://github.com/ansible/ansible/issues/7832
On Wed, Jun 18, 2014 at 10:12 PM, James Cammarata
wrote:
> Yes, definitely a bug, so please open an issue for this. And the "-1" is
> used by the AWS API to indicate "any", so for the error above it's trying to
>
I've filed it as 2 separate issues since they could be related but
different (one completing but with the wrong results and the other
failing with the traceback):
https://github.com/ansible/ansible/issues/7833
https://github.com/ansible/ansible/issues/7835
But I'm still a bit confused about the w
I have a task that iterates over a dictionary of directory names to remove
a file:
- name: Remove conflicting XACML policy
file: path=/opt/fedora/{{ item.key }}/data/blah.xml
state=absent
with_dict: installs
notify: Reload XACML
If the file is removed, a handler is required to res
I have a strange problem with new wheezy machines
on lenny ist works
ansible backuppc -a ' whoami' -u seidenberg --su -k --ask-su-pass -
SSH password:
su password:
ESTABLISH CONNECTION FOR USER: seidenberg
REMOTE_MODULE command whoami
EXEC ['sshpass', '-d6', 'ssh', '-C', '-tt', '-vvv', '
It seems like it's waiting for the password prompt, due to the format of
the prompt not matching what we're expecting. Could you execute the command
via su on the system and report back what the password prompt is? We can
open an issue for this as well and get the regex updated so it will match
the
Because an application is making changes to other parts of the file, and
those changes need to be maintained. I can't overwrite what the
application is doing.
On Thursday, June 19, 2014 1:35:38 AM UTC-4, James Cammarata wrote:
>
> Why not use a template, or the assemble module? Both of those wo
unfortunately, it's not that kind of file. It's a xml file for Oracle BI
On Thursday, June 19, 2014 7:41:41 AM UTC-4, Michael Schultz wrote:
>
> Depending on the file, sometimes they support an include statement (e.g.,
> sudoers, apparmor, mysql, apache, ...) that you could assert lineinfile for
on second thought, maybe I can do something like this in xml. I'll take a
look into that.
On Thursday, June 19, 2014 10:21:18 AM UTC-4, Michael Baydoun wrote:
>
> unfortunately, it's not that kind of file. It's a xml file for Oracle BI
>
> On Thursday, June 19, 2014 7:41:41 AM UTC-4, Michael Sc
Hi,
I'm trying to install openjdk-7-jdk on Ubuntu 14.04, however I'm running
into a problem:
When I run my playbook:
- name: Install Java 6
sudo: yes
apt: name=openjdk-6-jdk state=latest install_recommends=no
I get: {"changed": false}
Now if I SSH into my Vagrant box and do the usual sudo
Well, for starters, you're talking about installing openjdk-7, but your
playbook is targeting openjdk-6... Typo?
On Thu, Jun 19, 2014 at 9:05 AM, Patrick S wrote:
> Hi,
>
> I'm trying to install openjdk-7-jdk on Ubuntu 14.04, however I'm running
> into a problem:
>
> When I run my playbook:
>
Indeed it is a typo- sorry. I've been trying both to see if there was any
difference- however it occurs for both.
On Thursday, 19 June 2014 16:27:25 UTC+1, Scott Sturdivant wrote:
>
> Well, for starters, you're talking about installing openjdk-7, but your
> playbook is targeting openjdk-6... Ty
I have this inconsistency when I declare variable pairs used in a template
vs. variable pairs used directly in a playbook e.g:
Works in a template:
group_vars/all
fusemq_users:
- { 'username': 'admin', 'password': 'admin', 'role' : 'admin' }
role_name/templates/users.properties
{% for line
I'd like to access a variable set by the ec2.py dynamic inventory script in
a Jinja2 template, but I can't work out how to do it.
ec2.py returns a variable called ec2_tag_elasticbeanstalk_environment-name
for EC2 instances that are part of an Elastic Beanstalk environment:
ec2.py --host=ec2-54-
After further investigation...
When the playbook runs, on that task I get:
fatal: [ec2-54-196-159-144.compute-1.amazonaws.com] => {'msg': "unsupported
operand type(s) for -: 'StrictUndefined' and 'StrictUndefined'", 'failed':
True}
If I define the variable in the group_vars file I get the same
Hello everyone!
Since the 'include' doesn't work anymore with 'with_items', I am trying to
do the following:
...
- name: add EIP to the instance
local_action: ec2_eip in_vpc=yes instance_id={{ item.id }} region={{
region }}
with_items: ec2.instances
register: eip
- name: output the IP
Hello,
I bootstrap server security from a bootstrap.yml playbook.
Before restarting the ssh service, I'd like to test that it is possible to
ssh into the host via the key mechanism (I have used the authorized_keys
module for this purpose).
I'm trying with the ping module as a task, but I'm not s
Could it be something as easy as (route53.yml)
...
- name: getting & showing all records matchig our stores
local_action: route53 command=get zone={{ item.zone }} record={{ item.record
}} type=A value={{ elasticip.public_ip }}
with_items:
- { record: '{{ comhost }}',
instead of using user=xxx as an argument for the ping module, I use
successfully the task remote_user attribute.
But still, I'm unsure if the test works because I am already connected to
the host, or because ansible is using the password I provided via the -k
option
2014-06-19 18:21 GMT+02:00 La
Hi all,
I don't seem to find a way to do the following, which probably means I'm
trying to do it in some weird way.
---
# tasks/main.yml
- name: check docker socket existence
stat: path=/var/run/docker.sock
register: docker_socket
- name: set docker_url based on socket existence
some-modu
Never do this, ansible_pkg_mgr does not allow the with_items block to be
grouped into a single yum/apt transaction, which results in much slower
package installations.
I understand why it's appealing, but really don't ... you'll also find that
the yum and apt modules have different options you may
no apparently I've still got this wrong
2014-06-19 18:29 GMT+02:00 Laurent PETIT :
> instead of using user=xxx as an argument for the ping module, I use
> successfully the task remote_user attribute.
>
> But still, I'm unsure if the test works because I am already connected to
> the host, or bec
I believe what you are attempting should work. But you seem to be missing
reference to the "set_fact" module in the second task.
"some-moudle-that-sets-vars" is the "set_fact" module, and should do what
you want.
On Thu, Jun 19, 2014 at 11:35 AM, Vasco Figueira
wrote:
> Hi all,
>
> I don't se
Ok the command via su on Lenny
seidenberg@backupPC:~$ su root -c /bin/bash -c echo
SUDO-SUCCESS-piguunfptuenxfyxauqmavtunfzjnayk; LC_CTYPE=C LANG=C
/usr/bin/python
/home/seidenberg/.ansible/tmp/ansible-tmp-1403175187.6-175350529956768/command
Password:
and the command on wheezy
seidenberg@se
Will this work ok if I use apt: module directly instead? For different
package lists in Debian and Ubuntu, for example.
19 cze 2014 18:49 "Michael DeHaan" napisał(a):
> Never do this, ansible_pkg_mgr does not allow the with_items block to be
> grouped into a single yum/apt transaction, which resu
You can achieve pretty much the same thing by using group_by or conditional
includes along with the variable structure you've defined, without loosing
the benefits Michael mentioned.
It should work fine with the apt or yum (or other package modules).
On Thu, Jun 19, 2014 at 11:53 AM, Maciej Delm
On Friday, June 6, 2014 1:06:31 PM UTC-4, Eric Johnson wrote:
>
>
> But do whack those credentials straight away!
>
>
I should have mentioned, those credentials were changed for just that
reason... altered many characters to obscure them, but left them the exact
same length and format.
Just upda
You can pull it from the hostvars dictionary with something like
hostvars[inventory_hostname]['ec2_tag_elasticbeanstalk_environment-name']
On Thu, Jun 19, 2014 at 12:06 PM, Roger Hunwicks
wrote:
> After further investigation...
>
> When the playbook runs, on that task I get:
>
> fatal: [ec
Interesting, no obvious difference there.
On Thu, Jun 19, 2014 at 11:53 AM, Holger Seidenberg <
seidenberg.hol...@gmail.com> wrote:
> Ok the command via su on Lenny
>
> seidenberg@backupPC:~$ su root -c /bin/bash -c echo
> SUDO-SUCCESS-piguunfptuenxfyxauqmavtunfzjnayk; LC_CTYPE=C LANG=C
> /usr/b
Turns out I make most of technical decisions based on spite:)
But plays in playbooks can be tagged which are in turn composed of roles
and tasks. It just seems you might want to "tag" a playbook as having a
certain category of functionality. Basically I need to do this because I
am trying to
Right, I would agree.
Build images with Ansible - stick in registry or wherever. "Cloud" thing
may provide this.
Have Ansible tell "cloud" scheduler how many images to deploy into "cloud"
from registry.
On Wed, Jun 18, 2014 at 12:28 PM, Drew Northup
wrote:
> On Wednesday, June 18, 2014 11
I'm not sure.
Perhaps you could register a timestamp of the kernel or the last changed
time of the kernel page, run the update, and then use a when statement to
see if it changed?
This could be a no-op statement that notified a reboot as the last action
in your playbook.
On Wed, Jun 18, 2014 at
Filters are that way, I don't think there needs to be a simpler way as
filters work fine for this.
On Wed, Jun 18, 2014 at 11:18 PM, Tovey, Mark wrote:
>
>
> That got it! I figured that this shouldn’t be that difficult a thing
> to accomplish and there must be a simpler way to achieve wh
I'd perhaps run this with -vvv for starters, and then maybe show the
command you are showing to show there aren't any files?
On Thu, Jun 19, 2014 at 5:54 AM, Makimoto Marakatti
wrote:
> Hi all
>
> I have a play like this:
>
> ---
> - hosts: group
> sudo: True
> gather_facts: no
> tasks:
Already got this on github, yes, but the problem is the 'environment'
variable in Ansible is reserved.
The "environment" keyword stores variables here.
We may consider changing this to ansible_environment as this occasionally
happens.
On Thu, Jun 19, 2014 at 8:40 AM, Michael Peters
wrote:
>
This is unfortunately not possible.
On Wed, Jun 18, 2014 at 3:08 PM, Peter Murray
wrote:
> I have a task that iterates over a dictionary of directory names to remove
> a file:
>
> - name: Remove conflicting XACML policy
> file: path=/opt/fedora/{{ item.key }}/data/blah.xml
> state=
In one, you have fusemq_users as a list, in the other, you have a hash.
If you are going to feed it a list, perhaps you want to use with_items, or
otherwise, perhaps you want to reference the first element in the list.
On Thu, Jun 19, 2014 at 10:31 AM, jepper wrote:
> I have this inconsist
I've seen some interesting variations of:
- local_action: shell ssh ...
For those kinds of tests with keys, feeding it lots of SSH options.
Be careful to launch a command like "echo" and not something interactive.
On Thu, Jun 19, 2014 at 11:50 AM, Laurent PETIT
wrote:
> no apparently I've
group_by is awesome.
- hosts: webservers
group_by: key=webservers_{{ ansible_os_family }}
- hosts: webservers_RedHat
roles:
- ...
On Thu, Jun 19, 2014 at 11:56 AM, James Cammarata
wrote:
> You can achieve pretty much the same thing by using group_by or
> conditional includes along
Really we should probably replace all "-" with "_" in tag names so they can
be cleanly used as variables.
But then again, the tag had a "-" in it, so I'm not sure that's the right
thing to do.
Anyway, variables can't have "-" in them, which is why that happens, so
it's easy to fix with a conventi
I thought about tackling this along with the proposed "downcase_facts"
option for ec2.ini. Something like "normalize_facts" or some such so
that anything that's not a letter or number gets converted to an
underscore. Would default to false just like downcase_facts.
On Thu, Jun 19, 2014 at 5:30 PM,
" It just seems you might want to "tag" a playbook as having a certain
category of functionality."
You can tag individual plays, but not whole playbooks. Should be
good enough.
This will apply he the tag to all tasks (whether in roles or not) therein.
On Thu, Jun 19, 2014 at 1:25 PM, Marc P
That seems reasonable to me.
On Thu, Jun 19, 2014 at 4:33 PM, Michael Peters
wrote:
> I thought about tackling this along with the proposed "downcase_facts"
> option for ec2.ini. Something like "normalize_facts" or some such so
> that anything that's not a letter or number gets converted to a
with_fileglob is running on the 'master' not on the target server, so
unless they have the same files this won't work.
you might want to run a shell: find + register a var for use in the fetch
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group
Yep, that's true!
On Thu, Jun 19, 2014 at 4:45 PM, Brian Coca wrote:
> with_fileglob is running on the 'master' not on the target server, so
> unless they have the same files this won't work.
>
> you might want to run a shell: find + register a var for use in the fetch
>
>
> --
> You receiv
Hi everyone,
We've just pushed some code that you might like. Ansible support for
managing Windows machines!
Read all about it here:
http://www.ansible.com/blog/windows-is-coming
http://docs.ansible.com/intro_windows.html
Module discussion should happen on the development branch as we expand
Hello, I'm new to Ansible: Here's what I'm looking to do for my first
playbook/automation with it.
I have a list of users, like below. Oh and by the way I'm running this on
OSX. First of all where do I save this file? and what to a call it?
anythingiwant.yaml?
# List of uses
- abc123
- def532
Hi,
I'm converting a bunch of my Puppet modules to Ansible and was wondering
if, when using the "assemble" module, is there any way to also have
template evaluation done at runtime? Or do I have to do this in 2 steps:
a) use the template module to loop through my fragment templates and put
the
Yep, call the template module for each fragment you make, then call
assemble.
There's really no notion of anything other than runtime.
On Thu, Jun 19, 2014 at 2:30 PM, Ken Wong wrote:
> Hi,
> I'm converting a bunch of my Puppet modules to Ansible and was wondering
> if, when using the "assem
On Thu, Jun 19, 2014 at 12:37 PM, tb582 wrote:
> Hello, I'm new to Ansible: Here's what I'm looking to do for my first
> playbook/automation with it.
>
> I have a list of users, like below. Oh and by the way I'm running this on
> OSX. First of all where do I save this file? and what to a call it?
I see a need for running a command remotely to determine whether a command
play should be executed. There is a lot that 'creates', and 'removes'
doesn't cover. I'd like to support file test operators and more. I
realize this could be accomplished using a preceding command play that sets
a va
ok what else can i do to investigate the problem ?
Am Donnerstag, 19. Juni 2014 13:06:19 UTC+2 schrieb Holger Seidenberg:
>
> I have a strange problem with new wheezy machines
>
> on lenny ist works
>
> ansible backuppc -a ' whoami' -u seidenberg --su -k --ask-su-pass -
> SSH password:
> su
56 matches
Mail list logo