Re: [ansible-project] Gathering ec2 instance facts with only a region and instance id?

2015-10-06 Thread Frank Perks
, Frank Perks wrote: > > Thanks. Unfortunately it is not part of my dynamic inventory. > > Anisble runs a tool that provisions a bunch of ec2 instances, installs and > configures a bunch of software on the systems (eventually this will be > replaced by ansible i hope). The too

[ansible-project] Gathering ec2 instance facts with only a region and instance id?

2015-10-05 Thread Frank Perks
So i have a small problem, the only thing i have from the output of another tool is just an instance_id, along with its region. I need to grab some more information about the ec2 instance (such as the platform, tags, etc) in order to actually determine what inventory groups it belongs in.

Re: [ansible-project] Gathering ec2 instance facts with only a region and instance id?

2015-10-05 Thread Frank Perks
Thanks. Unfortunately it is not part of my dynamic inventory. Anisble runs a tool that provisions a bunch of ec2 instances, installs and configures a bunch of software on the systems (eventually this will be replaced by ansible i hope). The tool returns a series of instance ids and their

Re: [ansible-project] Re: Setting fact name dynamically in set_fact?

2015-09-27 Thread Frank Perks
Thanks brian. action_plugins directory worked fine for me. :D On Friday, September 25, 2015 at 6:08:18 PM UTC-4, Brian Coca wrote: > > first, you should be able to just write the var into a facts file on > the target machine and fact gathering shoudl automatically pick it up >

[ansible-project] Re: Setting fact name dynamically in set_fact?

2015-09-25 Thread Frank Perks
ample - so hope this > helps! and it may prompt some 'better' suggestions! ; ) > https://groups.google.com/d/msg/ansible-project/X1Q93QOk6Ew/ZygP5rXmfEkJ > > On Tuesday, September 22, 2015 at 12:49:13 AM UTC+1, Frank Perks wrote: >> >> I am trying to shrink ~30+ roles into a single ro

[ansible-project] Re: Setting fact name dynamically in set_fact?

2015-09-22 Thread Frank Perks
Any ideas? This is really blocking me. On Monday, September 21, 2015 at 7:49:13 PM UTC-4, Frank Perks wrote: > > I am trying to shrink ~30+ roles into a single role to drastically reduce > the amount of duplicate and copy and pasted code into a single nice and > neat role. One of

[ansible-project] Setting fact name dynamically in set_fact?

2015-09-21 Thread Frank Perks
I am trying to shrink ~30+ roles into a single role to drastically reduce the amount of duplicate and copy and pasted code into a single nice and neat role. One of the problems is each role sets a specifically named fact basically like: ec2__foo What i want to do is this: set_fact: "{{

[ansible-project] Re: Rescue block doesn't seem to work when error is in an included file

2015-09-15 Thread Frank Perks
I am dumb, and the issue is because i have: - rescue when it should be: rescue My mistake. On Tuesday, September 15, 2015 at 9:03:04 AM UTC-4, Frank Perks wrote: > > So i was hoping to use blocks as an easy way to notify success/failure of > ansible runs. > > - block

[ansible-project] Rescue block doesn't seem to work when error is in an included file

2015-09-15 Thread Frank Perks
So i was hoping to use blocks as an easy way to notify success/failure of ansible runs. - block: - include: build.yml - include: deploy_site.yml - name: Notify Slack it successfully deployed slack: - rescue: - name: Notify Slack it failed slack: When there is an error in

[ansible-project] Re: Setting hostname

2015-09-15 Thread Frank Perks
hostname_fqdn instead. On Tuesday, September 15, 2015 at 1:41:52 AM UTC-4, Kuberboef wrote: > > > > On Monday, 14 September 2015 18:01:34 UTC+2, Frank Perks wrote: >> >> ansible-hostname is a role, and should be in the roles directory. >> >> Assuming /home/stefaansm/trust

[ansible-project] Re: Setting hostname

2015-09-14 Thread Frank Perks
ansible-hostname is a role, and should be in the roles directory. Assuming /home/stefaansm/trusty64/Ansible/ is where your playbooks are. Then ansible-hostname should be located at /home/stefaansm/trusty64/Ansible/roles/ansible-hostname On Monday, September 14, 2015 at 8:20:06 AM UTC-4,

[ansible-project] Re: Required variables in var in inline vars

2015-09-14 Thread Frank Perks
You make an variable mandatory to throw an error if a var is not defined: - hosts: vars: var_required_by_role: - name: "{{ variable | mandatory }}" user: "foo" roles: - myrole Alternatively you can edit ansible.cfg to change this setting to True

Re: [ansible-project] Confused about windows passwords and working with ec2?

2015-09-09 Thread Frank Perks
I didn't realize you can specify the ansible connection on a per task level! That completely changes stuff! I will give this a shot! On Tuesday, September 8, 2015 at 4:51:48 PM UTC-4, Brian Coca wrote: > > have you tried this? > > - hosts: windows > gather_facts: false > tasks: > >

[ansible-project] Can't use local_action in Windows playbook in devel?

2015-09-09 Thread Frank Perks
I am trying to reboot a windows server after installing .net + a bunch of dependencies. I have a super simple PS module to schedule a reboot. However afterwords i would like to wait for the WinRM connection to come back: - name: Configuring windows hosts: windows roles: - win_dotnet_46

Re: [ansible-project] Can't use local_action in Windows playbook in devel?

2015-09-09 Thread Frank Perks
This is running latest version of devel (i updated this morning). delegate_to / connnection: local does not seem to work. On Wednesday, September 9, 2015 at 8:45:47 AM UTC-4, Brian Coca wrote: > > What version of ansible? have you tried with connection: local or > delegate_to: localhost:? > >

Re: [ansible-project] Confused about windows passwords and working with ec2?

2015-09-09 Thread Frank Perks
IHV0js On Wednesday, September 9, 2015 at 7:30:25 AM UTC-4, Frank Perks wrote: > > I didn't realize you can specify the ansible connection on a per task > level! > > That completely changes stuff! > > I will give this a shot! > > On Tuesday, September 8, 2015

Re: [ansible-project] Can't use local_action in Windows playbook in devel?

2015-09-09 Thread Frank Perks
gt; as for connection: local, I've had far better results with delegate_to: > localhost on the current devel branch. > > On Wednesday, September 9, 2015 at 3:38:03 PM UTC+2, Frank Perks wrote: >> >> This is running latest version of devel (i updated this morning). &g

Re: [ansible-project] Can't use local_action in Windows playbook in devel?

2015-09-09 Thread Frank Perks
Just to add something else, in 1.9.4 both Trond and my stuff works fine. On Wednesday, September 9, 2015 at 10:44:35 AM UTC-4, Frank Perks wrote: > > Hi Trond, > > I tried your module, and it fails with the same issue as above. > > fatal: [52.8.31.205]: FAILED! => {"fa

[ansible-project] Confused about windows passwords and working with ec2?

2015-09-08 Thread Frank Perks
Hi, I am unsure exactly how i am supposed to handle and work with windows passwords when working with EC2 and inventories. I know i can query the passwords by using ec2_win_password, however i am unsure exactly how i can use this value to set the ansible_ssh_pass. For that connection. For