[ansible-project] Gathering facts for all hosts and using them in a task for a specific group/single machine

2016-03-08 Thread cmacrae
Hi guys, Struggling with something that I'd really appreciate some help with. I'm putting together a little role to handle rsnapshot configuration. At the end of a template, I've got a for loop that's supposed to iterate over every host in our inventory (encompassed by the group 'servers'), look

[ansible-project] Re: Dynamically deploying multiple exclusive SSH authorized_keys

2016-01-11 Thread cmacrae
er-subelements > > and change the structure. Something like : > >ssh_authorized_keys: > - root: > - foo > - other_user: > - bar > - baz > > > > On Thursday, 7 January 2016 16:53:51 UTC+5:30, cmacrae wrote: >>

[ansible-project] Dynamically deploying multiple exclusive SSH authorized_keys

2016-01-07 Thread cmacrae
Hi all, Further misunderstandings on my part for iterating over varied YAML structures, but here's the deal: I'm writing a super tiny role with the intent of dynamically deploying any authorized_keys defined in a host/group's vars. That is to say, I need a task that will deploy keys to varied us

[ansible-project] Re: help: install/upgrade a list of RPMs

2015-12-15 Thread cmacrae
Ah okay, cool :) Hmm, well, does my solution above still not stand? I mean, with your above pseudo code, the second task will install the package if it's not present, in doing so, it will install the latest package. The third task will just ensure any packages in the list installed are at their

[ansible-project] Re: help: install/upgrade a list of RPMs

2015-12-15 Thread cmacrae
Hey, I'd recommend you read fully through the 'Getting Started ' guide, and carry on reading through the other docs - reading these and implementing/playing with what they teach is the quickest, most efficient way to learn. That said

[ansible-project] Re: Iterating over a list in a dictionary within a Jinja2 template

2015-12-14 Thread cmacrae
ey }}/bin/hubot --adapter {{ item.value.adapter }} [Install] WantedBy=multi-user.target Hope this helps anyone that stumbles upon it! On Tuesday, 8 December 2015 10:57:23 UTC, cmacrae wrote: > > Hi guys, > > I've got something I'd really like some help on, not just the s

[ansible-project] Re: Iterating over a list in a dictionary within a Jinja2 template

2015-12-14 Thread cmacrae
ey }}/bin/hubot --adapter {{ item.value.adapter }} [Install] WantedBy=multi-user.target Hope this helps anyone that stumbles upon it! On Tuesday, 8 December 2015 10:57:23 UTC, cmacrae wrote: > > Hi guys, > > I've got something I'd really like some help on, not just the solution,

[ansible-project] Management of multiple exclusive authorized_keys entries, for multiple users

2015-12-11 Thread cmacrae
Hi everyone. I've been mulling something over in my head, I've got something I want to tackle, but I'm not sure how to go about doing so. Here's the scenario: I want to put together a tiny role that manages user's authorized keys. Keys defined in the inventory (host_vars/group_vars/playbook va

[ansible-project] Re: Iterating over a list in a dictionary within a Jinja2 template

2015-12-11 Thread cmacrae
Thanks Mike! I'll take a go at using this :) On Tuesday, 8 December 2015 15:06:08 UTC, Mike Biancaniello wrote: > > First, in your j2, you can't ever reference `item` without `item.key` or > `item.value`. > > However, I think your amin problem is that your first iteration is a dict > (not a list

[ansible-project] Iterating over a list in a dictionary within a Jinja2 template

2015-12-08 Thread cmacrae
Hi guys, I've got something I'd really like some help on, not just the solution, but the understanding and perhaps any related documentation/articles. I'm writing a role for deployment of Hubot. To define bots to be deployed, I'm using a dictionary, like so: hubot_bots: testbot: owner: 'Bo

Re: [ansible-project] Dictionary lookups being clobbered when assigning values to children elsewhere

2015-11-15 Thread cmacrae
> your role, but instead use what you were doing previously with > sensu_api_host. > > On Sunday, November 15, 2015, cmacrae > > wrote: > >> Hey People, >> >> Having some trouble using YAML dictionaries. >> I'm refactoring my variable structure i

[ansible-project] Re: Dictionary lookups being clobbered when assigning values to children elsewhere

2015-11-15 Thread cmacrae
; easier to just avoid dictionary variables just to keep things simple. Seems > like some changes have been made in v2.0. > > On Sunday, November 15, 2015 at 8:37:27 AM UTC-5, cmacrae wrote: >> >> Hey People, >> >> Having some trouble using YAML dictionaries. >

[ansible-project] Dictionary lookups being clobbered when assigning values to children elsewhere

2015-11-15 Thread cmacrae
Hey People, Having some trouble using YAML dictionaries. I'm refactoring my variable structure in a role a wrote a while ago. The variables used to all look like: sensu_api_host, but I wanted to move to using dictionaries, so when referencing them it wouldn't be: {{ sensu_api_host }} it'd be:

[ansible-project] Re: Unable to establish SSH connection using Ansible

2015-07-29 Thread cmacrae
Cheers Paul! This is now sorted - really appreciate the help - I'm not sure how I missed that in the debug output... On Wednesday, 29 July 2015 12:37:03 UTC+1, Paul Markham wrote: > > The problem looks to be that you're trying to ssh as user 'ansible' when > running the ansible command, instead

Re: [ansible-project] Unable to establish SSH connection using Ansible

2015-07-29 Thread cmacrae
ible is using the “ansible” user to try > the login. > > Have you tried setting remote_user in the ansible.cfg [ > /opt/ansible/etc/ansible.cfg > in your case ]? > > Ref. https://docs.ansible.com/ansible/intro_configuration.html#remote-user > > - > A. > >

[ansible-project] Unable to establish SSH connection using Ansible

2015-07-29 Thread cmacrae
I'm working on a role to deploy my Ansible setup (sort of a 'master node' configuration - where I execute Ansible from). Issue Description I've encountered a rather strange issue: I'm able to SSH as the user I'm running Ansible as to systems within my infrastructure using key pair authentica

[ansible-project] Check for the existence of data on an Ansible server before attempting distribution

2015-03-09 Thread cmacrae
I've been trying to come up with an elegant solution to this, but alas; no such luck - perhaps some of you smart people can help. Enough blabbering: I have a directory containing subdirectories named after some groups in my inventory. I'm using the 'group_names' variable in the 'src' parameter's